• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

android/H16-Feb-2021-1,4651,003

ipc/H16-Feb-2021-235167

mojom/H16-Feb-2021-435327

third_party/mozilla/H16-Feb-2021-1,342800

BUILD.gnH A D16-Feb-20217.5 KiB314282

DEPSH A D16-Feb-2021311 1816

DIR_METADATAH A D16-Feb-2021403 1110

OWNERSH A D16-Feb-202182 44

README.mdH A D16-Feb-20213.2 KiB7655

features.gniH A D16-Feb-2021721 1714

gurl.ccH A D16-Feb-202116 KiB535400

gurl.hH A D16-Feb-202120.2 KiB508199

gurl_fuzzer.ccH A D16-Feb-20213.1 KiB9068

gurl_fuzzer.dictH A D16-Feb-20213.8 KiB433428

gurl_unittest.ccH A D16-Feb-202138 KiB1,027789

origin.ccH A D16-Feb-202114.8 KiB462307

origin.hH A D16-Feb-202118.5 KiB461168

origin_unittest.ccH A D16-Feb-202140.1 KiB971735

run_all_perftests.ccH A D16-Feb-2021497 159

run_all_unittests.ccH A D16-Feb-2021705 2818

scheme_host_port.ccH A D16-Feb-20218.1 KiB270181

scheme_host_port.hH A D16-Feb-20216.4 KiB17151

scheme_host_port_unittest.ccH A D16-Feb-202110.3 KiB285241

url_canon.ccH A D16-Feb-2021442 167

url_canon.hH A D16-Feb-202140.5 KiB1,012560

url_canon_etc.ccH A D16-Feb-202115.9 KiB419284

url_canon_filesystemurl.ccH A D16-Feb-20215.4 KiB136102

url_canon_fileurl.ccH A D16-Feb-20217.2 KiB191129

url_canon_host.ccH A D16-Feb-202118.4 KiB431221

url_canon_icu.ccH A D16-Feb-20213.8 KiB11175

url_canon_icu.hH A D16-Feb-20211.2 KiB4119

url_canon_icu_unittest.ccH A D16-Feb-20215.2 KiB168122

url_canon_internal.ccH A D16-Feb-202118.5 KiB434347

url_canon_internal.hH A D16-Feb-202118.4 KiB446210

url_canon_internal_file.hH A D16-Feb-20215.5 KiB13666

url_canon_ip.ccH A D16-Feb-202124.5 KiB712423

url_canon_ip.hH A D16-Feb-20213.8 KiB8939

url_canon_mailtourl.ccH A D16-Feb-20214.5 KiB12892

url_canon_path.ccH A D16-Feb-202120.2 KiB438224

url_canon_pathurl.ccH A D16-Feb-20214.9 KiB12687

url_canon_query.ccH A D16-Feb-20216.5 KiB16594

url_canon_relative.ccH A D16-Feb-202125 KiB621367

url_canon_stdstring.ccH A D16-Feb-2021834 3220

url_canon_stdstring.hH A D16-Feb-20214.2 KiB11157

url_canon_stdurl.ccH A D16-Feb-20217.7 KiB206147

url_canon_unittest.ccH A D16-Feb-2021112.5 KiB2,4061,685

url_constants.ccH A D16-Feb-20211.2 KiB3925

url_constants.hH A D16-Feb-20211.7 KiB4629

url_file.hH A D16-Feb-20212.7 KiB8245

url_idna_icu.ccH A D16-Feb-20214 KiB11151

url_idna_icu_alternatives_android.ccH A D16-Feb-20211.3 KiB4025

url_idna_icu_alternatives_ios.mmH A D16-Feb-2021808 2621

url_parse_file.ccH A D16-Feb-20218.7 KiB223114

url_parse_internal.hH A D16-Feb-20213.4 KiB9249

url_parse_perftest.ccH A D16-Feb-20214.7 KiB136109

url_parse_unittest.ccH A D16-Feb-202134.2 KiB691489

url_test_utils.hH A D16-Feb-20211.2 KiB4120

url_util.ccH A D16-Feb-202133.1 KiB863607

url_util.hH A D16-Feb-202112.9 KiB298143

url_util_internal.hH A D16-Feb-2021837 2714

url_util_unittest.ccH A D16-Feb-202121.2 KiB530406

README.md

1# Chrome's URL library
2
3## Layers
4
5There are several conceptual layers in this directory. Going from the lowest
6level up, they are:
7
8### Parsing
9
10The `url_parse.*` files are the parser. This code does no string
11transformations. Its only job is to take an input string and split out the
12components of the URL as best as it can deduce them, for a given type of URL.
13Parsing can never fail, it will take its best guess. This layer does not
14have logic for determining the type of URL parsing to apply, that needs to
15be applied at a higher layer (the "util" layer below).
16
17Because the parser code is derived (_very_ distantly) from some code in
18Mozilla, some of the parser files are in `url/third_party/mozilla/`.
19
20The main header to include for calling the parser is
21`url/third_party/mozilla/url_parse.h`.
22
23### Canonicalization
24
25The `url_canon*` files are the canonicalizer. This code will transform specific
26URL components or specific types of URLs into a standard form. For some
27dangerous or invalid data, the canonicalizer will report that a URL is invalid,
28although it will always try its best to produce output (so the calling code
29can, for example, show the user an error that the URL is invalid). The
30canonicalizer attempts to provide as consistent a representation as possible
31without changing the meaning of a URL.
32
33The canonicalizer layer is designed to be independent of the string type of
34the embedder, so all string output is done through a `CanonOutput` wrapper
35object. An implementation for `std::string` output is provided in
36`url_canon_stdstring.h`.
37
38The main header to include for calling the canonicalizer is
39`url/url_canon.h`.
40
41### Utility
42
43The `url_util*` files provide a higher-level wrapper around the parser and
44canonicalizer. While it can be called directly, it is designed to be the
45foundation for writing URL wrapper objects (The GURL later and Blink's KURL
46object use the Utility layer to implement the low-level logic).
47
48The Utility code makes decisions about URL types and calls the correct parsing
49and canonicalzation functions for those types. It provides an interface to
50register application-specific schemes that have specific requirements.
51Sharing this loigic between KURL and GURL is important so that URLs are
52handled consistently across the application.
53
54The main header to include is `url/url_util.h`.
55
56### Google URL (GURL) and Origin
57
58At the highest layer, a C++ object for representing URLs is provided. This
59object uses STL. Most uses need only this layer. Include `url/gurl.h`.
60
61Also at this layer is also the Origin object which exists to make security
62decisions on the web. Include `url/origin.h`.
63
64## Historical background
65
66This code was originally a separate library that was designed to be embedded
67into both Chrome (which uses STL) and WebKit (which didn't use any STL at the
68time). As a result, the parsing, canonicalization, and utility code could
69not use STL, or any other common code in Chromium like base.
70
71When WebKit was forked into the Chromium repo and renamed Blink, this
72restriction has been relaxed somewhat. Blink still provides its own URL object
73using its own string type, so the insulation that the Utility layer provides is
74still useful. But some STL strings and calls to base functions have gradually
75been added in places where doing so is possible.
76