summaryrefslogtreecommitdiffstats
path: root/android_webview/browser/net/init_native_callback.h
diff options
context:
space:
mode:
authormmenke <mmenke@chromium.org>2016-02-25 09:14:46 -0800
committerCommit bot <commit-bot@chromium.org>2016-02-25 17:16:31 +0000
commita7b331e94c7b658c55cb3ce93b712b9d671d2e07 (patch)
tree4663f805ac4dc6a4e3e3a002bbc547f1f1618f98 /android_webview/browser/net/init_native_callback.h
parent74ab35b50436685c3bc241f22e9d62af23bc7320 (diff)
downloadchromium_src-a7b331e94c7b658c55cb3ce93b712b9d671d2e07.zip
chromium_src-a7b331e94c7b658c55cb3ce93b712b9d671d2e07.tar.gz
chromium_src-a7b331e94c7b658c55cb3ce93b712b9d671d2e07.tar.bz2
Add a cross-thread wrapper around Android Webview's CookieStore.
Android Webview needs to be able to call into its CookieStore on a thread other than the IOThread. Since we're trying to make the CookieStore non-threadsafe, that means we need a CookieStore wrapper to be used by the network stack to access the real CookieStore on another thread. This CL also modifies CookieManager to lazily create the CookieStore on the correct thread. This both allows us to get rid of the last GetCookieMonster call, and will make making the CookieStore non-thread-safe easier. BUG=579653, 579260 Review URL: https://codereview.chromium.org/1693903002 Cr-Commit-Position: refs/heads/master@{#377596}
Diffstat (limited to 'android_webview/browser/net/init_native_callback.h')
-rw-r--r--android_webview/browser/net/init_native_callback.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/android_webview/browser/net/init_native_callback.h b/android_webview/browser/net/init_native_callback.h
index d98867c..34a65c6 100644
--- a/android_webview/browser/net/init_native_callback.h
+++ b/android_webview/browser/net/init_native_callback.h
@@ -8,6 +8,10 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
+namespace base {
+class SingleThreadTaskRunner;
+}
+
namespace net {
class CookieStore;
class URLRequestInterceptor;
@@ -16,9 +20,13 @@ class URLRequestInterceptor;
namespace android_webview {
class AwBrowserContext;
-// Called when the CookieMonster needs to be created.
-scoped_refptr<net::CookieStore> CreateCookieStore(
- AwBrowserContext* browser_context);
+// Gets the TaskRunner that the CookieStore must be called on.
+scoped_refptr<base::SingleThreadTaskRunner> GetCookieStoreTaskRunner();
+
+// Gets a pointer to the CookieStore managed by the CookieManager.
+// The CookieStore is never deleted. May only be called on the
+// CookieStore's TaskRunner.
+net::CookieStore* GetCookieStore();
// Called lazily when the job factory is being constructed.
scoped_ptr<net::URLRequestInterceptor>