Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Portions of this code based on Mozilla: | 5 // Portions of this code based on Mozilla: |
| 6 // (netwerk/cookie/src/nsCookieService.cpp) | 6 // (netwerk/cookie/src/nsCookieService.cpp) |
| 7 /* ***** BEGIN LICENSE BLOCK ***** | 7 /* ***** BEGIN LICENSE BLOCK ***** |
| 8 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 8 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
| 9 * | 9 * |
| 10 * The contents of this file are subject to the Mozilla Public License Version | 10 * The contents of this file are subject to the Mozilla Public License Version |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 55 #include "base/logging.h" | 55 #include "base/logging.h" |
| 56 #include "base/macros.h" | 56 #include "base/macros.h" |
| 57 #include "base/memory/ptr_util.h" | 57 #include "base/memory/ptr_util.h" |
| 58 #include "base/metrics/field_trial.h" | 58 #include "base/metrics/field_trial.h" |
| 59 #include "base/metrics/histogram.h" | 59 #include "base/metrics/histogram.h" |
| 60 #include "base/profiler/scoped_tracker.h" | 60 #include "base/profiler/scoped_tracker.h" |
| 61 #include "base/single_thread_task_runner.h" | 61 #include "base/single_thread_task_runner.h" |
| 62 #include "base/strings/string_util.h" | 62 #include "base/strings/string_util.h" |
| 63 #include "base/strings/stringprintf.h" | 63 #include "base/strings/stringprintf.h" |
| 64 #include "base/threading/thread_task_runner_handle.h" | 64 #include "base/threading/thread_task_runner_handle.h" |
| 65 #include "base/time/time.h" | |
|
mmenke
2017/06/16 15:56:28
nit: Not needed, already included in header.
Randy Smith (Not in Mondays)
2017/06/16 21:38:00
Done.
| |
| 65 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" | 66 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
| 66 #include "net/cookies/canonical_cookie.h" | 67 #include "net/cookies/canonical_cookie.h" |
| 67 #include "net/cookies/cookie_util.h" | 68 #include "net/cookies/cookie_util.h" |
| 68 #include "net/cookies/parsed_cookie.h" | 69 #include "net/cookies/parsed_cookie.h" |
| 69 #include "net/ssl/channel_id_service.h" | 70 #include "net/ssl/channel_id_service.h" |
| 70 #include "url/origin.h" | 71 #include "url/origin.h" |
| 71 | 72 |
| 72 using base::Time; | 73 using base::Time; |
| 73 using base::TimeDelta; | 74 using base::TimeDelta; |
| 74 using base::TimeTicks; | 75 using base::TimeTicks; |
| (...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 687 private: | 688 private: |
| 688 CanonicalCookie cookie_; | 689 CanonicalCookie cookie_; |
| 689 | 690 |
| 690 DISALLOW_COPY_AND_ASSIGN(DeleteCanonicalCookieTask); | 691 DISALLOW_COPY_AND_ASSIGN(DeleteCanonicalCookieTask); |
| 691 }; | 692 }; |
| 692 | 693 |
| 693 int CookieMonster::DeleteCanonicalCookieTask::RunDeleteTask() { | 694 int CookieMonster::DeleteCanonicalCookieTask::RunDeleteTask() { |
| 694 return this->cookie_monster()->DeleteCanonicalCookie(cookie_); | 695 return this->cookie_monster()->DeleteCanonicalCookie(cookie_); |
| 695 } | 696 } |
| 696 | 697 |
| 698 // Task class for SetCanonicalCookie call. | |
| 699 class CookieMonster::SetCanonicalCookieTask : public CookieMonsterTask { | |
| 700 public: | |
| 701 SetCanonicalCookieTask(CookieMonster* cookie_monster, | |
| 702 std::unique_ptr<CanonicalCookie> cookie, | |
| 703 bool secure_source, | |
| 704 bool modify_http_only, | |
| 705 const SetCookiesCallback& callback) | |
| 706 : CookieMonsterTask(cookie_monster), | |
| 707 cookie_(std::move(cookie)), | |
| 708 secure_source_(secure_source), | |
| 709 modify_http_only_(modify_http_only), | |
| 710 callback_(callback) {} | |
| 711 | |
| 712 // CookieMonsterTask: | |
| 713 void Run() override; | |
| 714 | |
| 715 protected: | |
| 716 ~SetCanonicalCookieTask() override {} | |
| 717 | |
| 718 private: | |
| 719 std::unique_ptr<CanonicalCookie> cookie_; | |
| 720 bool secure_source_; | |
| 721 bool modify_http_only_; | |
| 722 SetCookiesCallback callback_; | |
| 723 | |
| 724 DISALLOW_COPY_AND_ASSIGN(SetCanonicalCookieTask); | |
| 725 }; | |
| 726 | |
| 727 void CookieMonster::SetCanonicalCookieTask::Run() { | |
| 728 bool result = this->cookie_monster()->SetCanonicalCookie( | |
| 729 std::move(cookie_), secure_source_, modify_http_only_); | |
| 730 if (!callback_.is_null()) | |
| 731 callback_.Run(result); | |
| 732 } | |
| 733 | |
| 697 // Task class for SetCookieWithOptions call. | 734 // Task class for SetCookieWithOptions call. |
| 698 class CookieMonster::SetCookieWithOptionsTask : public CookieMonsterTask { | 735 class CookieMonster::SetCookieWithOptionsTask : public CookieMonsterTask { |
| 699 public: | 736 public: |
| 700 SetCookieWithOptionsTask(CookieMonster* cookie_monster, | 737 SetCookieWithOptionsTask(CookieMonster* cookie_monster, |
| 701 const GURL& url, | 738 const GURL& url, |
| 702 const std::string& cookie_line, | 739 const std::string& cookie_line, |
| 703 const CookieOptions& options, | 740 const CookieOptions& options, |
| 704 const SetCookiesCallback& callback) | 741 const SetCookiesCallback& callback) |
| 705 : CookieMonsterTask(cookie_monster), | 742 : CookieMonsterTask(cookie_monster), |
| 706 url_(url), | 743 url_(url), |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 895 store_->SetForceKeepSessionState(); | 932 store_->SetForceKeepSessionState(); |
| 896 } | 933 } |
| 897 | 934 |
| 898 void CookieMonster::SetAllCookiesAsync(const CookieList& list, | 935 void CookieMonster::SetAllCookiesAsync(const CookieList& list, |
| 899 const SetCookiesCallback& callback) { | 936 const SetCookiesCallback& callback) { |
| 900 scoped_refptr<SetAllCookiesTask> task = | 937 scoped_refptr<SetAllCookiesTask> task = |
| 901 new SetAllCookiesTask(this, list, callback); | 938 new SetAllCookiesTask(this, list, callback); |
| 902 DoCookieTask(task); | 939 DoCookieTask(task); |
| 903 } | 940 } |
| 904 | 941 |
| 942 void CookieMonster::SetCanonicalCookieAsync( | |
| 943 const CanonicalCookie& cookie, | |
| 944 bool secure_source, | |
| 945 bool modify_http_only, | |
| 946 const SetCookiesCallback& callback) { | |
| 947 DCHECK(cookie.IsCanonical()); | |
| 948 scoped_refptr<SetCanonicalCookieTask> task = new SetCanonicalCookieTask( | |
| 949 this, base::MakeUnique<CanonicalCookie>(cookie), secure_source, | |
|
mmenke
2017/06/16 15:56:28
Should this take a unique_ptr<CanonicalCookie> ins
Randy Smith (Not in Mondays)
2017/06/16 21:38:00
I think I'm going to say "Yeah, that makes sense",
| |
| 950 modify_http_only, callback); | |
| 951 | |
| 952 // TODO(rdsmith): Switch to DoCookieTaskForURL (or the equivalent). | |
| 953 // This is tricky because we don't have the scheme in this routine | |
| 954 // and DoCookieTaskForURL uses cookie_util::GetEffectiveDomain(scheme, host) | |
| 955 // to generate the database key to block behind. | |
| 956 DoCookieTask(task); | |
| 957 } | |
| 958 | |
| 905 void CookieMonster::SetCookieWithOptionsAsync( | 959 void CookieMonster::SetCookieWithOptionsAsync( |
| 906 const GURL& url, | 960 const GURL& url, |
| 907 const std::string& cookie_line, | 961 const std::string& cookie_line, |
| 908 const CookieOptions& options, | 962 const CookieOptions& options, |
| 909 const SetCookiesCallback& callback) { | 963 const SetCookiesCallback& callback) { |
| 910 scoped_refptr<SetCookieWithOptionsTask> task = | 964 scoped_refptr<SetCookieWithOptionsTask> task = |
| 911 new SetCookieWithOptionsTask(this, url, cookie_line, options, callback); | 965 new SetCookieWithOptionsTask(this, url, cookie_line, options, callback); |
| 912 | 966 |
| 913 DoCookieTaskForURL(task, url); | 967 DoCookieTaskForURL(task, url); |
| 914 } | 968 } |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1061 base::Time last_access_time, | 1115 base::Time last_access_time, |
| 1062 bool secure, | 1116 bool secure, |
| 1063 bool http_only, | 1117 bool http_only, |
| 1064 CookieSameSite same_site, | 1118 CookieSameSite same_site, |
| 1065 CookiePriority priority) { | 1119 CookiePriority priority) { |
| 1066 DCHECK(thread_checker_.CalledOnValidThread()); | 1120 DCHECK(thread_checker_.CalledOnValidThread()); |
| 1067 | 1121 |
| 1068 if (!HasCookieableScheme(url)) | 1122 if (!HasCookieableScheme(url)) |
| 1069 return false; | 1123 return false; |
| 1070 | 1124 |
| 1071 // TODO(mmenke): This class assumes each cookie to have a unique creation | |
| 1072 // time. Allowing the caller to set the creation time violates that | |
| 1073 // assumption. Worth fixing? Worth noting that time changes between browser | |
| 1074 // restarts can cause the same issue. | |
| 1075 base::Time actual_creation_time = creation_time; | |
| 1076 if (creation_time.is_null()) { | |
| 1077 actual_creation_time = CurrentTime(); | |
| 1078 last_time_seen_ = actual_creation_time; | |
| 1079 } | |
| 1080 | |
| 1081 // Validate consistency of passed arguments. | 1125 // Validate consistency of passed arguments. |
| 1082 if (ParsedCookie::ParseTokenString(name) != name || | 1126 if (ParsedCookie::ParseTokenString(name) != name || |
| 1083 ParsedCookie::ParseValueString(value) != value || | 1127 ParsedCookie::ParseValueString(value) != value || |
| 1084 ParsedCookie::ParseValueString(domain) != domain || | 1128 ParsedCookie::ParseValueString(domain) != domain || |
| 1085 ParsedCookie::ParseValueString(path) != path) { | 1129 ParsedCookie::ParseValueString(path) != path) { |
| 1086 return false; | 1130 return false; |
| 1087 } | 1131 } |
| 1088 | 1132 |
| 1089 std::string cookie_domain; | 1133 std::string cookie_domain; |
| 1090 if (!cookie_util::GetCookieDomainWithString(url, domain, &cookie_domain)) | 1134 if (!cookie_util::GetCookieDomainWithString(url, domain, &cookie_domain)) |
| 1091 return false; | 1135 return false; |
| 1092 | 1136 |
| 1093 std::string cookie_path = CanonicalCookie::CanonPathWithString(url, path); | 1137 std::string cookie_path = CanonicalCookie::CanonPathWithString(url, path); |
| 1094 if (!path.empty() && cookie_path != path) | 1138 if (!path.empty() && cookie_path != path) |
| 1095 return false; | 1139 return false; |
| 1096 | 1140 |
| 1097 // Canonicalize path again to make sure it escapes characters as needed. | 1141 // Canonicalize path again to make sure it escapes characters as needed. |
| 1098 url::Component path_component(0, cookie_path.length()); | 1142 url::Component path_component(0, cookie_path.length()); |
| 1099 url::RawCanonOutputT<char> canon_path; | 1143 url::RawCanonOutputT<char> canon_path; |
| 1100 url::Component canon_path_component; | 1144 url::Component canon_path_component; |
| 1101 url::CanonicalizePath(cookie_path.data(), path_component, &canon_path, | 1145 url::CanonicalizePath(cookie_path.data(), path_component, &canon_path, |
| 1102 &canon_path_component); | 1146 &canon_path_component); |
| 1103 cookie_path = std::string(canon_path.data() + canon_path_component.begin, | 1147 cookie_path = std::string(canon_path.data() + canon_path_component.begin, |
| 1104 canon_path_component.len); | 1148 canon_path_component.len); |
| 1105 | 1149 |
| 1106 std::unique_ptr<CanonicalCookie> cc(base::MakeUnique<CanonicalCookie>( | 1150 std::unique_ptr<CanonicalCookie> cc(base::MakeUnique<CanonicalCookie>( |
| 1107 name, value, cookie_domain, cookie_path, actual_creation_time, | 1151 name, value, cookie_domain, cookie_path, creation_time, expiration_time, |
| 1108 expiration_time, last_access_time, secure, http_only, same_site, | 1152 last_access_time, secure, http_only, same_site, priority)); |
| 1109 priority)); | |
| 1110 | 1153 |
| 1111 return SetCanonicalCookie(std::move(cc), url.SchemeIsCryptographic(), true); | 1154 return SetCanonicalCookie(std::move(cc), url.SchemeIsCryptographic(), true); |
| 1112 } | 1155 } |
| 1113 | 1156 |
| 1114 CookieList CookieMonster::GetAllCookies() { | 1157 CookieList CookieMonster::GetAllCookies() { |
| 1115 DCHECK(thread_checker_.CalledOnValidThread()); | 1158 DCHECK(thread_checker_.CalledOnValidThread()); |
| 1116 | 1159 |
| 1117 // This function is being called to scrape the cookie list for management UI | 1160 // This function is being called to scrape the cookie list for management UI |
| 1118 // or similar. We shouldn't show expired cookies in this list since it will | 1161 // or similar. We shouldn't show expired cookies in this list since it will |
| 1119 // just be confusing to users, and this function is called rarely enough (and | 1162 // just be confusing to users, and this function is called rarely enough (and |
| (...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1759 } | 1802 } |
| 1760 | 1803 |
| 1761 bool CookieMonster::SetCanonicalCookie(std::unique_ptr<CanonicalCookie> cc, | 1804 bool CookieMonster::SetCanonicalCookie(std::unique_ptr<CanonicalCookie> cc, |
| 1762 bool secure_source, | 1805 bool secure_source, |
| 1763 bool modify_http_only) { | 1806 bool modify_http_only) { |
| 1764 DCHECK(thread_checker_.CalledOnValidThread()); | 1807 DCHECK(thread_checker_.CalledOnValidThread()); |
| 1765 | 1808 |
| 1766 if (cc->IsSecure() && !secure_source) | 1809 if (cc->IsSecure() && !secure_source) |
| 1767 return false; | 1810 return false; |
| 1768 | 1811 |
| 1769 Time creation_time = cc->CreationDate(); | |
| 1770 const std::string key(GetKey(cc->Domain())); | 1812 const std::string key(GetKey(cc->Domain())); |
| 1771 bool already_expired = cc->IsExpired(creation_time); | 1813 |
| 1814 // TODO(mmenke): This class assumes each cookie to have a unique creation | |
| 1815 // time. Allowing the caller to set the creation time violates that | |
| 1816 // assumption. Worth fixing? Worth noting that time changes between browser | |
| 1817 // restarts can cause the same issue. | |
| 1818 base::Time creation_date = cc->CreationDate(); | |
| 1819 if (creation_date.is_null()) { | |
| 1820 creation_date = CurrentTime(); | |
| 1821 cc->SetCreationDate(creation_date); | |
| 1822 last_time_seen_ = creation_date; | |
| 1823 } | |
| 1824 bool already_expired = cc->IsExpired(creation_date); | |
| 1772 | 1825 |
| 1773 if (DeleteAnyEquivalentCookie(key, *cc, secure_source, !modify_http_only, | 1826 if (DeleteAnyEquivalentCookie(key, *cc, secure_source, !modify_http_only, |
| 1774 already_expired)) { | 1827 already_expired)) { |
| 1775 std::string error; | 1828 std::string error; |
| 1776 error = | 1829 error = |
| 1777 "SetCookie() not clobbering httponly cookie or secure cookie for " | 1830 "SetCookie() not clobbering httponly cookie or secure cookie for " |
| 1778 "insecure scheme"; | 1831 "insecure scheme"; |
| 1779 | 1832 |
| 1780 VLOG(kVlogSetCookies) << error; | 1833 VLOG(kVlogSetCookies) << error; |
| 1781 return false; | 1834 return false; |
| 1782 } | 1835 } |
| 1783 | 1836 |
| 1784 VLOG(kVlogSetCookies) << "SetCookie() key: " << key | 1837 VLOG(kVlogSetCookies) << "SetCookie() key: " << key |
| 1785 << " cc: " << cc->DebugString(); | 1838 << " cc: " << cc->DebugString(); |
| 1786 | 1839 |
| 1787 // Realize that we might be setting an expired cookie, and the only point | 1840 // Realize that we might be setting an expired cookie, and the only point |
| 1788 // was to delete the cookie which we've already done. | 1841 // was to delete the cookie which we've already done. |
| 1789 if (!already_expired) { | 1842 if (!already_expired) { |
| 1790 // See InitializeHistograms() for details. | 1843 // See InitializeHistograms() for details. |
| 1791 if (cc->IsPersistent()) { | 1844 if (cc->IsPersistent()) { |
| 1792 histogram_expiration_duration_minutes_->Add( | 1845 histogram_expiration_duration_minutes_->Add( |
| 1793 (cc->ExpiryDate() - creation_time).InMinutes()); | 1846 (cc->ExpiryDate() - creation_date).InMinutes()); |
| 1794 } | 1847 } |
| 1795 | 1848 |
| 1796 // Histogram the type of scheme used on URLs that set cookies. This | 1849 // Histogram the type of scheme used on URLs that set cookies. This |
| 1797 // intentionally includes cookies that are set or overwritten by | 1850 // intentionally includes cookies that are set or overwritten by |
| 1798 // http:// URLs, but not cookies that are cleared by http:// URLs, to | 1851 // http:// URLs, but not cookies that are cleared by http:// URLs, to |
| 1799 // understand if the former behavior can be deprecated for Secure | 1852 // understand if the former behavior can be deprecated for Secure |
| 1800 // cookies. | 1853 // cookies. |
| 1801 CookieSource cookie_source_sample = | 1854 CookieSource cookie_source_sample = |
| 1802 (secure_source | 1855 (secure_source |
| 1803 ? (cc->IsSecure() | 1856 ? (cc->IsSecure() |
| 1804 ? COOKIE_SOURCE_SECURE_COOKIE_CRYPTOGRAPHIC_SCHEME | 1857 ? COOKIE_SOURCE_SECURE_COOKIE_CRYPTOGRAPHIC_SCHEME |
| 1805 : COOKIE_SOURCE_NONSECURE_COOKIE_CRYPTOGRAPHIC_SCHEME) | 1858 : COOKIE_SOURCE_NONSECURE_COOKIE_CRYPTOGRAPHIC_SCHEME) |
| 1806 : (cc->IsSecure() | 1859 : (cc->IsSecure() |
| 1807 ? COOKIE_SOURCE_SECURE_COOKIE_NONCRYPTOGRAPHIC_SCHEME | 1860 ? COOKIE_SOURCE_SECURE_COOKIE_NONCRYPTOGRAPHIC_SCHEME |
| 1808 : COOKIE_SOURCE_NONSECURE_COOKIE_NONCRYPTOGRAPHIC_SCHEME)); | 1861 : COOKIE_SOURCE_NONSECURE_COOKIE_NONCRYPTOGRAPHIC_SCHEME)); |
| 1809 histogram_cookie_source_scheme_->Add(cookie_source_sample); | 1862 histogram_cookie_source_scheme_->Add(cookie_source_sample); |
| 1810 | 1863 |
| 1811 InternalInsertCookie(key, std::move(cc), true); | 1864 InternalInsertCookie(key, std::move(cc), true); |
| 1812 } else { | 1865 } else { |
| 1813 VLOG(kVlogSetCookies) << "SetCookie() not storing already expired cookie."; | 1866 VLOG(kVlogSetCookies) << "SetCookie() not storing already expired cookie."; |
| 1814 } | 1867 } |
| 1815 | 1868 |
| 1816 // We assume that hopefully setting a cookie will be less common than | 1869 // We assume that hopefully setting a cookie will be less common than |
| 1817 // querying a cookie. Since setting a cookie can put us over our limits, | 1870 // querying a cookie. Since setting a cookie can put us over our limits, |
| 1818 // make sure that we garbage collect... We can also make the assumption that | 1871 // make sure that we garbage collect... We can also make the assumption that |
| 1819 // if a cookie was set, in the common case it will be used soon after, | 1872 // if a cookie was set, in the common case it will be used soon after, |
| 1820 // and we will purge the expired cookies in GetCookies(). | 1873 // and we will purge the expired cookies in GetCookies(). |
| 1821 GarbageCollect(creation_time, key); | 1874 GarbageCollect(creation_date, key); |
|
mmenke
2017/06/16 15:56:28
So we just accept a creation date from the consume
Randy Smith (Not in Mondays)
2017/06/16 21:38:00
Good point, but I think it's currently existing be
| |
| 1822 | 1875 |
| 1823 return true; | 1876 return true; |
| 1824 } | 1877 } |
| 1825 | 1878 |
| 1826 bool CookieMonster::SetAllCookies(const CookieList& list) { | 1879 bool CookieMonster::SetAllCookies(const CookieList& list) { |
| 1827 DCHECK(thread_checker_.CalledOnValidThread()); | 1880 DCHECK(thread_checker_.CalledOnValidThread()); |
| 1828 for (const auto& cookie : list) { | 1881 for (const auto& cookie : list) { |
| 1829 const std::string key(GetKey(cookie.Domain())); | 1882 const std::string key(GetKey(cookie.Domain())); |
| 1830 Time creation_time = cookie.CreationDate(); | 1883 Time creation_time = cookie.CreationDate(); |
| 1831 bool already_expired = cookie.IsExpired(creation_time); | 1884 bool already_expired = cookie.IsExpired(creation_time); |
| (...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2299 "Cookie.Count", 1, 4000, 50, base::Histogram::kUmaTargetedHistogramFlag); | 2352 "Cookie.Count", 1, 4000, 50, base::Histogram::kUmaTargetedHistogramFlag); |
| 2300 | 2353 |
| 2301 // From UMA_HISTOGRAM_ENUMERATION | 2354 // From UMA_HISTOGRAM_ENUMERATION |
| 2302 histogram_cookie_deletion_cause_ = base::LinearHistogram::FactoryGet( | 2355 histogram_cookie_deletion_cause_ = base::LinearHistogram::FactoryGet( |
| 2303 "Cookie.DeletionCause", 1, DELETE_COOKIE_LAST_ENTRY - 1, | 2356 "Cookie.DeletionCause", 1, DELETE_COOKIE_LAST_ENTRY - 1, |
| 2304 DELETE_COOKIE_LAST_ENTRY, base::Histogram::kUmaTargetedHistogramFlag); | 2357 DELETE_COOKIE_LAST_ENTRY, base::Histogram::kUmaTargetedHistogramFlag); |
| 2305 histogram_cookie_type_ = base::LinearHistogram::FactoryGet( | 2358 histogram_cookie_type_ = base::LinearHistogram::FactoryGet( |
| 2306 "Cookie.Type", 1, (1 << COOKIE_TYPE_LAST_ENTRY) - 1, | 2359 "Cookie.Type", 1, (1 << COOKIE_TYPE_LAST_ENTRY) - 1, |
| 2307 1 << COOKIE_TYPE_LAST_ENTRY, base::Histogram::kUmaTargetedHistogramFlag); | 2360 1 << COOKIE_TYPE_LAST_ENTRY, base::Histogram::kUmaTargetedHistogramFlag); |
| 2308 histogram_cookie_source_scheme_ = base::LinearHistogram::FactoryGet( | 2361 histogram_cookie_source_scheme_ = base::LinearHistogram::FactoryGet( |
| 2309 "Cookie.CookieSourceScheme", 1, COOKIE_SOURCE_LAST_ENTRY - 1, | 2362 "Cookie.CookieSourceScheme", 1, COOKIE_SOURCE_LAST_ENTRY - 1, |
|
mmenke
2017/06/16 15:56:28
Isn't this the histogram you renamed in the XML fi
Randy Smith (Not in Mondays)
2017/06/16 21:38:00
Whoops. Removed renaming from the xml file.
| |
| 2310 COOKIE_SOURCE_LAST_ENTRY, base::Histogram::kUmaTargetedHistogramFlag); | 2363 COOKIE_SOURCE_LAST_ENTRY, base::Histogram::kUmaTargetedHistogramFlag); |
| 2311 histogram_cookie_delete_equivalent_ = base::LinearHistogram::FactoryGet( | 2364 histogram_cookie_delete_equivalent_ = base::LinearHistogram::FactoryGet( |
| 2312 "Cookie.CookieDeleteEquivalent", 1, | 2365 "Cookie.CookieDeleteEquivalent", 1, |
| 2313 COOKIE_DELETE_EQUIVALENT_LAST_ENTRY - 1, | 2366 COOKIE_DELETE_EQUIVALENT_LAST_ENTRY - 1, |
| 2314 COOKIE_DELETE_EQUIVALENT_LAST_ENTRY, | 2367 COOKIE_DELETE_EQUIVALENT_LAST_ENTRY, |
| 2315 base::Histogram::kUmaTargetedHistogramFlag); | 2368 base::Histogram::kUmaTargetedHistogramFlag); |
| 2316 | 2369 |
| 2317 // From UMA_HISTOGRAM_{CUSTOM_,}TIMES | 2370 // From UMA_HISTOGRAM_{CUSTOM_,}TIMES |
| 2318 histogram_time_blocked_on_load_ = base::Histogram::FactoryTimeGet( | 2371 histogram_time_blocked_on_load_ = base::Histogram::FactoryTimeGet( |
| 2319 "Cookie.TimeBlockedOnLoad", base::TimeDelta::FromMilliseconds(1), | 2372 "Cookie.TimeBlockedOnLoad", base::TimeDelta::FromMilliseconds(1), |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2443 it != hook_map_.end(); ++it) { | 2496 it != hook_map_.end(); ++it) { |
| 2444 std::pair<GURL, std::string> key = it->first; | 2497 std::pair<GURL, std::string> key = it->first; |
| 2445 if (cookie.IncludeForRequestURL(key.first, opts) && | 2498 if (cookie.IncludeForRequestURL(key.first, opts) && |
| 2446 cookie.Name() == key.second) { | 2499 cookie.Name() == key.second) { |
| 2447 it->second->Notify(cookie, cause); | 2500 it->second->Notify(cookie, cause); |
| 2448 } | 2501 } |
| 2449 } | 2502 } |
| 2450 } | 2503 } |
| 2451 | 2504 |
| 2452 } // namespace net | 2505 } // namespace net |
| OLD | NEW |