2 years agoForward includes to url/ master
brettw [Thu, 11 Apr 2013 23:08:52 +0000 (23:08 +0000)]
Forward includes to url/

This is in preparation for moving the files to the Chromium repository. The
current headers will forward Chromium clients to files in the new location so
the include paths can be updated in a separate pass.

Review https://codereview.chromium.org/14090005/
Patch by Thiago Farina

git-svn-id: http://google-url.googlecode.com/svn/trunk@185 8873c55e-713a-0410-88f8-23d9c3d90b1b

2 years agoFix C++11 compilation on iOS
brettw [Fri, 5 Apr 2013 20:02:20 +0000 (20:02 +0000)]
Fix C++11 compilation on iOS

Fixes an "invalid suffix on literal" warning.

Patch by stuartmorgan@chromium.org
Original review https://codereview.chromium.org/13467017/

git-svn-id: http://google-url.googlecode.com/svn/trunk@184 8873c55e-713a-0410-88f8-23d9c3d90b1b

2 years agoTypo fix: we're referring to the wrong spec_.
ericu@chromium.org [Tue, 29 Jan 2013 00:27:29 +0000 (00:27 +0000)]
Typo fix: we're referring to the wrong spec_.

Review URL: https://codereview.chromium.org/11821041

git-svn-id: http://google-url.googlecode.com/svn/trunk@183 8873c55e-713a-0410-88f8-23d9c3d90b1b

2 years agoAdd googleurl.gyp to make it possible to build using gyp tool.
brettw [Thu, 24 Jan 2013 21:46:56 +0000 (21:46 +0000)]
Add googleurl.gyp to make it possible to build using gyp tool.

Patch by tfarina@chromium.org
Original review https://codereview.chromium.org/12045039/

git-svn-id: http://google-url.googlecode.com/svn/trunk@182 8873c55e-713a-0410-88f8-23d9c3d90b1b

2 years agoMake ResolveRelative work with all hierarchical URLs.
brettw [Thu, 20 Dec 2012 21:49:49 +0000 (21:49 +0000)]
Make ResolveRelative work with all hierarchical URLs.

This makes the ResolveRelative method work correctly for all
hierarchical URLs while preserving the special support for the
"standard" schemes.

