diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-12 14:27:29 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-13 09:35:20 +0000 |
commit | c30a6232df03e1efbd9f3b226777b07e087a1122 (patch) | |
tree | e992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/url | |
parent | 7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff) | |
download | qtwebengine-chromium-85-based.tar.gz |
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/url')
-rw-r--r-- | chromium/url/gurl.cc | 6 | ||||
-rw-r--r-- | chromium/url/gurl.h | 3 | ||||
-rw-r--r-- | chromium/url/mojom/url.mojom | 7 | ||||
-rw-r--r-- | chromium/url/third_party/mozilla/url_parse.cc | 2 | ||||
-rw-r--r-- | chromium/url/url_canon.h | 20 | ||||
-rw-r--r-- | chromium/url/url_canon_internal.h | 2 | ||||
-rw-r--r-- | chromium/url/url_canon_relative.cc | 1 | ||||
-rw-r--r-- | chromium/url/url_idna_icu.cc | 6 | ||||
-rw-r--r-- | chromium/url/url_util.cc | 6 |
9 files changed, 25 insertions, 28 deletions
diff --git a/chromium/url/gurl.cc b/chromium/url/gurl.cc index f23ed1c29c0..9f4698fb0e4 100644 --- a/chromium/url/gurl.cc +++ b/chromium/url/gurl.cc @@ -288,7 +288,7 @@ GURL GURL::GetOrigin() const { } GURL GURL::GetAsReferrer() const { - if (!SchemeIsValidForReferrer()) + if (!is_valid() || !IsReferrerScheme(spec_.data(), parsed_.scheme)) return GURL(); if (!has_ref() && !has_username() && !has_password()) @@ -354,10 +354,6 @@ bool GURL::SchemeIsHTTPOrHTTPS() const { return SchemeIs(url::kHttpScheme) || SchemeIs(url::kHttpsScheme); } -bool GURL::SchemeIsValidForReferrer() const { - return is_valid_ && IsReferrerScheme(spec_.data(), parsed_.scheme); -} - bool GURL::SchemeIsWSOrWSS() const { return SchemeIs(url::kWsScheme) || SchemeIs(url::kWssScheme); } diff --git a/chromium/url/gurl.h b/chromium/url/gurl.h index ad9f565586e..9b6449b7c01 100644 --- a/chromium/url/gurl.h +++ b/chromium/url/gurl.h @@ -229,9 +229,6 @@ class COMPONENT_EXPORT(URL) GURL { // Returns true if the scheme is "http" or "https". bool SchemeIsHTTPOrHTTPS() const; - // Returns true if the scheme is valid for use as a referrer. - bool SchemeIsValidForReferrer() const; - // Returns true is the scheme is "ws" or "wss". bool SchemeIsWSOrWSS() const; diff --git a/chromium/url/mojom/url.mojom b/chromium/url/mojom/url.mojom index 302283702b9..85cadf14b0d 100644 --- a/chromium/url/mojom/url.mojom +++ b/chromium/url/mojom/url.mojom @@ -4,10 +4,7 @@ module url.mojom; -// Don't make backwards-incompatible changes to this definition! -// It's used in PageState serialization, so backwards incompatible changes -// would cause stored PageState objects to be un-parseable. Please contact the -// page state serialization owners before making such a change. +[Stable] struct Url { string url; -};
\ No newline at end of file +}; diff --git a/chromium/url/third_party/mozilla/url_parse.cc b/chromium/url/third_party/mozilla/url_parse.cc index f70f9fb2475..2b3003209ad 100644 --- a/chromium/url/third_party/mozilla/url_parse.cc +++ b/chromium/url/third_party/mozilla/url_parse.cc @@ -38,7 +38,7 @@ #include <stdlib.h> -#include "base/logging.h" +#include "base/check_op.h" #include "url/url_parse_internal.h" #include "url/url_util.h" #include "url/url_util_internal.h" diff --git a/chromium/url/url_canon.h b/chromium/url/url_canon.h index 273f0568414..3aa064820eb 100644 --- a/chromium/url/url_canon.h +++ b/chromium/url/url_canon.h @@ -28,8 +28,7 @@ namespace url { template<typename T> class CanonOutputT { public: - CanonOutputT() : buffer_(NULL), buffer_len_(0), cur_len_(0) { - } + CanonOutputT() : buffer_(nullptr), buffer_len_(0), cur_len_(0) {} virtual ~CanonOutputT() { } @@ -698,15 +697,14 @@ struct URLComponentSource { // will make them all NULL, which is no replacement. The caller would then // override the components they want to replace. URLComponentSource() - : scheme(NULL), - username(NULL), - password(NULL), - host(NULL), - port(NULL), - path(NULL), - query(NULL), - ref(NULL) { - } + : scheme(nullptr), + username(nullptr), + password(nullptr), + host(nullptr), + port(nullptr), + path(nullptr), + query(nullptr), + ref(nullptr) {} // Constructor normally used internally to initialize all the components to // point to the same spec. diff --git a/chromium/url/url_canon_internal.h b/chromium/url/url_canon_internal.h index ba8b9ee9d00..53ae8dd3ffc 100644 --- a/chromium/url/url_canon_internal.h +++ b/chromium/url/url_canon_internal.h @@ -14,7 +14,7 @@ #include <stdlib.h> #include "base/component_export.h" -#include "base/logging.h" +#include "base/notreached.h" #include "url/url_canon.h" namespace url { diff --git a/chromium/url/url_canon_relative.cc b/chromium/url/url_canon_relative.cc index d7dcd3c27c7..9db211a22ef 100644 --- a/chromium/url/url_canon_relative.cc +++ b/chromium/url/url_canon_relative.cc @@ -5,6 +5,7 @@ // Canonicalizer functions for working with and resolving relative URLs. #include <algorithm> +#include <ostream> #include "base/check_op.h" #include "base/strings/string_util.h" diff --git a/chromium/url/url_idna_icu.cc b/chromium/url/url_idna_icu.cc index 0b0ffd72798..8f858394603 100644 --- a/chromium/url/url_idna_icu.cc +++ b/chromium/url/url_idna_icu.cc @@ -8,6 +8,8 @@ #include <stdlib.h> #include <string.h> +#include <ostream> + #include "base/check_op.h" #include "base/no_destructor.h" #include "third_party/icu/source/common/unicode/uidna.h" @@ -52,7 +54,7 @@ struct UIDNAWrapper { << ". If you see this error message in a test environment " << "your test environment likely lacks the required data " << "tables for libicu. See https://crbug.com/778929."; - value = NULL; + value = nullptr; } } @@ -84,7 +86,7 @@ bool IDNToASCII(const base::char16* src, int src_len, CanonOutputW* output) { DCHECK(output->length() == 0); // Output buffer is assumed empty. UIDNA* uidna = GetUIDNA(); - DCHECK(uidna != NULL); + DCHECK(uidna != nullptr); while (true) { UErrorCode err = U_ZERO_ERROR; UIDNAInfo info = UIDNA_INFO_INITIALIZER; diff --git a/chromium/url/url_util.cc b/chromium/url/url_util.cc index 216fb7e7601..49cc6e689f3 100644 --- a/chromium/url/url_util.cc +++ b/chromium/url/url_util.cc @@ -49,6 +49,12 @@ struct SchemeRegistry { }; // Schemes that are allowed for referrers. + // + // WARNING: Adding (1) a non-"standard" scheme or (2) a scheme whose URLs have + // opaque origins could lead to surprising behavior in some of the referrer + // generation logic. In order to avoid surprises, be sure to have adequate + // test coverage in each of the multiple code locations that compute + // referrers. std::vector<SchemeWithType> referrer_schemes = { {kHttpsScheme, SCHEME_WITH_HOST_PORT_AND_USER_INFORMATION}, {kHttpScheme, SCHEME_WITH_HOST_PORT_AND_USER_INFORMATION}, |