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 1074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1085 url::CanonicalizePath(cookie_path.data(), path_component, &canon_path, | 1085 url::CanonicalizePath(cookie_path.data(), path_component, &canon_path, |
| 1086 &canon_path_component); | 1086 &canon_path_component); |
| 1087 cookie_path = std::string(canon_path.data() + canon_path_component.begin, | 1087 cookie_path = std::string(canon_path.data() + canon_path_component.begin, |
| 1088 canon_path_component.len); | 1088 canon_path_component.len); |
| 1089 | 1089 |
| 1090 std::unique_ptr<CanonicalCookie> cc(base::MakeUnique<CanonicalCookie>( | 1090 std::unique_ptr<CanonicalCookie> cc(base::MakeUnique<CanonicalCookie>( |
| 1091 name, value, cookie_domain, cookie_path, actual_creation_time, | 1091 name, value, cookie_domain, cookie_path, actual_creation_time, |
| 1092 expiration_time, last_access_time, secure, http_only, same_site, | 1092 expiration_time, last_access_time, secure, http_only, same_site, |
| 1093 priority)); | 1093 priority)); |
| 1094 | 1094 |
| 1095 CookieOptions options; | 1095 return SetCanonicalCookie(std::move(cc), url.SchemeIsCryptographic(), true); |
| 1096 options.set_include_httponly(); | |
| 1097 options.set_same_site_cookie_mode( | |
| 1098 CookieOptions::SameSiteCookieMode::INCLUDE_STRICT_AND_LAX); | |
|
mmenke
2017/05/25 20:04:29
So the INCLUDE_STRICT_AND_LAX here didn't matter?
Randy Smith (Not in Mondays)
2017/06/09 11:19:32
I didn't find anything under SetCanonicalCookie th
| |
| 1099 return SetCanonicalCookie(std::move(cc), url, options); | |
| 1100 } | 1096 } |
| 1101 | 1097 |
| 1102 CookieList CookieMonster::GetAllCookies() { | 1098 CookieList CookieMonster::GetAllCookies() { |
| 1103 DCHECK(thread_checker_.CalledOnValidThread()); | 1099 DCHECK(thread_checker_.CalledOnValidThread()); |
| 1104 | 1100 |
| 1105 // This function is being called to scrape the cookie list for management UI | 1101 // This function is being called to scrape the cookie list for management UI |
| 1106 // or similar. We shouldn't show expired cookies in this list since it will | 1102 // or similar. We shouldn't show expired cookies in this list since it will |
| 1107 // just be confusing to users, and this function is called rarely enough (and | 1103 // just be confusing to users, and this function is called rarely enough (and |
| 1108 // is already slow enough) that it's OK to take the time to garbage collect | 1104 // is already slow enough) that it's OK to take the time to garbage collect |
| 1109 // the expired cookies now. | 1105 // the expired cookies now. |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1408 // Even if a key is expired, insert it so it can be garbage collected, | 1404 // Even if a key is expired, insert it so it can be garbage collected, |
| 1409 // removed, and sync'd. | 1405 // removed, and sync'd. |
| 1410 CookieItVector cookies_with_control_chars; | 1406 CookieItVector cookies_with_control_chars; |
| 1411 | 1407 |
| 1412 for (auto& cookie : cookies) { | 1408 for (auto& cookie : cookies) { |
| 1413 int64_t cookie_creation_time = cookie->CreationDate().ToInternalValue(); | 1409 int64_t cookie_creation_time = cookie->CreationDate().ToInternalValue(); |
| 1414 | 1410 |
| 1415 if (creation_times_.insert(cookie_creation_time).second) { | 1411 if (creation_times_.insert(cookie_creation_time).second) { |
| 1416 CanonicalCookie* cookie_ptr = cookie.get(); | 1412 CanonicalCookie* cookie_ptr = cookie.get(); |
| 1417 CookieMap::iterator inserted = InternalInsertCookie( | 1413 CookieMap::iterator inserted = InternalInsertCookie( |
| 1418 GetKey(cookie_ptr->Domain()), std::move(cookie), GURL(), false); | 1414 GetKey(cookie_ptr->Domain()), std::move(cookie), false, false); |
| 1419 const Time cookie_access_time(cookie_ptr->LastAccessDate()); | 1415 const Time cookie_access_time(cookie_ptr->LastAccessDate()); |
| 1420 if (earliest_access_time_.is_null() || | 1416 if (earliest_access_time_.is_null() || |
| 1421 cookie_access_time < earliest_access_time_) | 1417 cookie_access_time < earliest_access_time_) |
| 1422 earliest_access_time_ = cookie_access_time; | 1418 earliest_access_time_ = cookie_access_time; |
| 1423 | 1419 |
| 1424 if (ContainsControlCharacter(cookie_ptr->Name()) || | 1420 if (ContainsControlCharacter(cookie_ptr->Name()) || |
| 1425 ContainsControlCharacter(cookie_ptr->Value())) { | 1421 ContainsControlCharacter(cookie_ptr->Value())) { |
| 1426 cookies_with_control_chars.push_back(inserted); | 1422 cookies_with_control_chars.push_back(inserted); |
| 1427 } | 1423 } |
| 1428 } else { | 1424 } else { |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1622 // time if we've been requested to do so. | 1618 // time if we've been requested to do so. |
| 1623 if (options.update_access_time()) { | 1619 if (options.update_access_time()) { |
| 1624 InternalUpdateCookieAccessTime(cc, current); | 1620 InternalUpdateCookieAccessTime(cc, current); |
| 1625 } | 1621 } |
| 1626 cookies->push_back(cc); | 1622 cookies->push_back(cc); |
| 1627 } | 1623 } |
| 1628 } | 1624 } |
| 1629 | 1625 |
| 1630 bool CookieMonster::DeleteAnyEquivalentCookie(const std::string& key, | 1626 bool CookieMonster::DeleteAnyEquivalentCookie(const std::string& key, |
| 1631 const CanonicalCookie& ecc, | 1627 const CanonicalCookie& ecc, |
| 1632 const GURL& source_url, | 1628 bool source_secure, |
| 1633 bool skip_httponly, | 1629 bool skip_httponly, |
| 1634 bool already_expired) { | 1630 bool already_expired) { |
| 1635 DCHECK(thread_checker_.CalledOnValidThread()); | 1631 DCHECK(thread_checker_.CalledOnValidThread()); |
| 1636 | 1632 |
| 1637 bool found_equivalent_cookie = false; | 1633 bool found_equivalent_cookie = false; |
| 1638 bool skipped_httponly = false; | 1634 bool skipped_httponly = false; |
| 1639 bool skipped_secure_cookie = false; | 1635 bool skipped_secure_cookie = false; |
| 1640 | 1636 |
| 1641 histogram_cookie_delete_equivalent_->Add(COOKIE_DELETE_EQUIVALENT_ATTEMPT); | 1637 histogram_cookie_delete_equivalent_->Add(COOKIE_DELETE_EQUIVALENT_ATTEMPT); |
| 1642 | 1638 |
| 1643 for (CookieMapItPair its = cookies_.equal_range(key); | 1639 for (CookieMapItPair its = cookies_.equal_range(key); |
| 1644 its.first != its.second;) { | 1640 its.first != its.second;) { |
| 1645 CookieMap::iterator curit = its.first; | 1641 CookieMap::iterator curit = its.first; |
| 1646 CanonicalCookie* cc = curit->second.get(); | 1642 CanonicalCookie* cc = curit->second.get(); |
| 1647 ++its.first; | 1643 ++its.first; |
| 1648 | 1644 |
| 1649 // If the cookie is being set from an insecure scheme, then if a cookie | 1645 // If the cookie is being set from an insecure scheme, then if a cookie |
| 1650 // already exists with the same name and it is Secure, then the cookie | 1646 // already exists with the same name and it is Secure, then the cookie |
| 1651 // should *not* be updated if they domain-match and ignoring the path | 1647 // should *not* be updated if they domain-match and ignoring the path |
| 1652 // attribute. | 1648 // attribute. |
| 1653 // | 1649 // |
| 1654 // See: https://tools.ietf.org/html/draft-ietf-httpbis-cookie-alone | 1650 // See: https://tools.ietf.org/html/draft-ietf-httpbis-cookie-alone |
| 1655 if (cc->IsSecure() && !source_url.SchemeIsCryptographic() && | 1651 if (cc->IsSecure() && !source_secure && |
| 1656 ecc.IsEquivalentForSecureCookieMatching(*cc)) { | 1652 ecc.IsEquivalentForSecureCookieMatching(*cc)) { |
| 1657 skipped_secure_cookie = true; | 1653 skipped_secure_cookie = true; |
| 1658 histogram_cookie_delete_equivalent_->Add( | 1654 histogram_cookie_delete_equivalent_->Add( |
| 1659 COOKIE_DELETE_EQUIVALENT_SKIPPING_SECURE); | 1655 COOKIE_DELETE_EQUIVALENT_SKIPPING_SECURE); |
| 1660 // If the cookie is equivalent to the new cookie and wouldn't have been | 1656 // If the cookie is equivalent to the new cookie and wouldn't have been |
| 1661 // skipped for being HTTP-only, record that it is a skipped secure cookie | 1657 // skipped for being HTTP-only, record that it is a skipped secure cookie |
| 1662 // that would have been deleted otherwise. | 1658 // that would have been deleted otherwise. |
| 1663 if (ecc.IsEquivalent(*cc)) { | 1659 if (ecc.IsEquivalent(*cc)) { |
| 1664 found_equivalent_cookie = true; | 1660 found_equivalent_cookie = true; |
| 1665 | 1661 |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 1686 } | 1682 } |
| 1687 found_equivalent_cookie = true; | 1683 found_equivalent_cookie = true; |
| 1688 } | 1684 } |
| 1689 } | 1685 } |
| 1690 return skipped_httponly || skipped_secure_cookie; | 1686 return skipped_httponly || skipped_secure_cookie; |
| 1691 } | 1687 } |
| 1692 | 1688 |
| 1693 CookieMonster::CookieMap::iterator CookieMonster::InternalInsertCookie( | 1689 CookieMonster::CookieMap::iterator CookieMonster::InternalInsertCookie( |
| 1694 const std::string& key, | 1690 const std::string& key, |
| 1695 std::unique_ptr<CanonicalCookie> cc, | 1691 std::unique_ptr<CanonicalCookie> cc, |
| 1696 const GURL& source_url, | 1692 bool source_secure, |
| 1697 bool sync_to_store) { | 1693 bool sync_to_store) { |
| 1698 DCHECK(thread_checker_.CalledOnValidThread()); | 1694 DCHECK(thread_checker_.CalledOnValidThread()); |
| 1699 CanonicalCookie* cc_ptr = cc.get(); | 1695 CanonicalCookie* cc_ptr = cc.get(); |
| 1700 | 1696 |
| 1701 if ((cc_ptr->IsPersistent() || persist_session_cookies_) && store_.get() && | 1697 if ((cc_ptr->IsPersistent() || persist_session_cookies_) && store_.get() && |
| 1702 sync_to_store) | 1698 sync_to_store) |
| 1703 store_->AddCookie(*cc_ptr); | 1699 store_->AddCookie(*cc_ptr); |
| 1704 CookieMap::iterator inserted = | 1700 CookieMap::iterator inserted = |
| 1705 cookies_.insert(CookieMap::value_type(key, std::move(cc))); | 1701 cookies_.insert(CookieMap::value_type(key, std::move(cc))); |
| 1706 if (delegate_.get()) { | 1702 if (delegate_.get()) { |
| 1707 delegate_->OnCookieChanged(*cc_ptr, false, | 1703 delegate_->OnCookieChanged(*cc_ptr, false, |
| 1708 CookieStore::ChangeCause::INSERTED); | 1704 CookieStore::ChangeCause::INSERTED); |
| 1709 } | 1705 } |
| 1710 | 1706 |
| 1711 // See InitializeHistograms() for details. | 1707 // See InitializeHistograms() for details. |
| 1712 int32_t type_sample = cc_ptr->SameSite() != CookieSameSite::NO_RESTRICTION | 1708 int32_t type_sample = cc_ptr->SameSite() != CookieSameSite::NO_RESTRICTION |
| 1713 ? 1 << COOKIE_TYPE_SAME_SITE | 1709 ? 1 << COOKIE_TYPE_SAME_SITE |
| 1714 : 0; | 1710 : 0; |
| 1715 type_sample |= cc_ptr->IsHttpOnly() ? 1 << COOKIE_TYPE_HTTPONLY : 0; | 1711 type_sample |= cc_ptr->IsHttpOnly() ? 1 << COOKIE_TYPE_HTTPONLY : 0; |
| 1716 type_sample |= cc_ptr->IsSecure() ? 1 << COOKIE_TYPE_SECURE : 0; | 1712 type_sample |= cc_ptr->IsSecure() ? 1 << COOKIE_TYPE_SECURE : 0; |
| 1717 histogram_cookie_type_->Add(type_sample); | 1713 histogram_cookie_type_->Add(type_sample); |
| 1718 | 1714 |
| 1719 // Histogram the type of scheme used on URLs that set cookies. This | 1715 // Histogram the type of scheme used on URLs that set cookies. This |
| 1720 // intentionally includes cookies that are set or overwritten by | 1716 // intentionally includes cookies that are set or overwritten by |
| 1721 // http:// URLs, but not cookies that are cleared by http:// URLs, to | 1717 // http:// URLs, but not cookies that are cleared by http:// URLs, to |
| 1722 // understand if the former behavior can be deprecated for Secure | 1718 // understand if the former behavior can be deprecated for Secure |
| 1723 // cookies. | 1719 // cookies. |
| 1724 if (!source_url.is_empty()) { | 1720 CookieSource cookie_source_sample = |
| 1725 CookieSource cookie_source_sample; | 1721 (source_secure |
| 1726 if (source_url.SchemeIsCryptographic()) { | 1722 ? (cc_ptr->IsSecure() |
| 1727 cookie_source_sample = | 1723 ? COOKIE_SOURCE_SECURE_COOKIE_CRYPTOGRAPHIC_SCHEME |
| 1728 cc_ptr->IsSecure() | 1724 : COOKIE_SOURCE_NONSECURE_COOKIE_CRYPTOGRAPHIC_SCHEME) |
| 1729 ? COOKIE_SOURCE_SECURE_COOKIE_CRYPTOGRAPHIC_SCHEME | 1725 : (cc_ptr->IsSecure() |
| 1730 : COOKIE_SOURCE_NONSECURE_COOKIE_CRYPTOGRAPHIC_SCHEME; | 1726 ? COOKIE_SOURCE_SECURE_COOKIE_NONCRYPTOGRAPHIC_SCHEME |
| 1731 } else { | 1727 : COOKIE_SOURCE_NONSECURE_COOKIE_NONCRYPTOGRAPHIC_SCHEME)); |
| 1732 cookie_source_sample = | 1728 histogram_cookie_source_scheme_->Add(cookie_source_sample); |
| 1733 cc_ptr->IsSecure() | |
| 1734 ? COOKIE_SOURCE_SECURE_COOKIE_NONCRYPTOGRAPHIC_SCHEME | |
| 1735 : COOKIE_SOURCE_NONSECURE_COOKIE_NONCRYPTOGRAPHIC_SCHEME; | |
| 1736 } | |
| 1737 histogram_cookie_source_scheme_->Add(cookie_source_sample); | |
| 1738 } | |
| 1739 | 1729 |
| 1740 RunCookieChangedCallbacks(*cc_ptr, CookieStore::ChangeCause::INSERTED); | 1730 RunCookieChangedCallbacks(*cc_ptr, CookieStore::ChangeCause::INSERTED); |
| 1741 | 1731 |
| 1742 return inserted; | 1732 return inserted; |
| 1743 } | 1733 } |
| 1744 | 1734 |
| 1745 bool CookieMonster::SetCookieWithCreationTimeAndOptions( | 1735 bool CookieMonster::SetCookieWithCreationTimeAndOptions( |
| 1746 const GURL& url, | 1736 const GURL& url, |
| 1747 const std::string& cookie_line, | 1737 const std::string& cookie_line, |
| 1748 const Time& creation_time_or_null, | 1738 const Time& creation_time_or_null, |
| 1749 const CookieOptions& options) { | 1739 const CookieOptions& options) { |
| 1750 DCHECK(thread_checker_.CalledOnValidThread()); | 1740 DCHECK(thread_checker_.CalledOnValidThread()); |
| 1751 | 1741 |
| 1752 VLOG(kVlogSetCookies) << "SetCookie() line: " << cookie_line; | 1742 VLOG(kVlogSetCookies) << "SetCookie() line: " << cookie_line; |
| 1753 | 1743 |
| 1754 Time creation_time = creation_time_or_null; | 1744 Time creation_time = creation_time_or_null; |
| 1755 if (creation_time.is_null()) { | 1745 if (creation_time.is_null()) { |
| 1756 creation_time = CurrentTime(); | 1746 creation_time = CurrentTime(); |
| 1757 last_time_seen_ = creation_time; | 1747 last_time_seen_ = creation_time; |
| 1758 } | 1748 } |
| 1759 | 1749 |
| 1760 std::unique_ptr<CanonicalCookie> cc( | 1750 std::unique_ptr<CanonicalCookie> cc( |
| 1761 CanonicalCookie::Create(url, cookie_line, creation_time, options)); | 1751 CanonicalCookie::Create(url, cookie_line, creation_time, options)); |
| 1762 | 1752 |
| 1763 if (!cc.get()) { | 1753 if (!cc.get()) { |
| 1764 VLOG(kVlogSetCookies) << "WARNING: Failed to allocate CanonicalCookie"; | 1754 VLOG(kVlogSetCookies) << "WARNING: Failed to allocate CanonicalCookie"; |
| 1765 return false; | 1755 return false; |
| 1766 } | 1756 } |
| 1767 return SetCanonicalCookie(std::move(cc), url, options); | 1757 return SetCanonicalCookie(std::move(cc), url.SchemeIsCryptographic(), |
| 1758 !options.exclude_httponly()); | |
| 1768 } | 1759 } |
| 1769 | 1760 |
| 1770 bool CookieMonster::SetCanonicalCookie(std::unique_ptr<CanonicalCookie> cc, | 1761 bool CookieMonster::SetCanonicalCookie(std::unique_ptr<CanonicalCookie> cc, |
| 1771 const GURL& source_url, | 1762 bool secure_source, |
| 1772 const CookieOptions& options) { | 1763 bool modify_http_only) { |
| 1773 DCHECK(thread_checker_.CalledOnValidThread()); | 1764 DCHECK(thread_checker_.CalledOnValidThread()); |
| 1774 | 1765 |
| 1775 Time creation_time = cc->CreationDate(); | 1766 Time creation_time = cc->CreationDate(); |
| 1776 const std::string key(GetKey(cc->Domain())); | 1767 const std::string key(GetKey(cc->Domain())); |
| 1777 bool already_expired = cc->IsExpired(creation_time); | 1768 bool already_expired = cc->IsExpired(creation_time); |
| 1778 | 1769 |
| 1779 if (DeleteAnyEquivalentCookie(key, *cc, source_url, | 1770 if (DeleteAnyEquivalentCookie(key, *cc, secure_source, !modify_http_only, |
| 1780 options.exclude_httponly(), already_expired)) { | 1771 already_expired)) { |
| 1781 std::string error; | 1772 std::string error; |
| 1782 error = | 1773 error = |
| 1783 "SetCookie() not clobbering httponly cookie or secure cookie for " | 1774 "SetCookie() not clobbering httponly cookie or secure cookie for " |
| 1784 "insecure scheme"; | 1775 "insecure scheme"; |
| 1785 | 1776 |
| 1786 VLOG(kVlogSetCookies) << error; | 1777 VLOG(kVlogSetCookies) << error; |
| 1787 return false; | 1778 return false; |
| 1788 } | 1779 } |
| 1789 | 1780 |
| 1790 VLOG(kVlogSetCookies) << "SetCookie() key: " << key | 1781 VLOG(kVlogSetCookies) << "SetCookie() key: " << key |
| 1791 << " cc: " << cc->DebugString(); | 1782 << " cc: " << cc->DebugString(); |
| 1792 | 1783 |
| 1793 // Realize that we might be setting an expired cookie, and the only point | 1784 // Realize that we might be setting an expired cookie, and the only point |
| 1794 // was to delete the cookie which we've already done. | 1785 // was to delete the cookie which we've already done. |
| 1795 if (!already_expired) { | 1786 if (!already_expired) { |
| 1796 // See InitializeHistograms() for details. | 1787 // See InitializeHistograms() for details. |
| 1797 if (cc->IsPersistent()) { | 1788 if (cc->IsPersistent()) { |
| 1798 histogram_expiration_duration_minutes_->Add( | 1789 histogram_expiration_duration_minutes_->Add( |
| 1799 (cc->ExpiryDate() - creation_time).InMinutes()); | 1790 (cc->ExpiryDate() - creation_time).InMinutes()); |
| 1800 } | 1791 } |
| 1801 | 1792 |
| 1802 InternalInsertCookie(key, std::move(cc), source_url, true); | 1793 InternalInsertCookie(key, std::move(cc), secure_source, true); |
| 1803 } else { | 1794 } else { |
| 1804 VLOG(kVlogSetCookies) << "SetCookie() not storing already expired cookie."; | 1795 VLOG(kVlogSetCookies) << "SetCookie() not storing already expired cookie."; |
| 1805 } | 1796 } |
| 1806 | 1797 |
| 1807 // We assume that hopefully setting a cookie will be less common than | 1798 // We assume that hopefully setting a cookie will be less common than |
| 1808 // querying a cookie. Since setting a cookie can put us over our limits, | 1799 // querying a cookie. Since setting a cookie can put us over our limits, |
| 1809 // make sure that we garbage collect... We can also make the assumption that | 1800 // make sure that we garbage collect... We can also make the assumption that |
| 1810 // if a cookie was set, in the common case it will be used soon after, | 1801 // if a cookie was set, in the common case it will be used soon after, |
| 1811 // and we will purge the expired cookies in GetCookies(). | 1802 // and we will purge the expired cookies in GetCookies(). |
| 1812 GarbageCollect(creation_time, key); | 1803 GarbageCollect(creation_time, key); |
| 1813 | 1804 |
| 1814 return true; | 1805 return true; |
| 1815 } | 1806 } |
| 1816 | 1807 |
| 1817 bool CookieMonster::SetCanonicalCookies(const CookieList& list) { | 1808 bool CookieMonster::SetCanonicalCookies(const CookieList& list) { |
| 1818 DCHECK(thread_checker_.CalledOnValidThread()); | 1809 DCHECK(thread_checker_.CalledOnValidThread()); |
| 1819 | 1810 |
| 1820 CookieOptions options; | 1811 CookieOptions options; |
| 1821 options.set_include_httponly(); | 1812 options.set_include_httponly(); |
|
mmenke
2017/05/25 20:04:29
Not needed?
Randy Smith (Not in Mondays)
2017/06/09 11:19:31
Whoops. Done.
| |
| 1822 | 1813 |
| 1823 for (const auto& cookie : list) { | 1814 for (const auto& cookie : list) { |
| 1824 // Use an empty GURL. This method does not support setting secure cookies. | 1815 // Use an empty GURL. This method does not support setting secure cookies. |
| 1825 if (!SetCanonicalCookie(base::MakeUnique<CanonicalCookie>(cookie), GURL(), | 1816 if (!SetCanonicalCookie(base::MakeUnique<CanonicalCookie>(cookie), false, |
| 1826 options)) { | 1817 true)) { |
| 1827 return false; | 1818 return false; |
| 1828 } | 1819 } |
| 1829 } | 1820 } |
| 1830 | 1821 |
| 1831 return true; | 1822 return true; |
| 1832 } | 1823 } |
| 1833 | 1824 |
| 1834 void CookieMonster::InternalUpdateCookieAccessTime(CanonicalCookie* cc, | 1825 void CookieMonster::InternalUpdateCookieAccessTime(CanonicalCookie* cc, |
| 1835 const Time& current) { | 1826 const Time& current) { |
| 1836 DCHECK(thread_checker_.CalledOnValidThread()); | 1827 DCHECK(thread_checker_.CalledOnValidThread()); |
| (...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2248 "Cookie.Count", 1, 4000, 50, base::Histogram::kUmaTargetedHistogramFlag); | 2239 "Cookie.Count", 1, 4000, 50, base::Histogram::kUmaTargetedHistogramFlag); |
| 2249 | 2240 |
| 2250 // From UMA_HISTOGRAM_ENUMERATION | 2241 // From UMA_HISTOGRAM_ENUMERATION |
| 2251 histogram_cookie_deletion_cause_ = base::LinearHistogram::FactoryGet( | 2242 histogram_cookie_deletion_cause_ = base::LinearHistogram::FactoryGet( |
| 2252 "Cookie.DeletionCause", 1, DELETE_COOKIE_LAST_ENTRY - 1, | 2243 "Cookie.DeletionCause", 1, DELETE_COOKIE_LAST_ENTRY - 1, |
| 2253 DELETE_COOKIE_LAST_ENTRY, base::Histogram::kUmaTargetedHistogramFlag); | 2244 DELETE_COOKIE_LAST_ENTRY, base::Histogram::kUmaTargetedHistogramFlag); |
| 2254 histogram_cookie_type_ = base::LinearHistogram::FactoryGet( | 2245 histogram_cookie_type_ = base::LinearHistogram::FactoryGet( |
| 2255 "Cookie.Type", 1, (1 << COOKIE_TYPE_LAST_ENTRY) - 1, | 2246 "Cookie.Type", 1, (1 << COOKIE_TYPE_LAST_ENTRY) - 1, |
| 2256 1 << COOKIE_TYPE_LAST_ENTRY, base::Histogram::kUmaTargetedHistogramFlag); | 2247 1 << COOKIE_TYPE_LAST_ENTRY, base::Histogram::kUmaTargetedHistogramFlag); |
| 2257 histogram_cookie_source_scheme_ = base::LinearHistogram::FactoryGet( | 2248 histogram_cookie_source_scheme_ = base::LinearHistogram::FactoryGet( |
| 2258 "Cookie.CookieSourceScheme", 1, COOKIE_SOURCE_LAST_ENTRY - 1, | 2249 "Cookie.CookieSourceScheme2", 1, COOKIE_SOURCE_LAST_ENTRY - 1, |
|
mmenke
2017/05/25 20:04:29
Need to update histograms.xml
Randy Smith (Not in Mondays)
2017/06/09 11:19:32
Huh. Coudla sworn I did. I wonder where I droppe
| |
| 2259 COOKIE_SOURCE_LAST_ENTRY, base::Histogram::kUmaTargetedHistogramFlag); | 2250 COOKIE_SOURCE_LAST_ENTRY, base::Histogram::kUmaTargetedHistogramFlag); |
| 2260 histogram_cookie_delete_equivalent_ = base::LinearHistogram::FactoryGet( | 2251 histogram_cookie_delete_equivalent_ = base::LinearHistogram::FactoryGet( |
| 2261 "Cookie.CookieDeleteEquivalent", 1, | 2252 "Cookie.CookieDeleteEquivalent", 1, |
| 2262 COOKIE_DELETE_EQUIVALENT_LAST_ENTRY - 1, | 2253 COOKIE_DELETE_EQUIVALENT_LAST_ENTRY - 1, |
| 2263 COOKIE_DELETE_EQUIVALENT_LAST_ENTRY, | 2254 COOKIE_DELETE_EQUIVALENT_LAST_ENTRY, |
| 2264 base::Histogram::kUmaTargetedHistogramFlag); | 2255 base::Histogram::kUmaTargetedHistogramFlag); |
| 2265 | 2256 |
| 2266 // From UMA_HISTOGRAM_{CUSTOM_,}TIMES | 2257 // From UMA_HISTOGRAM_{CUSTOM_,}TIMES |
| 2267 histogram_time_blocked_on_load_ = base::Histogram::FactoryTimeGet( | 2258 histogram_time_blocked_on_load_ = base::Histogram::FactoryTimeGet( |
| 2268 "Cookie.TimeBlockedOnLoad", base::TimeDelta::FromMilliseconds(1), | 2259 "Cookie.TimeBlockedOnLoad", base::TimeDelta::FromMilliseconds(1), |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2392 it != hook_map_.end(); ++it) { | 2383 it != hook_map_.end(); ++it) { |
| 2393 std::pair<GURL, std::string> key = it->first; | 2384 std::pair<GURL, std::string> key = it->first; |
| 2394 if (cookie.IncludeForRequestURL(key.first, opts) && | 2385 if (cookie.IncludeForRequestURL(key.first, opts) && |
| 2395 cookie.Name() == key.second) { | 2386 cookie.Name() == key.second) { |
| 2396 it->second->Notify(cookie, cause); | 2387 it->second->Notify(cookie, cause); |
| 2397 } | 2388 } |
| 2398 } | 2389 } |
| 2399 } | 2390 } |
| 2400 | 2391 |
| 2401 } // namespace net | 2392 } // namespace net |
| OLD | NEW |