Android WebView: Allow CookieManager to be used without starting Chromium.
commit23dc0bb182304117b131d5777601140d32aad961
authortorne@chromium.org <torne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Tue, 26 Nov 2013 15:12:48 +0000 (26 15:12 +0000)
committertorne@chromium.org <torne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Tue, 26 Nov 2013 15:12:48 +0000 (26 15:12 +0000)
tree7d4c06cceffe4f1657b6dea24156eb6180543e58
parent8f9f0bffcea02d0889cf4cacce170fcc2450cb71
Android WebView: Allow CookieManager to be used without starting Chromium.

Refactor the CookieManager to allow it to be used without starting
Chromium. If Chromium has not been started when the cookie manager is
first used, a cookie monster will be created and used to service
requests (with its own client/backend threads). If the app subsequently
triggers regular Chromium startup (e.g. by creating a WebView) then this
existing cookie manager will be used instead of creating one on the
regular Chromium threads. CookieMonster is threadsafe, so this is safe
(it just uses two additional threads).

If apps don't touch CookieManager until after Chromium has been started
for some other reason, then CookieMonster will be created as normal on
the regular Chromium threads.

BUG=304813

Review URL: https://codereview.chromium.org/71583002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237338 0039d316-1c4b-4281-b951-d872f2087c98
android_webview/browser/aw_browser_context.cc
android_webview/browser/net/init_native_callback.h
android_webview/javatests/src/org/chromium/android_webview/test/CookieManagerStartupTest.java [new file with mode: 0644]
android_webview/native/cookie_manager.cc
android_webview/native/cookie_manager.h
android_webview/native/net_init_native_callback.cc