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 1872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1883 // InternalDeleteCookies must not invalidate iterators other than the one being | 1883 // InternalDeleteCookies must not invalidate iterators other than the one being |
1884 // deleted. | 1884 // deleted. |
1885 void CookieMonster::InternalDeleteCookie(CookieMap::iterator it, | 1885 void CookieMonster::InternalDeleteCookie(CookieMap::iterator it, |
1886 bool sync_to_store, | 1886 bool sync_to_store, |
1887 DeletionCause deletion_cause) { | 1887 DeletionCause deletion_cause) { |
1888 lock_.AssertAcquired(); | 1888 lock_.AssertAcquired(); |
1889 | 1889 |
1890 // Ideally, this would be asserted up where we define ChangeCauseMapping, | 1890 // Ideally, this would be asserted up where we define ChangeCauseMapping, |
1891 // but DeletionCause's visibility (or lack thereof) forces us to make | 1891 // but DeletionCause's visibility (or lack thereof) forces us to make |
1892 // this check here. | 1892 // this check here. |
1893 COMPILE_ASSERT(arraysize(ChangeCauseMapping) == DELETE_COOKIE_LAST_ENTRY + 1, | 1893 static_assert(arraysize(ChangeCauseMapping) == DELETE_COOKIE_LAST_ENTRY + 1, |
1894 ChangeCauseMapping_size_not_eq_DeletionCause_enum_size); | 1894 "ChangeCauseMapping size should match DeletionCause size"); |
1895 | 1895 |
1896 // See InitializeHistograms() for details. | 1896 // See InitializeHistograms() for details. |
1897 if (deletion_cause != DELETE_COOKIE_DONT_RECORD) | 1897 if (deletion_cause != DELETE_COOKIE_DONT_RECORD) |
1898 histogram_cookie_deletion_cause_->Add(deletion_cause); | 1898 histogram_cookie_deletion_cause_->Add(deletion_cause); |
1899 | 1899 |
1900 CanonicalCookie* cc = it->second; | 1900 CanonicalCookie* cc = it->second; |
1901 VLOG(kVlogSetCookies) << "InternalDeleteCookie() cc: " << cc->DebugString(); | 1901 VLOG(kVlogSetCookies) << "InternalDeleteCookie() cc: " << cc->DebugString(); |
1902 | 1902 |
1903 if ((cc->IsPersistent() || persist_session_cookies_) && store_.get() && | 1903 if ((cc->IsPersistent() || persist_session_cookies_) && store_.get() && |
1904 sync_to_store) | 1904 sync_to_store) |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2341 it != hook_map_.end(); ++it) { | 2341 it != hook_map_.end(); ++it) { |
2342 std::pair<GURL, std::string> key = it->first; | 2342 std::pair<GURL, std::string> key = it->first; |
2343 if (cookie.IncludeForRequestURL(key.first, opts) && | 2343 if (cookie.IncludeForRequestURL(key.first, opts) && |
2344 cookie.Name() == key.second) { | 2344 cookie.Name() == key.second) { |
2345 it->second->Notify(cookie, removed); | 2345 it->second->Notify(cookie, removed); |
2346 } | 2346 } |
2347 } | 2347 } |
2348 } | 2348 } |
2349 | 2349 |
2350 } // namespace net | 2350 } // namespace net |
OLD | NEW |