diff options
Diffstat (limited to 'android_webview/browser/net')
3 files changed, 27 insertions, 32 deletions
diff --git a/android_webview/browser/net/aw_url_request_context_getter.cc b/android_webview/browser/net/aw_url_request_context_getter.cc index 40d14b3..8fbe53c 100644 --- a/android_webview/browser/net/aw_url_request_context_getter.cc +++ b/android_webview/browser/net/aw_url_request_context_getter.cc @@ -8,7 +8,7 @@ #include "android_webview/browser/aw_request_interceptor.h" #include "android_webview/browser/net/aw_network_delegate.h" #include "android_webview/browser/net/aw_url_request_job_factory.h" -#include "android_webview/browser/net/register_android_protocols.h" +#include "android_webview/browser/net/init_native_callback.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/content_browser_client.h" #include "content/public/browser/resource_context.h" @@ -110,9 +110,11 @@ void AwURLRequestContextGetter::Init() { set_protocol = job_factory_->SetProtocolHandler( chrome::kDataScheme, new net::DataProtocolHandler()); DCHECK(set_protocol); - RegisterAndroidProtocolsOnIOThread(job_factory_.get()); job_factory_->AddInterceptor(new AwRequestInterceptor()); url_request_context_->set_job_factory(job_factory_.get()); + + OnNetworkStackInitialized(url_request_context_.get(), + job_factory_.get()); } content::ResourceContext* AwURLRequestContextGetter::GetResourceContext() { diff --git a/android_webview/browser/net/init_native_callback.h b/android_webview/browser/net/init_native_callback.h new file mode 100644 index 0000000..10588a1 --- /dev/null +++ b/android_webview/browser/net/init_native_callback.h @@ -0,0 +1,23 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef ANDROID_WEBVIEW_BROWSER_NET_INIT_NATIVE_CALLBACK_H_ +#define ANDROID_WEBVIEW_BROWSER_NET_INIT_NATIVE_CALLBACK_H_ + +namespace net { +class URLRequestContext; +class URLRequestJobFactory; +} // namespace net + +namespace android_webview { + +// This is called on the IO thread when the network URLRequestContext has been +// initialized but not used. Note that the UI thread is blocked during this +// call. +void OnNetworkStackInitialized(net::URLRequestContext* context, + net::URLRequestJobFactory* job_factory); + +} // namespace android_webview + +#endif // ANDROID_WEBVIEW_BROWSER_NET_INIT_NATIVE_CALLBACK_H_ diff --git a/android_webview/browser/net/register_android_protocols.h b/android_webview/browser/net/register_android_protocols.h deleted file mode 100644 index 1aa29f7..0000000 --- a/android_webview/browser/net/register_android_protocols.h +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef ANDROID_WEBVIEW_BROWSER_NET_ANDROID_PROTOCOL_HANDLER_H_ -#define ANDROID_WEBVIEW_BROWSER_NET_ANDROID_PROTOCOL_HANDLER_H_ - -namespace net { -class URLRequestJobFactory; -} // namespace net - -namespace android_webview { - -// This class adds support for Android WebView-specific protocol schemes: -// -// - "content:" scheme is used for accessing data from Android content -// providers, see http://developer.android.com/guide/topics/providers/ -// content-provider-basics.html#ContentURIs -// -// - "file:" scheme extension for accessing application assets and resources -// (file:///android_asset/ and file:///android_res/), see -// http://developer.android.com/reference/android/webkit/ -// WebSettings.html#setAllowFileAccess(boolean) -// -void RegisterAndroidProtocolsOnIOThread( - net::URLRequestJobFactory* job_factory); - -} // namespace android_webview - -#endif // ANDROID_WEBVIEW_BROWSER_NET_ANDROID_PROTOCOL_HANDLER_H_ |