• Home
Name Date Size #Lines LOC

..--

android/03-May-2024-2,1601,513

ipc/03-May-2024-320220

mojom/03-May-2024-670488

third_party/mozilla/03-May-2024-1,483912

BUILD.gnD03-May-202410 KiB406365

DEPSD03-May-2024329 1917

DIR_METADATAD03-May-2024398 1110

README.mdD03-May-20243.2 KiB7655

features.gniD03-May-2024699 1714

gurl.ccD03-May-202417.2 KiB579427

gurl.hD03-May-202421.8 KiB535201

gurl_abstract_tests.hD03-May-20245.2 KiB12085

gurl_fuzzer.ccD03-May-20243.1 KiB9068

gurl_fuzzer.dictD03-May-20243.8 KiB433428

gurl_unittest.ccD03-May-202442.9 KiB1,181905

origin.ccD03-May-202415.5 KiB483319

origin.hD03-May-202420.4 KiB497182

origin_abstract_tests.ccD03-May-20243.1 KiB10567

origin_abstract_tests.hD03-May-202420.4 KiB528367

origin_unittest.ccD03-May-202431.5 KiB778576

run_all_perftests.ccD03-May-2024486 159

run_all_unittests.ccD03-May-2024698 2818

scheme_host_port.ccD03-May-20248.6 KiB279183

scheme_host_port.hD03-May-20246.7 KiB17451

scheme_host_port_unittest.ccD03-May-202410.7 KiB295244

url_canon.ccD03-May-2024416 167

url_canon.hD03-May-202442.5 KiB1,038563

url_canon_etc.ccD03-May-202416.7 KiB429290

url_canon_filesystemurl.ccD03-May-20245.3 KiB136102

url_canon_fileurl.ccD03-May-20248.9 KiB248167

url_canon_host.ccD03-May-202418.8 KiB443230

url_canon_icu.ccD03-May-20243.9 KiB11577

url_canon_icu.hD03-May-20241.2 KiB4220

url_canon_icu_unittest.ccD03-May-20245.1 KiB169122

url_canon_internal.ccD03-May-202420.9 KiB503400

url_canon_internal.hD03-May-202419.8 KiB472224

url_canon_internal_file.hD03-May-20245.5 KiB13666

url_canon_ip.ccD03-May-202423.7 KiB691403

url_canon_ip.hD03-May-20242.3 KiB6130

url_canon_mailtourl.ccD03-May-20244.5 KiB12892

url_canon_path.ccD03-May-202421.5 KiB475258

url_canon_pathurl.ccD03-May-20245.6 KiB145100

url_canon_query.ccD03-May-20246 KiB15085

url_canon_relative.ccD03-May-202425.3 KiB624370

url_canon_stdstring.ccD03-May-2024766 3119

url_canon_stdstring.hD03-May-20244.9 KiB13374

url_canon_stdurl.ccD03-May-20247.8 KiB210149

url_canon_unittest.ccD03-May-2024124 KiB2,7491,977

url_constants.ccD03-May-20242.2 KiB6250

url_constants.hD03-May-20243.2 KiB7154

url_features.ccD03-May-20241.1 KiB3621

url_features.hD03-May-20241.1 KiB3414

url_file.hD03-May-20243.8 KiB10260

url_idna_icu.ccD03-May-20245.2 KiB14567

url_idna_icu_alternatives_android.ccD03-May-20241.2 KiB4125

url_idna_icu_alternatives_ios.mmD03-May-2024786 2922

url_parse_file.ccD03-May-20247.8 KiB19996

url_parse_internal.hD03-May-20243.5 KiB9755

url_parse_perftest.ccD03-May-20244.7 KiB136109

url_parse_unittest.ccD03-May-202434.2 KiB688487

url_test_utils.hD03-May-20241.1 KiB4019

url_util.ccD03-May-202435.4 KiB934659

url_util.hD03-May-202413.7 KiB315148

url_util_internal.hD03-May-2024757 2412

url_util_unittest.ccD03-May-202425.2 KiB632485

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