diff options
Diffstat (limited to 'chromium/net/cookies/canonical_cookie.h')
-rw-r--r-- | chromium/net/cookies/canonical_cookie.h | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/chromium/net/cookies/canonical_cookie.h b/chromium/net/cookies/canonical_cookie.h index 7afdc20a502..22c331751c1 100644 --- a/chromium/net/cookies/canonical_cookie.h +++ b/chromium/net/cookies/canonical_cookie.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -10,9 +10,11 @@ #include <tuple> #include <vector> +#include "base/feature_list.h" #include "base/gtest_prod_util.h" #include "base/strings/string_piece.h" #include "base/time/time.h" +#include "net/base/features.h" #include "net/base/net_export.h" #include "net/cookies/cookie_access_result.h" #include "net/cookies/cookie_constants.h" @@ -474,11 +476,22 @@ class NET_EXPORT CanonicalCookie { // Returns the CookiePrefix (or COOKIE_PREFIX_NONE if none) that // applies to the given cookie |name|. - static CookiePrefix GetCookiePrefix(const std::string& name); + static CookiePrefix GetCookiePrefix(const std::string& name) { + return GetCookiePrefix(name, + base::FeatureList::IsEnabled( + net::features::kCaseInsensitiveCookiePrefix)); + } + + // Returns the CookiePrefix (or COOKIE_PREFIX_NONE if none) that + // applies to the given cookie |name|. If `check_insensitively` is true then + // the string comparison will be performed case insensitively. + static CookiePrefix GetCookiePrefix(const std::string& name, + bool check_insensitively); // Records histograms to measure how often cookie prefixes appear in // the wild and how often they would be blocked. - static void RecordCookiePrefixMetrics(CookiePrefix prefix, - bool is_cookie_valid); + static void RecordCookiePrefixMetrics(CookiePrefix prefix_case_sensitive, + CookiePrefix prefix_case_insensitive, + bool is_insensitive_prefix_valid); // Returns true if a prefixed cookie does not violate any of the rules // for that cookie. static bool IsCookiePrefixValid(CookiePrefix prefix, |