From 5e3a2a384c4607e2e9f6fe7b49a5c1faa670f3d8 Mon Sep 17 00:00:00 2001 From: Steve Block Date: Tue, 30 Nov 2010 11:32:14 +0000 Subject: Provide a URLRequestContext directly to AutoFill, rather than a factory function 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 --- WebKit/android/WebCoreSupport/autofill/WebAutoFill.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'WebKit/android/WebCoreSupport/autofill/WebAutoFill.cpp') diff --git a/WebKit/android/WebCoreSupport/autofill/WebAutoFill.cpp b/WebKit/android/WebCoreSupport/autofill/WebAutoFill.cpp index 8199aa0..98b250f 100644 --- a/WebKit/android/WebCoreSupport/autofill/WebAutoFill.cpp +++ b/WebKit/android/WebCoreSupport/autofill/WebAutoFill.cpp @@ -49,18 +49,13 @@ 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()); -- cgit v1.1