In b/
3044989, AutoFill was modified to take a factory function for the
URLRequestContext (which was then created when needed), rather than
taking the context directly. This was to avoid a race condition where
the context is created before the required storage paths have been
synced to the WebCore thread through the BrowserFrame.
Since https://android-git.corp.google.com/g/76579 and
https://android-git.corp.google.com/g/80056, we read the required
paths directly from JniUtils, so the race condition no longer exists. We
can therefore provide the context directly to AutoFill.
Note that while the context may be created before the Settings have been
synced to the WebCore thread, the necessary properties will be updated
as part of this sync before the context is used.
This change will also simplify things when we use one context per
WebView.
Also requires a change in external/chromium ...
https://android-git.corp.google.com/g/82146
Change-Id: Idfc34d435bae21654a02e5898aef0e84da98218a
namespace android
{
-static URLRequestContext* webAutoFillContextGetter()
-{
- return WebRequestContext::get(false /* isPrivateBrowsing */);
-}
-
WebAutoFill::WebAutoFill()
: mWebViewCore(0)
{
mFormManager = new FormManager();
mQueryId = 1;
- AndroidURLRequestContextGetter::Get()->SetURLRequestContextGetterFunction(&webAutoFillContextGetter);
+ AndroidURLRequestContextGetter::Get()->SetURLRequestContext(WebRequestContext::get(false /* isPrivateBrowsing */));
AndroidURLRequestContextGetter::Get()->SetIOThread(WebUrlLoaderClient::ioThread());
mTabContents = new TabContents();
mAutoFillManager = new AutoFillManager(mTabContents.get());