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

Unified Diff: ios/net/cookies/cookie_store_ios.h

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 side-by-side diff with in-line comments
Download patch
Index: ios/net/cookies/cookie_store_ios.h
diff --git a/ios/net/cookies/cookie_store_ios.h b/ios/net/cookies/cookie_store_ios.h
index 68ac20f377fbd7fee82e51742c446424551ce88b..04a37f1913c7235d00a028e56dec823a9f580133 100644
--- a/ios/net/cookies/cookie_store_ios.h
+++ b/ios/net/cookies/cookie_store_ios.h
@@ -75,7 +75,7 @@ class CookieStoreIOS : public net::CookieStore,
void SetCookieWithOptionsAsync(const GURL& url,
const std::string& cookie_line,
const net::CookieOptions& options,
- const SetCookiesCallback& callback) override;
+ SetCookiesCallback callback) override;
void SetCookieWithDetailsAsync(const GURL& url,
const std::string& name,
const std::string& value,
@@ -88,35 +88,33 @@ class CookieStoreIOS : public net::CookieStore,
bool http_only,
CookieSameSite same_site,
CookiePriority priority,
- const SetCookiesCallback& callback) override;
+ SetCookiesCallback callback) override;
void SetCanonicalCookieAsync(std::unique_ptr<CanonicalCookie> cookie,
bool secure_source,
bool modify_http_only,
- const SetCookiesCallback& callback) override;
+ SetCookiesCallback callback) override;
void GetCookiesWithOptionsAsync(const GURL& url,
const net::CookieOptions& options,
- const GetCookiesCallback& callback) override;
- void GetCookieListWithOptionsAsync(
- const GURL& url,
- const net::CookieOptions& options,
- const GetCookieListCallback& callback) override;
- void GetAllCookiesAsync(const GetCookieListCallback& callback) override;
+ GetCookiesCallback callback) override;
+ void GetCookieListWithOptionsAsync(const GURL& url,
+ const net::CookieOptions& options,
+ GetCookieListCallback callback) override;
+ void GetAllCookiesAsync(GetCookieListCallback callback) override;
void DeleteCookieAsync(const GURL& url,
const std::string& cookie_name,
- const base::Closure& callback) override;
- void DeleteCanonicalCookieAsync(
- const CanonicalCookie& cookie,
- const DeleteCallback& callback) override;
+ base::OnceClosure callback) override;
+ void DeleteCanonicalCookieAsync(const CanonicalCookie& cookie,
+ DeleteCallback callback) override;
void DeleteAllCreatedBetweenAsync(const base::Time& delete_begin,
const base::Time& delete_end,
- const DeleteCallback& callback) override;
+ DeleteCallback callback) override;
void DeleteAllCreatedBetweenWithPredicateAsync(
const base::Time& delete_begin,
const base::Time& delete_end,
const CookiePredicate& predicate,
- const DeleteCallback& callback) override;
- void DeleteSessionCookiesAsync(const DeleteCallback& callback) override;
- void FlushStore(const base::Closure& callback) override;
+ DeleteCallback callback) override;
+ void DeleteSessionCookiesAsync(DeleteCallback callback) override;
+ void FlushStore(base::OnceClosure callback) override;
std::unique_ptr<CookieChangedSubscription> AddCallbackForCookie(
const GURL& url,
@@ -134,9 +132,9 @@ class CookieStoreIOS : public net::CookieStore,
// callback that invokes UpdateCachesFromCookieMonster() to schedule an
// asynchronous synchronization of the cookie cache and then calls the
// original callback.
- SetCookiesCallback WrapSetCallback(const SetCookiesCallback& callback);
- DeleteCallback WrapDeleteCallback(const DeleteCallback& callback);
- base::Closure WrapClosure(const base::Closure& callback);
+ SetCookiesCallback WrapSetCallback(SetCookiesCallback callback);
+ DeleteCallback WrapDeleteCallback(DeleteCallback callback);
+ base::OnceClosure WrapClosure(base::OnceClosure callback);
bool metrics_enabled() { return metrics_enabled_; }
@@ -162,7 +160,7 @@ class CookieStoreIOS : public net::CookieStore,
void OnSystemCookiesChanged() override;
void DeleteCookiesWithFilter(const CookieFilterFunction& filter,
- const DeleteCallback& callback);
+ DeleteCallback callback);
std::unique_ptr<net::CookieMonster> cookie_monster_;
base::scoped_nsobject<NSHTTPCookieStorage> system_store_;
@@ -225,7 +223,7 @@ class CookieStoreIOS : public net::CookieStore,
// cookies are deleted (with the total number of cookies deleted).
// |num_deleted| contains the number of cookies deleted from
// NSHTTPCookieStorage.
- void DidClearNSHTTPCookieStorageCookies(const DeleteCallback& callback,
+ void DidClearNSHTTPCookieStorageCookies(DeleteCallback callback,
int num_deleted);
// Called after cookies are cleared from .binarycookies files. |callback| is
// called after all the cookies are deleted with the total number of cookies
@@ -233,7 +231,7 @@ class CookieStoreIOS : public net::CookieStore,
// |num_deleted_from_nshttp_cookie_storage| contains the number of cookies
// deleted from NSHTTPCookieStorage.
void DidClearBinaryCookiesFileCookies(
- const DeleteCallback& callback,
+ DeleteCallback callback,
int num_deleted_from_nshttp_cookie_storage);
// Callback-wrapping:
@@ -254,9 +252,9 @@ class CookieStoreIOS : public net::CookieStore,
// asynchronous cache update (using UpdateCachesFromCookieMonster()) and
// calling the provided callback.
- void UpdateCachesAfterSet(const SetCookiesCallback& callback, bool success);
- void UpdateCachesAfterDelete(const DeleteCallback& callback, int num_deleted);
- void UpdateCachesAfterClosure(const base::Closure& callback);
+ void UpdateCachesAfterSet(SetCookiesCallback callback, bool success);
+ void UpdateCachesAfterDelete(DeleteCallback callback, int num_deleted);
+ void UpdateCachesAfterClosure(base::OnceClosure callback);
// Takes an NSArray of NSHTTPCookies as returns a net::CookieList.
// The returned cookies are ordered by longest path, then earliest

Powered by Google App Engine
This is Rietveld 408576698