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

Unified Diff: android_webview/native/cookie_manager.cc

Issue 12387028: Fix for CookieManager init race condition (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added a comment Created 7 years, 10 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
« no previous file with comments | « android_webview/native/cookie_manager.h ('k') | android_webview/native/net_init_native_callback.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/native/cookie_manager.cc
diff --git a/android_webview/native/cookie_manager.cc b/android_webview/native/cookie_manager.cc
index 33142ec4da4587816bc4c83fd0a17a517a6d3c1c..08ebfe306e063204492eb89f654873e1047a2ce0 100644
--- a/android_webview/native/cookie_manager.cc
+++ b/android_webview/native/cookie_manager.cc
@@ -21,7 +21,6 @@
#include "jni/AwCookieManager_jni.h"
#include "net/cookies/cookie_monster.h"
#include "net/cookies/cookie_options.h"
-#include "net/cookies/cookie_store.h"
#include "net/url_request/url_request_context.h"
using base::android::ConvertJavaStringToUTF8;
@@ -48,7 +47,7 @@ class CookieManager {
public:
static CookieManager* GetInstance();
- void SetCookieMonster(net::URLRequestContext* request_context);
+ void SetCookieMonster(net::CookieMonster* cookie_monster);
void SetAcceptCookie(bool accept);
bool AcceptCookie();
@@ -134,9 +133,9 @@ void CookieManager::ExecCookieTask(const CookieTask& task,
}
}
-void CookieManager::SetCookieMonster(net::URLRequestContext* request_context) {
+void CookieManager::SetCookieMonster(net::CookieMonster* cookie_monster) {
DCHECK(!cookie_monster_);
- cookie_monster_ = request_context->cookie_store()->GetCookieMonster();
+ cookie_monster_ = cookie_monster;
}
void CookieManager::SetAcceptCookie(bool accept) {
@@ -348,8 +347,8 @@ static void SetAcceptFileSchemeCookies(JNIEnv* env, jobject obj,
return CookieManager::GetInstance()->SetAcceptFileSchemeCookies(accept);
}
-void SetCookieMonsterOnNetworkStackInit(net::URLRequestContext* context) {
- CookieManager::GetInstance()->SetCookieMonster(context);
+void SetCookieMonsterOnNetworkStackInit(net::CookieMonster* cookie_monster) {
+ CookieManager::GetInstance()->SetCookieMonster(cookie_monster);
}
bool RegisterCookieManager(JNIEnv* env) {
« no previous file with comments | « android_webview/native/cookie_manager.h ('k') | android_webview/native/net_init_native_callback.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698