The change is needed for Android WebView, where it is perfectly
valid for an embedder to load a data URL with a base URL that is
a custom scheme (like myapp://resources/) and then later intercept
those requests.

Patch by Martin Kosiba

git-svn-id: http://google-url.googlecode.com/svn/trunk@181 8873c55e-713a-0410-88f8-23d9c3d90b1b

2 years agoSchemeIsSecure must return true for "wss"
brettw [Fri, 12 Oct 2012 19:49:50 +0000 (19:49 +0000)]
SchemeIsSecure must return true for "wss"

Patch by toyoshim@chromium.org
Review https://codereview.chromium.org/11092076/

git-svn-id: http://google-url.googlecode.com/svn/trunk@180 8873c55e-713a-0410-88f8-23d9c3d90b1b

2 years agoExpose functions to stringify IPv4 and IPv6 addresses
eroman@chromium.org [Thu, 6 Sep 2012 20:56:41 +0000 (20:56 +0000)]
Expose functions to stringify IPv4 and IPv6 addresses


Code review: https://chromiumcodereview.appspot.com/10919114/

git-svn-id: http://google-url.googlecode.com/svn/trunk@179 8873c55e-713a-0410-88f8-23d9c3d90b1b

2 years agoRevert r176, this breaks some Chrome tests.
brettw [Mon, 20 Aug 2012 19:02:46 +0000 (19:02 +0000)]
Revert r176, this breaks some Chrome tests.

git-svn-id: http://google-url.googlecode.com/svn/trunk@178 8873c55e-713a-0410-88f8-23d9c3d90b1b

2 years agoAdd a missing include.
brettw [Mon, 20 Aug 2012 17:29:48 +0000 (17:29 +0000)]
Add a missing include.

git-svn-id: http://google-url.googlecode.com/svn/trunk@177 8873c55e-713a-0410-88f8-23d9c3d90b1b

2 years agoFix handling of URLs with no schema.
brettw [Mon, 18 Jun 2012 20:58:11 +0000 (20:58 +0000)]
Fix handling of URLs with no schema.

Patch by mnaganov@chromium.org
Review https://chromiumcodereview.appspot.com/10542140/

git-svn-id: http://google-url.googlecode.com/svn/trunk@176 8873c55e-713a-0410-88f8-23d9c3d90b1b

3 years agoChange #include <memory.h> to #include <string.h>
brettw [Fri, 11 May 2012 21:24:19 +0000 (21:24 +0000)]
Change #include <memory.h> to #include <string.h>

This allows the file to build with the NaCl toolchain.

Review = http://codereview.chromium.org/10389101/
Author = Bill Budge

git-svn-id: http://google-url.googlecode.com/svn/trunk@175 8873c55e-713a-0410-88f8-23d9c3d90b1b

3 years agoFix path component length for zero-length paths canonicalized to '/'.
ericu@chromium.org [Wed, 9 May 2012 17:45:26 +0000 (17:45 +0000)]
Fix path component length for zero-length paths canonicalized to '/'.
Review URL: https://chromiumcodereview.appspot.com/10386035

git-svn-id: http://google-url.googlecode.com/svn/trunk@174 8873c55e-713a-0410-88f8-23d9c3d90b1b

3 years agoRemove ifdef guard for FULL_FILESYSTEM_URL_SUPPORT.
ericu@chromium.org [Tue, 24 Apr 2012 18:19:57 +0000 (18:19 +0000)]
Remove ifdef guard for FULL_FILESYSTEM_URL_SUPPORT.
Add creation of inner_url_ to the places outside the GURL constructor that
effectively construct GURLs.

git-svn-id: http://google-url.googlecode.com/svn/trunk@173 8873c55e-713a-0410-88f8-23d9c3d90b1b

3 years agoRemove a test that only works on one of windows/*nix; it's not needed, and not
brettw [Wed, 4 Apr 2012 23:09:53 +0000 (23:09 +0000)]
Remove a test that only works on one of windows/*nix; it's not needed, and not
worth #ifdeffing to have two different expectations.

Review: https://chromiumcodereview.appspot.com/9961021/
Patch by ericu@chromium.org

git-svn-id: http://google-url.googlecode.com/svn/trunk@172 8873c55e-713a-0410-88f8-23d9c3d90b1b

3 years agoI fixed the expectation [the URL is invalid] and added a few slashes to make it
brettw [Tue, 3 Apr 2012 20:43:06 +0000 (20:43 +0000)]
I fixed the expectation [the URL is invalid] and added a few slashes to make it
more obvious how we canonicalize bad filesystem:file URLs that are missing the
storage type specifier.

Review https://chromiumcodereview.appspot.com/9956109/
Patch by ericu@chromium.org

git-svn-id: http://google-url.googlecode.com/svn/trunk@171 8873c55e-713a-0410-88f8-23d9c3d90b1b

3 years agoDisable failing filesystem URL test.
brettw [Tue, 3 Apr 2012 15:48:29 +0000 (15:48 +0000)]
Disable failing filesystem URL test.

git-svn-id: http://google-url.googlecode.com/svn/trunk@170 8873c55e-713a-0410-88f8-23d9c3d90b1b

3 years agoFix a memory leak; properly initialize inner_parsed before use. git-svn
brettw [Mon, 26 Mar 2012 19:44:24 +0000 (19:44 +0000)]
Fix a memory leak; properly initialize inner_parsed before use.


Patch by ericu@chromium.org
Review: https://chromiumcodereview.appspot.com/9838097/

git-svn-id: http://google-url.googlecode.com/svn/trunk@169 8873c55e-713a-0410-88f8-23d9c3d90b1b

3 years agoAdd missing file from r166.
eroman@chromium.org [Thu, 19 Jan 2012 02:40:02 +0000 (02:40 +0000)]
Add missing file from r166.

Add support for real full filesystem URL parsing and canonicalization.

See also the chromium [http://codereview.chromium.org/7811006/] and webkit
[http://codereview.chromium.org/8856006/] changes that will depend on this.

Patch by ericu@chromium.org

git-svn-id: http://google-url.googlecode.com/svn/trunk@168 8873c55e-713a-0410-88f8-23d9c3d90b1b

3 years agoFix the GURL change [compile error, two small changes to make things safe while
brettw [Thu, 5 Jan 2012 00:31:24 +0000 (00:31 +0000)]
Fix the GURL change [compile error, two small changes to make things safe while
the rest of the changes aren't in yet].

Review = http://codereview.chromium.org/8974033/
Patch by ericu@chromium.org

git-svn-id: http://google-url.googlecode.com/svn/trunk@167 8873c55e-713a-0410-88f8-23d9c3d90b1b

3 years agoAdd support for real full filesystem URL parsing and canonicalization.
brettw [Wed, 4 Jan 2012 22:47:15 +0000 (22:47 +0000)]
Add support for real full filesystem URL parsing and canonicalization.

See also the chromium [http://codereview.chromium.org/7811006/] and webkit
[http://codereview.chromium.org/8856006/] changes that will depend on this.

Patch by ericu@chromium.org

git-svn-id: http://google-url.googlecode.com/svn/trunk@166 8873c55e-713a-0410-88f8-23d9c3d90b1b

3 years agoRemove a static initializer from gurl.cc when using libstdc++.
brettw [Tue, 3 Jan 2012 17:56:40 +0000 (17:56 +0000)]
Remove a static initializer from gurl.cc when using libstdc++.

Patch by Nico Weber


git-svn-id: http://google-url.googlecode.com/svn/trunk@165 8873c55e-713a-0410-88f8-23d9c3d90b1b

3 years agoGURL: Export some missing symbols needed to run gurl
eroman@chromium.org [Thu, 10 Nov 2011 19:55:36 +0000 (19:55 +0000)]
GURL: Export some missing symbols needed to run gurl
unit tests on Linux.


Patch contributed by rvargas@chromium.org

Code review: http://codereview.chromium.org/8508018/

git-svn-id: http://google-url.googlecode.com/svn/trunk@162 8873c55e-713a-0410-88f8-23d9c3d90b1b

3 years agoGURL: Export a few functions used only by gurl unittests.
eroman@chromium.org [Mon, 7 Nov 2011 23:45:03 +0000 (23:45 +0000)]
GURL: Export a few functions used only by gurl unittests.

Even though the new exports are of "internal" stuff, they
are being used directly by unit tests, so the components
build is not building gurl uittests at all.

We want to make this the default configuration, so all tests
have to run.


Patch contributed by rvargas@chromium.org.

Code review: http://codereview.chromium.org/8474013

git-svn-id: http://google-url.googlecode.com/svn/trunk@161 8873c55e-713a-0410-88f8-23d9c3d90b1b

3 years agoAdd a codereview.settings file.
maruel@chromium.org [Fri, 4 Nov 2011 20:02:49 +0000 (20:02 +0000)]
Add a codereview.settings file.

Previously, gcl had default settings to use the chromium's codereview site by
default. These default settings were removed and now need to be made explicit.

git-svn-id: http://google-url.googlecode.com/svn/trunk@160 8873c55e-713a-0410-88f8-23d9c3d90b1b

3 years agoProvide a way to get the parsed IP address out of CanonicalizeHostVerbose.
brettw [Fri, 8 Jul 2011 19:18:11 +0000 (19:18 +0000)]
Provide a way to get the parsed IP address out of CanonicalizeHostVerbose.

Patch by joth@chromium.org

git-svn-id: http://google-url.googlecode.com/svn/trunk@159 8873c55e-713a-0410-88f8-23d9c3d90b1b

3 years agoAvoid indexing into a string when it's empty to avoid an assertion failure
brettw [Mon, 27 Jun 2011 18:11:15 +0000 (18:11 +0000)]
Avoid indexing into a string when it's empty to avoid an assertion failure
when using _GLIBCXX_DEBUG.

Patch by tzik@chromium.org
Original review http://codereview.chromium.org/7198018/

git-svn-id: http://google-url.googlecode.com/svn/trunk@158 8873c55e-713a-0410-88f8-23d9c3d90b1b

3 years agoAdd a function to URL-encode a path component, using the same rules as
brettw [Thu, 16 Jun 2011 18:02:23 +0000 (18:02 +0000)]
Add a function to URL-encode a path component, using the same rules as
encodeURIComponenet. This is needed by the filesystem API to fix*
http://code.google.com/p/chromium/issues/detail?id=78860, although the full f>
will require more code than this.

TEST=unit test
Original review=http://codereview.chromium.org/7046062/
Patch by ericu@chromium.org

git-svn-id: http://google-url.googlecode.com/svn/trunk@157 8873c55e-713a-0410-88f8-23d9c3d90b1b

3 years agoFix handling of certain URLs with long runs of numbers.
eroman@chromium.org [Fri, 3 Jun 2011 02:00:43 +0000 (02:00 +0000)]
Fix handling of certain URLs with long runs of numbers.


Code review: http://codereview.chromium.org/7020030/

Patch contibuted by mmenke@chromium.org

git-svn-id: http://google-url.googlecode.com/svn/trunk@156 8873c55e-713a-0410-88f8-23d9c3d90b1b

4 years agourl_canon_ip: For IPv6 literals with an IPv4-style suffix, remove the
pmarks@google.com [Mon, 2 May 2011 18:38:07 +0000 (18:38 +0000)]
url_canon_ip: For IPv6 literals with an IPv4-style suffix, remove the
restriction that the prefix must match ::/96 or ::ffff:0:0/96.

People have been complaining that the URL parser won't accept their
NAT64 prefixes, and I can't see any obvious reason for this
restriction to exist.

The code I'm deleting was originally added here:

Review: http://codereview.chromium.org/6902189/

git-svn-id: http://google-url.googlecode.com/svn/trunk@155 8873c55e-713a-0410-88f8-23d9c3d90b1b

4 years agoUpdate GURL_API to cover non-Windows platforms.
brettw [Tue, 26 Apr 2011 15:58:09 +0000 (15:58 +0000)]
Update GURL_API to cover non-Windows platforms.

When GURL_DLL is set, we export any symbols tagged GURL_API.

Patch by Evan Martin <evan@chromium.org>

git-svn-id: http://google-url.googlecode.com/svn/trunk@154 8873c55e-713a-0410-88f8-23d9c3d90b1b

4 years agoChange gurl test main to look for both icudt.dll and icudtXX.dll
brettw [Tue, 8 Mar 2011 21:44:36 +0000 (21:44 +0000)]
Change gurl test main to look for both icudt.dll and icudtXX.dll

In Chrome, we dropped a version number (e.g. '46') from the name of icu data dll
(see http://codereview.chromium.org/6625032/ ), but
for 3rd party embedders, this CL makes gurl test main look for both files.

BUG=chromium:74076 (http://crbug.com/74076)
TEST=gurl_test runs fine whether icudt has a version number or not.
Original review=http://codereview.chromium.org/6623060/

git-svn-id: http://google-url.googlecode.com/svn/trunk@153 8873c55e-713a-0410-88f8-23d9c3d90b1b

4 years agoCheck that gtest has death test support before trying to compile a test using
mark@chromium.org [Wed, 16 Feb 2011 22:11:27 +0000 (22:11 +0000)]
Check that gtest has death test support before trying to compile a test using
it (avoiding compile failure).

Patch by Thomas Van Lenten <thomasvl@chromium.org>


git-svn-id: http://google-url.googlecode.com/svn/trunk@152 8873c55e-713a-0410-88f8-23d9c3d90b1b

4 years agoFix api export for iostream operator <<.
maruel@chromium.org [Tue, 14 Dec 2010 19:46:49 +0000 (19:46 +0000)]
Fix api export for iostream operator <<.

git-svn-id: http://google-url.googlecode.com/svn/trunk@151 8873c55e-713a-0410-88f8-23d9c3d90b1b

4 years agoMake the GURL output stream operator non-inline. Apparently some compilers need
brettw [Wed, 8 Dec 2010 06:55:18 +0000 (06:55 +0000)]
Make the GURL output stream operator non-inline. Apparently some compilers need
more than just ios_fwd to compile the implementation, and we don't want to add
this dependency for all the files that include gurl.h.

TEST=it compiles

git-svn-id: http://google-url.googlecode.com/svn/trunk@150 8873c55e-713a-0410-88f8-23d9c3d90b1b

4 years agoRemove the explicit destructor from GURL. This was causing weird problems with
brettw [Thu, 28 Oct 2010 17:35:35 +0000 (17:35 +0000)]
Remove the explicit destructor from GURL. This was causing weird problems with
linking some Chrome modules.

git-svn-id: http://google-url.googlecode.com/svn/trunk@149 8873c55e-713a-0410-88f8-23d9c3d90b1b

4 years agoMove constructors to the .cc files to prevent inline code explosion.
brettw [Fri, 22 Oct 2010 19:14:09 +0000 (19:14 +0000)]
Move constructors to the .cc files to prevent inline code explosion.

Patch by erg@chromium.org

git-svn-id: http://google-url.googlecode.com/svn/trunk@148 8873c55e-713a-0410-88f8-23d9c3d90b1b

4 years agoRemove a semicolon as a host terminator. This was originally added to handle
brettw [Mon, 27 Sep 2010 20:52:59 +0000 (20:52 +0000)]
Remove a semicolon as a host terminator. This was originally added to handle
the fact that a semicolon is a "parameter" in the path of the URL. We removed
special parsing for these long ago since they aren't used in practice.

This will now treat the input foo;bar as a single hostname with an invalid
character in the middle, rather than foo/;bar.

git-svn-id: http://google-url.googlecode.com/svn/trunk@147 8873c55e-713a-0410-88f8-23d9c3d90b1b

4 years agoRemove unused static function to avoid compiler warning.
brettw [Tue, 21 Sep 2010 20:05:13 +0000 (20:05 +0000)]
Remove unused static function to avoid compiler warning.

git-svn-id: http://google-url.googlecode.com/svn/trunk@146 8873c55e-713a-0410-88f8-23d9c3d90b1b

4 years agoFix a typo in a comment about scheme handling.
brettw [Thu, 29 Jul 2010 21:33:26 +0000 (21:33 +0000)]
Fix a typo in a comment about scheme handling.

Patch by Ilya Sherman.

git-svn-id: http://google-url.googlecode.com/svn/trunk@145 8873c55e-713a-0410-88f8-23d9c3d90b1b

4 years agoRemove redundant definition for operator<<
brettw@gmail.com [Fri, 23 Jul 2010 18:30:07 +0000 (18:30 +0000)]
Remove redundant definition for operator<<

git-svn-id: http://google-url.googlecode.com/svn/trunk@144 8873c55e-713a-0410-88f8-23d9c3d90b1b

4 years agoRemove redundant check for failure to read a unicode char. ReadUTFChar already checks...
brettw@gmail.com [Thu, 22 Jul 2010 22:19:59 +0000 (22:19 +0000)]
Remove redundant check for failure to read a unicode char. ReadUTFChar already checks for valitity and returns the replacement character on failure.

Review URL: http://codereview.chromium.org/3048014

git-svn-id: http://google-url.googlecode.com/svn/trunk@143 8873c55e-713a-0410-88f8-23d9c3d90b1b

4 years agoCoverity: Fix DoAppendUTF8 handling of overly large code points.
brettw@gmail.com [Thu, 22 Jul 2010 22:19:23 +0000 (22:19 +0000)]
Coverity: Fix DoAppendUTF8 handling of overly large code points.

Patch by mattm@chromium.org
Original review: http://codereview.chromium.org/2877015

git-svn-id: http://google-url.googlecode.com/svn/trunk@142 8873c55e-713a-0410-88f8-23d9c3d90b1b

4 years agoChange <ostream> to <iosfwd> to further reduce header file dependencies.
brettw@gmail.com [Thu, 22 Jul 2010 18:52:02 +0000 (18:52 +0000)]
Change <ostream> to <iosfwd> to further reduce header file dependencies.

git-svn-id: http://google-url.googlecode.com/svn/trunk@141 8873c55e-713a-0410-88f8-23d9c3d90b1b

4 years agoUse ostream instead of iostream to avoid statics brought in by iostream. It should...
brettw [Fri, 16 Jul 2010 16:39:19 +0000 (16:39 +0000)]
Use ostream instead of iostream to avoid statics brought in by iostream. It should also be a little smaller and make compiles faster.

git-svn-id: http://google-url.googlecode.com/svn/trunk@140 8873c55e-713a-0410-88f8-23d9c3d90b1b

4 years ago-. Check GURL_IMPLEMENTATION value for dll build so it is consistent with WEBKIT_IMPL...
victorw@chromium.org [Wed, 14 Jul 2010 02:06:52 +0000 (02:06 +0000)]
-. Check GURL_IMPLEMENTATION value for dll build so it is consistent with WEBKIT_IMPLEMENTATION.
-. Fix GURL_API for url_parse.


Review URL: http://codereview.chromium.org/2900011

git-svn-id: http://google-url.googlecode.com/svn/trunk@139 8873c55e-713a-0410-88f8-23d9c3d90b1b

4 years agoAdd option to build googleurl as dll
victorw@chromium.org [Mon, 12 Jul 2010 23:49:03 +0000 (23:49 +0000)]
Add option to build googleurl as dll
-. Export/import google url APIs if GURL_DLL is defined.
-. Move DecodeURLEscapeSequences from webcore KURLGoogle
   to url_util to avoid external code accessing googleurl
   global varaibles.


Review URL: http://codereview.chromium.org/2939004

git-svn-id: http://google-url.googlecode.com/svn/trunk@138 8873c55e-713a-0410-88f8-23d9c3d90b1b

4 years agoFix comment about threadsafety.
brettw [Fri, 2 Jul 2010 15:32:37 +0000 (15:32 +0000)]
Fix comment about threadsafety.

git-svn-id: http://google-url.googlecode.com/svn/trunk@137 8873c55e-713a-0410-88f8-23d9c3d90b1b

4 years agoAdd a missing "const" keyword so the wide version has the same signature as the narro...
eroman@chromium.org [Tue, 22 Jun 2010 19:29:53 +0000 (19:29 +0000)]
Add a missing "const" keyword so the wide version has the same signature as the narrow version (more usable by templatized functions that way).

Code Review: http://codereview.chromium.org/2815020

git-svn-id: http://google-url.googlecode.com/svn/trunk@136 8873c55e-713a-0410-88f8-23d9c3d90b1b

4 years agoFix a comment typo (the description of "compat" and "mapped" IPv6 addresses was rever...
eroman@chromium.org [Tue, 22 Jun 2010 03:42:08 +0000 (03:42 +0000)]
Fix a comment typo (the description of "compat" and "mapped" IPv6 addresses was reversed).

Review URL: http://codereview.chromium.org/2859009/show

git-svn-id: http://google-url.googlecode.com/svn/trunk@135 8873c55e-713a-0410-88f8-23d9c3d90b1b

5 years agoFix a crash in IP address checking because the boundary case for an empty or invalid...
brettw@gmail.com [Tue, 11 May 2010 19:12:55 +0000 (19:12 +0000)]
Fix a crash in IP address checking because the boundary case for an empty or invalid IP address isn't handled correctly and we can go reading random memory. This doesn't happen during normal host canonicalization because it won't try to canonicalize the IP address of an empty host. It only happens if the app is trying to see if a previously-canonicalized URL is an IP.

TEST=none. I wrote a simple unit tests but it doesn't actually work to catch this case. I could not figure out how to get the old code to fail reproducibly, since it starts reading random memory until it finds a character that's invalid. Normally this happens quickly so the crash doesn't occur. It only happens if all characters in memory following the string are valid IP address characters.
Review URL: http://codereview.chromium.org/2027007

git-svn-id: http://google-url.googlecode.com/svn/trunk@134 8873c55e-713a-0410-88f8-23d9c3d90b1b

5 years agoAdd the ability to prevent future changes to the standard scheme list
brettw@gmail.com [Mon, 12 Apr 2010 16:51:49 +0000 (16:51 +0000)]
Add the ability to prevent future changes to the standard scheme list
to prevent threading errors like we've seen in Chrome.
Review URL: http://codereview.chromium.org/1607014

git-svn-id: http://google-url.googlecode.com/svn/trunk@131 8873c55e-713a-0410-88f8-23d9c3d90b1b

5 years agoAdd a newline to the end of url_util_unittest to make it compile on Mac.
brettw@gmail.com [Thu, 8 Apr 2010 18:04:17 +0000 (18:04 +0000)]
Add a newline to the end of url_util_unittest to make it compile on Mac.

git-svn-id: http://google-url.googlecode.com/svn/trunk@130 8873c55e-713a-0410-88f8-23d9c3d90b1b

5 years agoCanonicalize URL before using Extractscheme in DoFindAndCompareScheme function.
brettw@gmail.com [Thu, 8 Apr 2010 17:06:40 +0000 (17:06 +0000)]
Canonicalize URL before using Extractscheme in DoFindAndCompareScheme function.

Add some additional clarifying comments for scheme finding and canonicalization
(the code is correct, this is just to make the current behavior more explicit
and hopefully prevent people breaking it).


git-svn-id: http://google-url.googlecode.com/svn/trunk@129 8873c55e-713a-0410-88f8-23d9c3d90b1b

5 years agoRelocate a function so that we don't need any forward declarations.
brettw@gmail.com [Mon, 5 Apr 2010 16:52:36 +0000 (16:52 +0000)]
Relocate a function so that we don't need any forward declarations.

Patch by Evan Martin
Original review: http://codereview.chromium.org/650139

git-svn-id: http://google-url.googlecode.com/svn/trunk@128 8873c55e-713a-0410-88f8-23d9c3d90b1b

5 years agoPass @ through without escaping or unescaping. This is compatible with IE8 and seems...
brettw@gmail.com [Fri, 2 Apr 2010 16:25:58 +0000 (16:25 +0000)]
Pass @ through without escaping or unescaping. This is compatible with IE8 and seems to fix some sites.

TEST=included unit test
Review URL: http://codereview.chromium.org/1556014

git-svn-id: http://google-url.googlecode.com/svn/trunk@127 8873c55e-713a-0410-88f8-23d9c3d90b1b

5 years agoAdd an initialize and a cleanup function for projects wishing to use googleurl
brettw [Wed, 31 Mar 2010 04:49:32 +0000 (04:49 +0000)]
Add an initialize and a cleanup function for projects wishing to use googleurl
in a multithreaded environment (who aren't already using AddStandardScheme) or
in a DLL.


git-svn-id: http://google-url.googlecode.com/svn/trunk@126 8873c55e-713a-0410-88f8-23d9c3d90b1b

5 years agoactually define the function I added in the previous change for backwards API compat.
brettw@gmail.com [Thu, 25 Feb 2010 18:20:00 +0000 (18:20 +0000)]
actually define the function I added in the previous change for backwards API compat.

git-svn-id: http://google-url.googlecode.com/svn/trunk@125 8873c55e-713a-0410-88f8-23d9c3d90b1b

5 years agoAdd a backwards-compat workaround to make landing the previous change in Chrome and...
brettw@gmail.com [Wed, 24 Feb 2010 23:21:32 +0000 (23:21 +0000)]
Add a backwards-compat workaround to make landing the previous change in Chrome and WebKit easier.

git-svn-id: http://google-url.googlecode.com/svn/trunk@124 8873c55e-713a-0410-88f8-23d9c3d90b1b

5 years agoRemove the rule that "://" means a standard URL. This fixes a number of bugs
brettw@gmail.com [Fri, 12 Feb 2010 21:20:26 +0000 (21:20 +0000)]
Remove the rule that "://" means a standard URL. This fixes a number of bugs
and layout tests. The only thing we use now to determine whether a scheme is
standard scheme is whether it is on a known list.

Fix some bugs around setting protocols. Previously, we wouldn't reparse the
entire URL, which would give weird results in some cases, since which part
actually gets replaced changes if you change the protocol. This change has us
replace the protocol, then completely reparse the URL which ensures we don't
miss any edge cases. It is a bit slower, but changing the protocol is very

This differs from KURL in several cases. On the
layout test, we fail setting a hostname on a URL with "foo" protocol because we
no longer treat a "foo" URL as a standard protocol. However, this matches
Firefox's behavior, so I think there should not be compat problems.

Other differences in that test are that we allow setting hosts with spaces in
them for IE compat, and that when we generate the URL "c:/path/testurl.html" on
Windows, we reinterpret that as a file URL to file:///C:/path/testurl.html.
This is how "c:/path/testurl.html" would be interpreted if we just found it on
a page, so I think this behavior is correct, even though no other browser does
this (our handling of these generally matches IE, but it fails to set a "c"
protocol with an exception in this case).

Review URL: http://codereview.chromium.org/564011

git-svn-id: http://google-url.googlecode.com/svn/trunk@123 8873c55e-713a-0410-88f8-23d9c3d90b1b

5 years agoWhen resolving URL, empty relative URL should remove ref component.
brettw@gmail.com [Fri, 12 Feb 2010 19:02:56 +0000 (19:02 +0000)]
When resolving URL, empty relative URL should remove ref component.

Patch by dglazkov@chromium.org
Original review http://codereview.chromium.org/600087

git-svn-id: http://google-url.googlecode.com/svn/trunk@122 8873c55e-713a-0410-88f8-23d9c3d90b1b

5 years agoUse size_t for string lengths to avoid compiler warnings.
brettw [Fri, 20 Nov 2009 17:18:45 +0000 (17:18 +0000)]
Use size_t for string lengths to avoid compiler warnings.

Patch by Gregory Dardyk

git-svn-id: http://google-url.googlecode.com/svn/trunk@121 8873c55e-713a-0410-88f8-23d9c3d90b1b

5 years agoFix encoding of the query part of an URL.
brettw@gmail.com [Mon, 19 Oct 2009 17:20:48 +0000 (17:20 +0000)]
Fix encoding of the query part of an URL.

Encoding of the query part of an URL was inconsistent:
If it was part of a larger relative URL, it would get encoded.
However, if the query part was stand-alone, then it would not be encoded.

As indicated by the original layout test referenced in the bug (see below),
this patch changes the code so that the query part is encoded in both cases.

Note, however, that with this patch the layout test will NOT yet fully pass,
since it also handles the fragment part differently.
As the different handling of the fragment part seems to be quite on purpose,
I have not modified the behavior - see the discussion at

http://code.google.com/p/chromium/issues/detail?id=20507 .

BUG=20507, 8912
Patch by Roland Steiner, review URL http://codereview.chromium.org/243028

git-svn-id: http://google-url.googlecode.com/svn/trunk@120 8873c55e-713a-0410-88f8-23d9c3d90b1b

5 years agoRemove ICU dependency from url_canon_internal. We were just picking up some
brettw@gmail.com [Mon, 28 Sep 2009 20:28:00 +0000 (20:28 +0000)]
Remove ICU dependency from url_canon_internal. We were just picking up some
types and MAX* values for those tyeps from ICU, and weren't using it for
anything else in this context.

Patch by Matthew Steele

git-svn-id: http://google-url.googlecode.com/svn/trunk@119 8873c55e-713a-0410-88f8-23d9c3d90b1b

5 years agoFix off-by-one in range check.
brettw@gmail.com [Wed, 23 Sep 2009 17:12:43 +0000 (17:12 +0000)]
Fix off-by-one in range check.

Patch by mattm@chromium.org
Review: http://codereview.chromium.org/216020

git-svn-id: http://google-url.googlecode.com/svn/trunk@118 8873c55e-713a-0410-88f8-23d9c3d90b1b

5 years agoFix googleurl to use icu version-agnostic directory.
maruel@chromium.org [Fri, 18 Sep 2009 12:10:33 +0000 (12:10 +0000)]
Fix googleurl to use icu version-agnostic directory.

Adds text files as item in the projects.
Review URL: http://codereview.chromium.org/214013

git-svn-id: http://google-url.googlecode.com/svn/trunk@117 8873c55e-713a-0410-88f8-23d9c3d90b1b

5 years agoChange WebSocket default port
willchan@chromium.org [Tue, 8 Sep 2009 21:42:18 +0000 (21:42 +0000)]
Change WebSocket default port

The Web Socket protocol specification draft has changed the default port of Web Socket recently.

TEST=googleurl_unittests URLCanonTest.CanonicalizeStandardURL passes.

Patch contributed by ukai@chromium.org.

git-svn-id: http://google-url.googlecode.com/svn/trunk@116 8873c55e-713a-0410-88f8-23d9c3d90b1b

5 years agoUpdate the unit tests to allow a colon in UNC hostnames on Windows. This test
brettw@gmail.com [Wed, 26 Aug 2009 23:55:35 +0000 (23:55 +0000)]
Update the unit tests to allow a colon in UNC hostnames on Windows. This test
was broken in r107 but we weren't running the tests properly so never noticed.

Colon is probably not allowed by Windows, but its the "natural" result of the
way the canonicalizer is written. There doesn't seem to be a strong argument
for why allowing it here would be bad, so we just tolerate it and the load will
fail later.
Review URL: http://codereview.chromium.org/173535

git-svn-id: http://google-url.googlecode.com/svn/trunk@115 8873c55e-713a-0410-88f8-23d9c3d90b1b

5 years agoUse U_ICU_VERSION_SHORT macro instead of hard-coding icu data dll and module
brettw@gmail.com [Sat, 22 Aug 2009 01:01:28 +0000 (01:01 +0000)]
Use U_ICU_VERSION_SHORT macro instead of hard-coding icu data dll and module

TEST=googleurl test should be built and run without a problem.
Patch by Jungshik Shin
Review: http://codereview.chromium.org/174265

git-svn-id: http://google-url.googlecode.com/svn/trunk@114 8873c55e-713a-0410-88f8-23d9c3d90b1b

5 years agoAll host names with nonascii characters (cyrillic) + escapable characters
brettw@gmail.com [Tue, 18 Aug 2009 23:48:04 +0000 (23:48 +0000)]
All host names with nonascii characters (cyrillic) + escapable characters
(,)...  were shown corrupted in suggestion box in Omnibox2, because we escaped
punicode string after it was created. I added some more escaping before IDNA

Unittest updated, and main method added so we can init ICU data properly.

TEST=Follow bug description, and make sure that test is as expected (orignal

Patch by: cira@chromium.org
Review: http://codereview.chromium.org/160589

git-svn-id: http://google-url.googlecode.com/svn/trunk@113 8873c55e-713a-0410-88f8-23d9c3d90b1b

5 years agoAdd Web Socket default port.
willchan@chromium.org [Wed, 5 Aug 2009 01:48:19 +0000 (01:48 +0000)]
Add Web Socket default port.

As described in http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol,
ws (Web Socket) scheme uses port 81 by default, and
wss (secure Web Socket) scheme uses port 815 by default.

TEST=googleurl_unittests  URLCanonTest.CanonicalizeStandardURL passes.

Review URL: http://codereview.chromium.org/159401

git-svn-id: http://google-url.googlecode.com/svn/trunk@112 8873c55e-713a-0410-88f8-23d9c3d90b1b

5 years agoCanonicalize '%' in userinfo properly. It should not be escaped.
willchan@chromium.org [Tue, 28 Jul 2009 21:51:04 +0000 (21:51 +0000)]
Canonicalize '%' in userinfo properly.  It should not be escaped.
According to RFC 1738:
user           = *[ uchar | ";" | "?" | "&" | "=" ]
password       = *[ uchar | ";" | "?" | "&" | "=" ]
uchar          = unreserved | escape
escape         = "%" hex hex

Review URL: http://codereview.chromium.org/160282

git-svn-id: http://google-url.googlecode.com/svn/trunk@111 8873c55e-713a-0410-88f8-23d9c3d90b1b

5 years agoExpose in url_canon_ip.h the previously internal-only functions:
eroman@chromium.org [Wed, 15 Jul 2009 23:36:27 +0000 (23:36 +0000)]
Expose in url_canon_ip.h the previously internal-only functions:



I would like to use url_canon::IPv6AddressToNumber() in some chromium
network tests, to create mock IPv6 socketaddrs.

The system-provided equivalents (like getaddrinfo() or inet_ntop()) are
unreliable for this purpose, since they only work on IPv6-enabled


git-svn-id: http://google-url.googlecode.com/svn/trunk@110 8873c55e-713a-0410-88f8-23d9c3d90b1b

5 years agoRequire hosts for non-file URLs.
brettw@gmail.com [Wed, 15 Jul 2009 21:49:36 +0000 (21:49 +0000)]
Require hosts for non-file URLs.
Patch by willchan@chromium.org
Original review: http://codereview.chromium.org/149588

git-svn-id: http://google-url.googlecode.com/svn/trunk@109 8873c55e-713a-0410-88f8-23d9c3d90b1b

5 years agoMake DoCanonicalizeIPv6Address safer by changing loop condition and
brettw@gmail.com [Mon, 13 Jul 2009 17:14:57 +0000 (17:14 +0000)]
Make DoCanonicalizeIPv6Address safer by changing loop condition and
adding a DCHECK

Patch by yuzo@chromium.org
Original review URL: http://codereview.chromium.org/155077

git-svn-id: http://google-url.googlecode.com/svn/trunk@108 8873c55e-713a-0410-88f8-23d9c3d90b1b

5 years agourl_canon: New CanonicalizeHostVerbose() function.
pmarks@google.com [Mon, 22 Jun 2009 20:28:59 +0000 (20:28 +0000)]
url_canon: New CanonicalizeHostVerbose() function.

This function allows the caller to distinguish between 4 cases:
- A valid, canonical IPv4 address.
- A valid, canonical IPv6 address.
- A "broken" address.  This is something which kinda almost looks like an IP
  address, but has been deemed to be invalid.  For IPv4, this indicates a
  numerical component which is longer than 16 digits, or one which can't be
  used without truncation/overflow.  For IPv6, this is any non-parseable
  address containing a colon or square brackets.
- "neutral".  This indicates that the output doesn't really look like an
  IP address at all, and should probably be treated as a hostname.

The CanonHostInfo struct is meant to be extensible.  In addition to the 4 cases
above, it also returns the number of components used to make an IPv4 address,
which will be useful to Chromium, and will make it possible stop exposing

This is the first step toward making Chrome behave better for these cases:
- http://[www.google.com]/

- Changed the signature of CanonicalizeIPAddress(), instead of creating
  a new "Verbose" version.
- For completeness, now includes the CanonicalizeHost() changes,
  with an extended-output CanonicalizeHostVerbose(), because some callers
  only care whether the canonicalization was a success or not.

Code review:

git-svn-id: http://google-url.googlecode.com/svn/trunk@107 8873c55e-713a-0410-88f8-23d9c3d90b1b

5 years agourl_parse: Segment partially-typed IPv6 literals.
pmarks@google.com [Wed, 3 Jun 2009 22:00:57 +0000 (22:00 +0000)]
url_parse: Segment partially-typed IPv6 literals.

In Chromium, when a user is typing an IPv6 literal into the address bar, the
autocomplete system goes nuts, trying to grab a port from the end of the
address before it's complete.

Fix this by parsing unterminated IPv6 literals as if there were no port number.
These partial addresses will not survive canonicalization, but they keep the
autocompleter running smoothly as the address is typed.

Also, fix some minor lint warnings elsewhere in url_parse.cc

Code review:

git-svn-id: http://google-url.googlecode.com/svn/trunk@106 8873c55e-713a-0410-88f8-23d9c3d90b1b

5 years agoMove ICU dependent function ReadUTFChar into the icu.cc file. This avoids icu
brettw@gmail.com [Tue, 2 Jun 2009 18:20:55 +0000 (18:20 +0000)]
Move ICU dependent function ReadUTFChar into the icu.cc file.  This avoids icu
dependency in other object files that use inline functions from

Patch by tommi@chromium.org.
Review: http://codereview.chromium.org/118062

git-svn-id: http://google-url.googlecode.com/svn/trunk@105 8873c55e-713a-0410-88f8-23d9c3d90b1b

6 years agoCanonicalize IPv6 addresses.
eroman@chromium.org [Mon, 18 May 2009 23:46:31 +0000 (23:46 +0000)]
Canonicalize IPv6 addresses.


Review URL: http://codereview.chromium.org/99183

git-svn-id: http://google-url.googlecode.com/svn/trunk@104 8873c55e-713a-0410-88f8-23d9c3d90b1b

6 years agoSupport Z as a first letter of a scheme.
brettw@gmail.com [Mon, 18 May 2009 18:12:27 +0000 (18:12 +0000)]
Support Z as a first letter of a scheme.

Patch by Paul Marks.
Review URL: http://codereview.chromium.org/113514

git-svn-id: http://google-url.googlecode.com/svn/trunk@103 8873c55e-713a-0410-88f8-23d9c3d90b1b

6 years agoA URL can contain an IPv6 address literal, like [2001:db8::2]. Users of
brettw@gmail.com [Wed, 13 May 2009 20:04:28 +0000 (20:04 +0000)]
A URL can contain an IPv6 address literal, like [2001:db8::2].  Users of
the GURL library sometimes need the square brackets, and sometimes don't.

Checked in for Paul Marks
Review URL: http://codereview.chromium.org/113187

git-svn-id: http://google-url.googlecode.com/svn/trunk@102 8873c55e-713a-0410-88f8-23d9c3d90b1b

6 years agoEscape double quotes (U+0022).
brettw@gmail.com [Tue, 28 Apr 2009 09:17:03 +0000 (09:17 +0000)]
Escape double quotes (U+0022).

Checked in for eroman

git-svn-id: http://google-url.googlecode.com/svn/trunk@101 8873c55e-713a-0410-88f8-23d9c3d90b1b

6 years agoConvert all uses of UTF16Char and UTF16String to char16 and string16
mark@chromium.org [Wed, 25 Mar 2009 19:39:03 +0000 (19:39 +0000)]
Convert all uses of UTF16Char and UTF16String to char16 and string16
Review URL: http://codereview.chromium.org/42613

git-svn-id: http://google-url.googlecode.com/svn/trunk@100 8873c55e-713a-0410-88f8-23d9c3d90b1b

6 years agoEliminate dubious uses of basic_string<> in googleurl
mark@chromium.org [Wed, 25 Mar 2009 16:28:58 +0000 (16:28 +0000)]
Eliminate dubious uses of basic_string<> in googleurl

Review URL: http://codereview.chromium.org/42588

git-svn-id: http://google-url.googlecode.com/svn/trunk@99 8873c55e-713a-0410-88f8-23d9c3d90b1b

6 years agoAdded missing <stdlib.h>, needed on ubuntu 8.10.
brettw@gmail.com [Mon, 16 Mar 2009 18:05:43 +0000 (18:05 +0000)]
Added missing <stdlib.h>, needed on ubuntu 8.10.
Patch by Dan Kegel.

git-svn-id: http://google-url.googlecode.com/svn/trunk@98 8873c55e-713a-0410-88f8-23d9c3d90b1b

6 years agoAdd basic PRESUBMIT script.
maruel@chromium.org [Thu, 5 Mar 2009 17:52:33 +0000 (17:52 +0000)]
Add basic PRESUBMIT script.
Review URL: http://codereview.chromium.org/39188

git-svn-id: http://google-url.googlecode.com/svn/trunk@97 8873c55e-713a-0410-88f8-23d9c3d90b1b

6 years agoMake ParseAuthority part of the public API.
brettw@gmail.com [Mon, 23 Feb 2009 18:42:58 +0000 (18:42 +0000)]
Make ParseAuthority part of the public API.

Patch by Eric Roman.

git-svn-id: http://google-url.googlecode.com/svn/trunk@96 8873c55e-713a-0410-88f8-23d9c3d90b1b

6 years agoSupport UNC-like file: URL parsing on non-Windows platforms.
brettw@gmail.com [Mon, 26 Jan 2009 22:22:15 +0000 (22:22 +0000)]
Support UNC-like file: URL parsing on non-Windows platforms.

Patch by Michael Moss:

git-svn-id: http://google-url.googlecode.com/svn/trunk@95 8873c55e-713a-0410-88f8-23d9c3d90b1b

6 years agoAdd the ability to get the effective port for schemes with a default port.
brettw [Wed, 1 Oct 2008 19:03:33 +0000 (19:03 +0000)]
Add the ability to get the effective port for schemes with a default port.

Patch by Eric Roman.

git-svn-id: http://google-url.googlecode.com/svn/trunk@94 8873c55e-713a-0410-88f8-23d9c3d90b1b

6 years agoAdd basic IPv6 support. This just identifies possibly valid IPv6 addresses and
brettw [Tue, 16 Sep 2008 01:09:16 +0000 (01:09 +0000)]
Add basic IPv6 support. This just identifies possibly valid IPv6 addresses and
passes them through so they can be handled by the network layer if they are
supported there (previously we would reject all of them). This does not do
actual canonicalization yet.

Patch by Erik Kline.

git-svn-id: http://google-url.googlecode.com/svn/trunk@93 8873c55e-713a-0410-88f8-23d9c3d90b1b

6 years agoFix some unittest warnings under GCC.
brettw [Thu, 21 Aug 2008 22:47:06 +0000 (22:47 +0000)]
Fix some unittest warnings under GCC.

git-svn-id: http://google-url.googlecode.com/svn/trunk@92 8873c55e-713a-0410-88f8-23d9c3d90b1b

6 years agoFix compile warnings on GCC.
brettw [Wed, 20 Aug 2008 16:00:51 +0000 (16:00 +0000)]
Fix compile warnings on GCC.

git-svn-id: http://google-url.googlecode.com/svn/trunk@91 8873c55e-713a-0410-88f8-23d9c3d90b1b

6 years agoFix two build problems on Linux. The unit test problems are becuase the default
brettw [Mon, 18 Aug 2008 23:29:00 +0000 (23:29 +0000)]
Fix two build problems on Linux. The unit test problems are becuase the default
char there is unsigned. The UTF-8 reading problems fixes a warning when the
macro writes -1 to an unsigned value.

git-svn-id: http://google-url.googlecode.com/svn/trunk@90 8873c55e-713a-0410-88f8-23d9c3d90b1b

6 years agoMake < and > be escaped in the query part of the URL.
brettw [Thu, 7 Aug 2008 23:34:28 +0000 (23:34 +0000)]
Make < and > be escaped in the query part of the URL.


git-svn-id: http://google-url.googlecode.com/svn/trunk@89 8873c55e-713a-0410-88f8-23d9c3d90b1b

6 years agoFix some Unix-related compile issues.
brettw [Thu, 17 Jul 2008 22:05:45 +0000 (22:05 +0000)]
Fix some Unix-related compile issues.
Use GTest instead of GUnit.

git-svn-id: http://google-url.googlecode.com/svn/trunk@88 8873c55e-713a-0410-88f8-23d9c3d90b1b

6 years agoExpose the encoding parameter when resolving relative URLs in Resolve(). This
brettw [Tue, 24 Jun 2008 00:32:30 +0000 (00:32 +0000)]
Expose the encoding parameter when resolving relative URLs in Resolve(). This
is temporary until we can figure out how this object will handle encodings

git-svn-id: http://google-url.googlecode.com/svn/trunk@87 8873c55e-713a-0410-88f8-23d9c3d90b1b

6 years agoFix a crash if we were calling ReplaceComponents on a URL with no scheme (such
brettw [Thu, 5 Jun 2008 21:04:16 +0000 (21:04 +0000)]
Fix a crash if we were calling ReplaceComponents on a URL with no scheme (such
as an empty URL). Add some unit tests around this.

git-svn-id: http://google-url.googlecode.com/svn/trunk@86 8873c55e-713a-0410-88f8-23d9c3d90b1b

7 years agoMake relative URL resolving check the scheme for validity and fall back to
brettw [Thu, 8 May 2008 20:19:12 +0000 (20:19 +0000)]
Make relative URL resolving check the scheme for validity and fall back to
relative URLs if it's not.

git-svn-id: http://google-url.googlecode.com/svn/trunk@85 8873c55e-713a-0410-88f8-23d9c3d90b1b

7 years agoFix several limitations of the canonicalizer. This validates characters in the
brettw [Thu, 8 May 2008 18:33:04 +0000 (18:33 +0000)]
Fix several limitations of the canonicalizer. This validates characters in the
reference fragment and user info sections. I did some cleanup associated with
this for character validity checking. This also makes the query escape certain
characters like # which could possibly get set if the query is replaced with
something new.

This is a major change to the host canonicalizer. We now support a third mode
for compatibility to allow more characters and to escape them if we see them
in hosts. Even though these are not valid DNS names, I have seen them being
used in third-party protocols that happen to be "standard" and most programs
support them.

git-svn-id: http://google-url.googlecode.com/svn/trunk@83 8873c55e-713a-0410-88f8-23d9c3d90b1b

7 years agoRemove encoding for mailto URLs.
brettw [Tue, 6 May 2008 16:22:02 +0000 (16:22 +0000)]
Remove encoding for mailto URLs.

git-svn-id: http://google-url.googlecode.com/svn/trunk@81 8873c55e-713a-0410-88f8-23d9c3d90b1b

7 years agoAdd forgotten file in preivious mailto checkin.
brettw [Tue, 6 May 2008 00:26:26 +0000 (00:26 +0000)]
Add forgotten file in preivious mailto checkin.

git-svn-id: http://google-url.googlecode.com/svn/trunk@79 8873c55e-713a-0410-88f8-23d9c3d90b1b