Index: android_webview/browser/net/aw_cookie_store_wrapper.cc |
diff --git a/android_webview/browser/net/aw_cookie_store_wrapper.cc b/android_webview/browser/net/aw_cookie_store_wrapper.cc |
index 70f7b4c031793bb3b56e796d94ce032516bbb3e5..17423fda03343e34f646c1030f9d11a45da220ac 100644 |
--- a/android_webview/browser/net/aw_cookie_store_wrapper.cc |
+++ b/android_webview/browser/net/aw_cookie_store_wrapper.cc |
@@ -16,8 +16,8 @@ namespace android_webview { |
namespace { |
// Posts |task| to the thread that the global CookieStore lives on. |
-void PostTaskToCookieStoreTaskRunner(const base::Closure& task) { |
- GetCookieStoreTaskRunner()->PostTask(FROM_HERE, task); |
+void PostTaskToCookieStoreTaskRunner(base::OnceClosure task) { |
+ GetCookieStoreTaskRunner()->PostTask(FROM_HERE, std::move(task)); |
} |
// Wraps a subscription to cookie change notifications for the global |
@@ -128,6 +128,15 @@ void SetCookieWithDetailsAsyncOnCookieThread( |
last_access_time, secure, http_only, same_site, priority, callback); |
} |
+void SetCanonicalCookieAsyncOnCookieThread( |
+ std::unique_ptr<net::CanonicalCookie> cookie, |
+ bool secure_source, |
+ bool modify_http_only, |
+ const net::CookieStore::SetCookiesCallback& callback) { |
+ GetCookieStore()->SetCanonicalCookieAsync(std::move(cookie), secure_source, |
+ modify_http_only, callback); |
+} |
+ |
void GetCookiesWithOptionsAsyncOnCookieThread( |
const GURL& url, |
const net::CookieOptions& options, |
@@ -230,6 +239,17 @@ void AwCookieStoreWrapper::SetCookieWithDetailsAsync( |
CreateWrappedCallback<bool>(callback))); |
} |
+void AwCookieStoreWrapper::SetCanonicalCookieAsync( |
+ std::unique_ptr<net::CanonicalCookie> cookie, |
+ bool secure_source, |
+ bool modify_http_only, |
+ const SetCookiesCallback& callback) { |
+ DCHECK(client_task_runner_->RunsTasksOnCurrentThread()); |
+ PostTaskToCookieStoreTaskRunner(base::BindOnce( |
+ &SetCanonicalCookieAsyncOnCookieThread, std::move(cookie), secure_source, |
+ modify_http_only, CreateWrappedCallback<bool>(callback))); |
+} |
+ |
void AwCookieStoreWrapper::GetCookiesWithOptionsAsync( |
const GURL& url, |
const net::CookieOptions& options, |