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

Unified Diff: android_webview/browser/net/aw_cookie_store_wrapper.cc

Issue 2882063002: Add a SetCanonicalCookie method for CookieMonster. (Closed)
Patch Set: Fix AW cookie store wrapper. 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: 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,
« no previous file with comments | « android_webview/browser/net/aw_cookie_store_wrapper.h ('k') | chrome/browser/extensions/api/cookies/cookies_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698