diff --git a/source/common/chromium_url/README.md b/source/common/chromium_url/README.md index 64d28b315dd20..32e251c82d4d2 100644 --- a/source/common/chromium_url/README.md +++ b/source/common/chromium_url/README.md @@ -5,6 +5,7 @@ to support a security release fix for CVE-2019-9901. Long term we need this to be moved to absl or QUICHE for upgrades and long-term support. Some specific transforms of interest: +* The namespace `url` was changed to `chromium_url`. * `url_parse.h` is minified to just `Component` and flattened back into the URL directory. It does not contain any non-Chromium authored code any longer and so does not have a separate LICENSE. diff --git a/source/common/chromium_url/url_canon.cc b/source/common/chromium_url/url_canon.cc index 91926b6f237b6..b9ad1b829726c 100644 --- a/source/common/chromium_url/url_canon.cc +++ b/source/common/chromium_url/url_canon.cc @@ -9,8 +9,8 @@ #include "common/chromium_url/envoy_shim.h" -namespace url { +namespace chromium_url { template class EXPORT_TEMPLATE_DEFINE(COMPONENT_EXPORT(URL)) CanonOutputT; -} // namespace url +} // namespace chromium_url diff --git a/source/common/chromium_url/url_canon.h b/source/common/chromium_url/url_canon.h index 0f66374c60c4f..89a11bb0418b7 100644 --- a/source/common/chromium_url/url_canon.h +++ b/source/common/chromium_url/url_canon.h @@ -14,7 +14,7 @@ #include "common/chromium_url/envoy_shim.h" #include "common/chromium_url/url_parse.h" -namespace url { +namespace chromium_url { // Canonicalizer output ------------------------------------------------------- @@ -181,6 +181,6 @@ COMPONENT_EXPORT(URL) bool CanonicalizePath(const char* spec, const Component& path, CanonOutput* output, Component* out_path); -} // namespace url +} // namespace chromium_url #endif // URL_URL_CANON_H_ diff --git a/source/common/chromium_url/url_canon_internal.cc b/source/common/chromium_url/url_canon_internal.cc index 7aeb4f3de1b88..38c932cad5b47 100644 --- a/source/common/chromium_url/url_canon_internal.cc +++ b/source/common/chromium_url/url_canon_internal.cc @@ -7,7 +7,7 @@ #include "common/chromium_url/url_canon_internal.h" -namespace url { +namespace chromium_url { // See the header file for this array's declaration. const unsigned char kSharedCharTypeTable[0x100] = { @@ -292,4 +292,4 @@ const char kCharToHexLookup[8] = { 0, // 0xE0 - 0xFF }; -} // namespace url +} // namespace chromium_url diff --git a/source/common/chromium_url/url_canon_internal.h b/source/common/chromium_url/url_canon_internal.h index 63960665fc682..bffff5c12f4a0 100644 --- a/source/common/chromium_url/url_canon_internal.h +++ b/source/common/chromium_url/url_canon_internal.h @@ -19,7 +19,7 @@ #include "common/chromium_url/envoy_shim.h" #include "common/chromium_url/url_canon.h" -namespace url { +namespace chromium_url { // Character type handling ----------------------------------------------------- @@ -241,6 +241,6 @@ inline bool DecodeEscaped(const CHAR* spec, int* begin, int end, unsigned char* return true; } -} // namespace url +} // namespace chromium_url #endif // URL_URL_CANON_INTERNAL_H_ diff --git a/source/common/chromium_url/url_canon_path.cc b/source/common/chromium_url/url_canon_path.cc index 2e13dc0cf8c87..f8c803a9c5f5a 100644 --- a/source/common/chromium_url/url_canon_path.cc +++ b/source/common/chromium_url/url_canon_path.cc @@ -11,7 +11,7 @@ #include "common/chromium_url/url_canon_internal.h" #include "common/chromium_url/url_parse_internal.h" -namespace url { +namespace chromium_url { namespace { @@ -414,4 +414,4 @@ bool CanonicalizePath(const char* spec, const Component& path, CanonOutput* outp return DoPath(spec, path, output, out_path); } -} // namespace url +} // namespace chromium_url diff --git a/source/common/chromium_url/url_canon_stdstring.cc b/source/common/chromium_url/url_canon_stdstring.cc index dc501d66ec26b..0c61831e5f1ac 100644 --- a/source/common/chromium_url/url_canon_stdstring.cc +++ b/source/common/chromium_url/url_canon_stdstring.cc @@ -7,7 +7,7 @@ #include "common/chromium_url/url_canon_stdstring.h" -namespace url { +namespace chromium_url { StdStringCanonOutput::StdStringCanonOutput(std::string* str) : CanonOutput(), str_(str) { cur_len_ = static_cast(str_->size()); // Append to existing data. @@ -30,4 +30,4 @@ void StdStringCanonOutput::Resize(int sz) { buffer_len_ = sz; } -} // namespace url +} // namespace chromium_url diff --git a/source/common/chromium_url/url_canon_stdstring.h b/source/common/chromium_url/url_canon_stdstring.h index e502b1a3e6f55..e14d6c22e74e8 100644 --- a/source/common/chromium_url/url_canon_stdstring.h +++ b/source/common/chromium_url/url_canon_stdstring.h @@ -21,7 +21,7 @@ TypeName(const TypeName&) = delete; \ TypeName& operator=(const TypeName&) = delete -namespace url { +namespace chromium_url { // Write into a std::string given in the constructor. This object does not own // the string itself, and the user must ensure that the string stays alive @@ -53,6 +53,6 @@ class COMPONENT_EXPORT(URL) StdStringCanonOutput : public CanonOutput { DISALLOW_COPY_AND_ASSIGN(StdStringCanonOutput); }; -} // namespace url +} // namespace chromium_url #endif // URL_URL_CANON_STDSTRING_H_ diff --git a/source/common/chromium_url/url_parse.h b/source/common/chromium_url/url_parse.h index 31d7d3f16c1e5..b840af60438d1 100644 --- a/source/common/chromium_url/url_parse.h +++ b/source/common/chromium_url/url_parse.h @@ -8,7 +8,7 @@ #ifndef URL_PARSE_H_ #define URL_PARSE_H_ -namespace url { +namespace chromium_url { // Component ------------------------------------------------------------------ @@ -44,6 +44,6 @@ struct Component { // points. The ending point is non-inclusive. inline Component MakeRange(int begin, int end) { return Component(begin, end - begin); } -} // namespace url +} // namespace chromium_url #endif // URL_PARSE_H_ diff --git a/source/common/chromium_url/url_parse_internal.h b/source/common/chromium_url/url_parse_internal.h index a8c15819048be..0ca47bc488461 100644 --- a/source/common/chromium_url/url_parse_internal.h +++ b/source/common/chromium_url/url_parse_internal.h @@ -8,11 +8,11 @@ #ifndef URL_URL_PARSE_INTERNAL_H_ #define URL_URL_PARSE_INTERNAL_H_ -namespace url { +namespace chromium_url { // We treat slashes and backslashes the same for IE compatibility. inline bool IsURLSlash(char ch) { return ch == '/' || ch == '\\'; } -} // namespace url +} // namespace chromium_url #endif // URL_URL_PARSE_INTERNAL_H_ diff --git a/source/common/http/path_utility.cc b/source/common/http/path_utility.cc index 796c2c1cbd52b..74af7039a4bd4 100644 --- a/source/common/http/path_utility.cc +++ b/source/common/http/path_utility.cc @@ -13,10 +13,11 @@ namespace Http { namespace { absl::optional canonicalizePath(absl::string_view original_path) { std::string canonical_path; - url::Component in_component(0, original_path.size()); - url::Component out_component; - url::StdStringCanonOutput output(&canonical_path); - if (!url::CanonicalizePath(original_path.data(), in_component, &output, &out_component)) { + chromium_url::Component in_component(0, original_path.size()); + chromium_url::Component out_component; + chromium_url::StdStringCanonOutput output(&canonical_path); + if (!chromium_url::CanonicalizePath(original_path.data(), in_component, &output, + &out_component)) { return absl::nullopt; } else { output.Complete();