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

Unified Diff: android_webview/native/cookie_manager.cc

Issue 2812703003: aw: Remove global AllowWait on UI thread (Closed)
Patch Set: future Created 3 years, 8 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/lib/main/aw_main_delegate.cc ('k') | base/threading/thread_restrictions.h » ('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 e5e666844b68e8fa482c9621bed7e93515e2298a..fc753367c6461aac1e3f6c8791c8f5c3217e818d 100644
--- a/android_webview/native/cookie_manager.cc
+++ b/android_webview/native/cookie_manager.cc
@@ -11,7 +11,6 @@
#include "android_webview/browser/aw_browser_context.h"
#include "android_webview/browser/aw_cookie_access_policy.h"
#include "android_webview/browser/net/init_native_callback.h"
-#include "android_webview/browser/scoped_allow_wait_for_legacy_web_view_api.h"
#include "base/android/jni_string.h"
#include "base/android/path_utils.h"
#include "base/bind.h"
@@ -148,6 +147,8 @@ void GetUserDataDir(FilePath* user_data_dir) {
}
}
+} // namespace
+
// CookieManager creates and owns Webview's CookieStore, in addition to handling
// calls into the CookieStore from Java.
//
@@ -232,9 +233,9 @@ class CookieManager {
DISALLOW_COPY_AND_ASSIGN(CookieManager);
};
+namespace {
base::LazyInstance<CookieManager>::Leaky g_lazy_instance;
-
-} // namespace
+}
// static
CookieManager* CookieManager::GetInstance() {
@@ -271,7 +272,7 @@ void CookieManager::ExecCookieTaskSync(
base::WaitableEvent::InitialState::NOT_SIGNALED);
ExecCookieTask(
base::Bind(task, BoolCallbackAdapter(SignalEventClosure(&completion))));
- ScopedAllowWaitForLegacyWebViewApi wait;
+ base::ThreadRestrictions::ScopedAllowWait wait;
completion.Wait();
}
@@ -282,7 +283,7 @@ void CookieManager::ExecCookieTaskSync(
base::WaitableEvent::InitialState::NOT_SIGNALED);
ExecCookieTask(
base::Bind(task, IntCallbackAdapter(SignalEventClosure(&completion))));
- ScopedAllowWaitForLegacyWebViewApi wait;
+ base::ThreadRestrictions::ScopedAllowWait wait;
completion.Wait();
}
@@ -293,7 +294,7 @@ void CookieManager::ExecCookieTaskSync(
WaitableEvent completion(base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED);
ExecCookieTask(base::Bind(task, SignalEventClosure(&completion)));
- ScopedAllowWaitForLegacyWebViewApi wait;
+ base::ThreadRestrictions::ScopedAllowWait wait;
completion.Wait();
}
« no previous file with comments | « android_webview/lib/main/aw_main_delegate.cc ('k') | base/threading/thread_restrictions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698