Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(331)

Side by Side Diff: content/browser/net/quota_policy_cookie_store.cc

Issue 2937963003: Shift cookie system callbacks to OnceCallback to impedance match mojo. (Closed)
Patch Set: Finish Merge Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include "content/browser/net/quota_policy_cookie_store.h" 5 #include "content/browser/net/quota_policy_cookie_store.h"
6 6
7 #include <list> 7 #include <list>
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 cc.Domain(), cc.IsSecure()); 86 cc.Domain(), cc.IsSecure());
87 DCHECK_GE(cookies_per_origin_[origin], 1U); 87 DCHECK_GE(cookies_per_origin_[origin], 1U);
88 --cookies_per_origin_[origin]; 88 --cookies_per_origin_[origin];
89 persistent_store_->DeleteCookie(cc); 89 persistent_store_->DeleteCookie(cc);
90 } 90 }
91 91
92 void QuotaPolicyCookieStore::SetForceKeepSessionState() { 92 void QuotaPolicyCookieStore::SetForceKeepSessionState() {
93 special_storage_policy_ = nullptr; 93 special_storage_policy_ = nullptr;
94 } 94 }
95 95
96 void QuotaPolicyCookieStore::Flush(const base::Closure& callback) { 96 void QuotaPolicyCookieStore::Flush(base::OnceClosure callback) {
97 persistent_store_->Flush(callback); 97 persistent_store_->Flush(std::move(callback));
98 } 98 }
99 99
100 void QuotaPolicyCookieStore::OnLoad( 100 void QuotaPolicyCookieStore::OnLoad(
101 const LoadedCallback& loaded_callback, 101 const LoadedCallback& loaded_callback,
102 std::vector<std::unique_ptr<net::CanonicalCookie>> cookies) { 102 std::vector<std::unique_ptr<net::CanonicalCookie>> cookies) {
103 for (const auto& cookie : cookies) { 103 for (const auto& cookie : cookies) {
104 net::SQLitePersistentCookieStore::CookieOrigin origin( 104 net::SQLitePersistentCookieStore::CookieOrigin origin(
105 cookie->Domain(), cookie->IsSecure()); 105 cookie->Domain(), cookie->IsSecure());
106 ++cookies_per_origin_[origin]; 106 ++cookies_per_origin_[origin];
107 } 107 }
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 } 187 }
188 } 188 }
189 189
190 if (!config.cookieable_schemes.empty()) 190 if (!config.cookieable_schemes.empty())
191 cookie_monster->SetCookieableSchemes(config.cookieable_schemes); 191 cookie_monster->SetCookieableSchemes(config.cookieable_schemes);
192 192
193 return std::move(cookie_monster); 193 return std::move(cookie_monster);
194 } 194 }
195 195
196 } // namespace content 196 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698