summaryrefslogtreecommitdiffstats
path: root/android_webview/browser
diff options
context:
space:
mode:
authorpauljensen@chromium.org <pauljensen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-20 17:04:23 +0000
committerpauljensen@chromium.org <pauljensen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-20 17:04:23 +0000
commitf53b48075849f4f7d7e13002176cb861c885ab52 (patch)
treecc3429420ba40da37ffc7adad0ad63ce65fc42d5 /android_webview/browser
parent4e4a42657994b3752962232ef8746d3f4ac70931 (diff)
downloadchromium_src-f53b48075849f4f7d7e13002176cb861c885ab52.zip
chromium_src-f53b48075849f4f7d7e13002176cb861c885ab52.tar.gz
chromium_src-f53b48075849f4f7d7e13002176cb861c885ab52.tar.bz2
Convert trivial URLRequest::Interceptors and URLRequestJobFactory::Interceptor into URLRequestJobFactory::ProtocolHandlers.
BUG=161524 Review URL: https://codereview.chromium.org/11293252 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@174174 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'android_webview/browser')
-rw-r--r--android_webview/browser/net/android_stream_reader_url_request_job_unittest.cc7
-rw-r--r--android_webview/browser/net/aw_url_request_context_getter.cc7
-rw-r--r--android_webview/browser/net/init_native_callback.h8
3 files changed, 13 insertions, 9 deletions
diff --git a/android_webview/browser/net/android_stream_reader_url_request_job_unittest.cc b/android_webview/browser/net/android_stream_reader_url_request_job_unittest.cc
index a5170da..e66a16e0 100644
--- a/android_webview/browser/net/android_stream_reader_url_request_job_unittest.cc
+++ b/android_webview/browser/net/android_stream_reader_url_request_job_unittest.cc
@@ -164,9 +164,10 @@ class AndroidStreamReaderURLRequestJobTest : public Test {
stream_reader_delegate.Pass(),
stream_reader.Pass());
// The Interceptor is owned by the |factory_|.
- TestJobInterceptor* interceptor = new TestJobInterceptor;
- interceptor->set_main_intercept_job(test_stream_reader_job);
- factory_.AddInterceptor(interceptor);
+ TestJobInterceptor* protocol_handler = new TestJobInterceptor;
+ protocol_handler->set_main_intercept_job(test_stream_reader_job);
+ bool set_protocol = factory_.SetProtocolHandler("http", protocol_handler);
+ DCHECK(set_protocol);
}
MessageLoop loop_;
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 b488b55..92b10e1 100644
--- a/android_webview/browser/net/aw_url_request_context_getter.cc
+++ b/android_webview/browser/net/aw_url_request_context_getter.cc
@@ -103,7 +103,6 @@ void AwURLRequestContextGetter::Init() {
chrome::kDataScheme, new net::DataProtocolHandler());
DCHECK(set_protocol);
job_factory->AddInterceptor(new AwRequestInterceptor());
- url_request_context_->set_job_factory(job_factory.get());
// TODO(mnaganov): Fix URLRequestContextBuilder to use proper threads.
net::HttpNetworkSession::Params network_session_params;
@@ -118,9 +117,9 @@ void AwURLRequestContextGetter::Init() {
main_http_factory_.reset(main_cache);
url_request_context_->set_http_transaction_factory(main_cache);
- OnNetworkStackInitialized(url_request_context_.get(),
- job_factory.get());
- job_factory_ = job_factory.Pass();
+ job_factory_ = CreateAndroidJobFactoryAndCookieMonster(
+ url_request_context_.get(), job_factory.Pass());
+ url_request_context_->set_job_factory(job_factory_.get());
}
void AwURLRequestContextGetter::PopulateNetworkSessionParams(
diff --git a/android_webview/browser/net/init_native_callback.h b/android_webview/browser/net/init_native_callback.h
index cf204e9..69855b6 100644
--- a/android_webview/browser/net/init_native_callback.h
+++ b/android_webview/browser/net/init_native_callback.h
@@ -5,8 +5,11 @@
#ifndef ANDROID_WEBVIEW_BROWSER_NET_INIT_NATIVE_CALLBACK_H_
#define ANDROID_WEBVIEW_BROWSER_NET_INIT_NATIVE_CALLBACK_H_
+#include "base/memory/scoped_ptr.h"
+
namespace net {
class URLRequestContext;
+class URLRequestJobFactory;
} // namespace net
namespace android_webview {
@@ -15,8 +18,9 @@ class AwURLRequestJobFactory;
// 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,
- AwURLRequestJobFactory* job_factory);
+scoped_ptr<net::URLRequestJobFactory> CreateAndroidJobFactoryAndCookieMonster(
+ net::URLRequestContext* context,
+ scoped_ptr<AwURLRequestJobFactory> job_factory);
} // namespace android_webview