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

Unified Diff: android_webview/browser/cookie_manager.cc

Issue 2863233002: [WebView] Move files from native to browser (Closed)
Patch Set: Created 3 years, 7 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/cookie_manager.cc
diff --git a/android_webview/native/cookie_manager.cc b/android_webview/browser/cookie_manager.cc
similarity index 92%
rename from android_webview/native/cookie_manager.cc
rename to android_webview/browser/cookie_manager.cc
index 33c24db65f945453c355c109dd80ee2a80e3704a..1b283e9bac6ca6eed8823c0a2d4ee30c8bfcadf9 100644
--- a/android_webview/native/cookie_manager.cc
+++ b/android_webview/browser/cookie_manager.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "android_webview/native/cookie_manager.h"
+#include "android_webview/browser/cookie_manager.h"
#include <memory>
#include <utility>
@@ -252,8 +252,7 @@ CookieManager::CookieManager()
cookie_store_task_runner_ = cookie_store_client_thread_.task_runner();
}
-CookieManager::~CookieManager() {
-}
+CookieManager::~CookieManager() {}
// Executes the |task| on |cookie_store_task_runner_| and waits for it to
// complete before returning.
@@ -366,24 +365,19 @@ void CookieManager::SetCookie(
BoolCallback callback =
BoolCookieCallbackHolder::ConvertToCallback(std::move(callback_holder));
ExecCookieTask(base::Bind(&CookieManager::SetCookieHelper,
- base::Unretained(this),
- host,
- cookie_value,
+ base::Unretained(this), host, cookie_value,
callback));
}
void CookieManager::SetCookieSync(const GURL& host,
- const std::string& cookie_value) {
+ const std::string& cookie_value) {
ExecCookieTaskSync(base::Bind(&CookieManager::SetCookieHelper,
- base::Unretained(this),
- host,
- cookie_value));
+ base::Unretained(this), host, cookie_value));
}
-void CookieManager::SetCookieHelper(
- const GURL& host,
- const std::string& value,
- const BoolCallback callback) {
+void CookieManager::SetCookieHelper(const GURL& host,
+ const std::string& value,
+ const BoolCallback callback) {
net::CookieOptions options;
options.set_include_httponly();
@@ -411,22 +405,20 @@ void CookieManager::SetCookieHelper(
std::string CookieManager::GetCookie(const GURL& host) {
std::string cookie_value;
ExecCookieTaskSync(base::Bind(&CookieManager::GetCookieValueAsyncHelper,
- base::Unretained(this),
- host,
- &cookie_value));
+ base::Unretained(this), host, &cookie_value));
return cookie_value;
}
-void CookieManager::GetCookieValueAsyncHelper(
- const GURL& host,
- std::string* result,
- base::Closure complete) {
+void CookieManager::GetCookieValueAsyncHelper(const GURL& host,
+ std::string* result,
+ base::Closure complete) {
net::CookieOptions options;
options.set_include_httponly();
GetCookieStore()->GetCookiesWithOptionsAsync(
- host, options, base::Bind(&CookieManager::GetCookieValueCompleted,
- base::Unretained(this), complete, result));
+ host, options,
+ base::Bind(&CookieManager::GetCookieValueCompleted,
+ base::Unretained(this), complete, result));
}
void CookieManager::GetCookieValueCompleted(base::Closure complete,
@@ -441,25 +433,22 @@ void CookieManager::RemoveSessionCookies(
BoolCallback callback =
BoolCookieCallbackHolder::ConvertToCallback(std::move(callback_holder));
ExecCookieTask(base::Bind(&CookieManager::RemoveSessionCookiesHelper,
- base::Unretained(this),
- callback));
+ base::Unretained(this), callback));
}
void CookieManager::RemoveSessionCookiesSync() {
ExecCookieTaskSync(base::Bind(&CookieManager::RemoveSessionCookiesHelper,
- base::Unretained(this)));
+ base::Unretained(this)));
}
-void CookieManager::RemoveSessionCookiesHelper(
- BoolCallback callback) {
+void CookieManager::RemoveSessionCookiesHelper(BoolCallback callback) {
GetCookieStore()->DeleteSessionCookiesAsync(
base::Bind(&CookieManager::RemoveCookiesCompleted, base::Unretained(this),
callback));
}
-void CookieManager::RemoveCookiesCompleted(
- BoolCallback callback,
- int num_deleted) {
+void CookieManager::RemoveCookiesCompleted(BoolCallback callback,
+ int num_deleted) {
callback.Run(num_deleted > 0);
}
@@ -468,17 +457,15 @@ void CookieManager::RemoveAllCookies(
BoolCallback callback =
BoolCookieCallbackHolder::ConvertToCallback(std::move(callback_holder));
ExecCookieTask(base::Bind(&CookieManager::RemoveAllCookiesHelper,
- base::Unretained(this),
- callback));
+ base::Unretained(this), callback));
}
void CookieManager::RemoveAllCookiesSync() {
ExecCookieTaskSync(base::Bind(&CookieManager::RemoveAllCookiesHelper,
- base::Unretained(this)));
+ base::Unretained(this)));
}
-void CookieManager::RemoveAllCookiesHelper(
- const BoolCallback callback) {
+void CookieManager::RemoveAllCookiesHelper(const BoolCallback callback) {
GetCookieStore()->DeleteAllAsync(
base::Bind(&CookieManager::RemoveCookiesCompleted, base::Unretained(this),
callback));
@@ -491,19 +478,17 @@ void CookieManager::RemoveExpiredCookies() {
void CookieManager::FlushCookieStore() {
ExecCookieTaskSync(base::Bind(&CookieManager::FlushCookieStoreAsyncHelper,
- base::Unretained(this)));
+ base::Unretained(this)));
}
-void CookieManager::FlushCookieStoreAsyncHelper(
- base::Closure complete) {
+void CookieManager::FlushCookieStoreAsyncHelper(base::Closure complete) {
GetCookieStore()->FlushStore(complete);
}
bool CookieManager::HasCookies() {
bool has_cookies;
ExecCookieTaskSync(base::Bind(&CookieManager::HasCookiesAsyncHelper,
- base::Unretained(this),
- &has_cookies));
+ base::Unretained(this), &has_cookies));
return has_cookies;
}
@@ -588,7 +573,7 @@ static void RemoveSessionCookies(JNIEnv* env,
static void RemoveSessionCookiesSync(JNIEnv* env,
const JavaParamRef<jobject>& obj) {
- CookieManager::GetInstance()->RemoveSessionCookiesSync();
+ CookieManager::GetInstance()->RemoveSessionCookiesSync();
}
static void RemoveAllCookies(JNIEnv* env,

Powered by Google App Engine
This is Rietveld 408576698