Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1965)

Unified Diff: android_webview/browser/net/aw_url_request_context_getter.cc

Issue 282103004: Rename ProtocolInterceptJobFactory and make it not use ProtocolHandlers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Response to jam's comments (And a merge) Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: android_webview/browser/net/aw_url_request_context_getter.cc
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 218f09a9c156e89ba5ada3241cba824d0274fa01..d456af2ef146493ce4272672741eccd37fda0f52 100644
--- a/android_webview/browser/net/aw_url_request_context_getter.cc
+++ b/android_webview/browser/net/aw_url_request_context_getter.cc
@@ -34,9 +34,10 @@
#include "net/socket/next_proto.h"
#include "net/url_request/data_protocol_handler.h"
#include "net/url_request/file_protocol_handler.h"
-#include "net/url_request/protocol_intercept_job_factory.h"
#include "net/url_request/url_request_context_builder.h"
#include "net/url_request/url_request_context.h"
+#include "net/url_request/url_request_intercepting_job_factory.h"
+#include "net/url_request/url_request_interceptor.h"
using content::BrowserThread;
using data_reduction_proxy::DataReductionProxySettings;
@@ -131,36 +132,36 @@ scoped_ptr<net::URLRequestJobFactory> CreateJobFactory(
protocol_handlers->clear();
// Create a chain of URLRequestJobFactories. The handlers will be invoked
- // in the order in which they appear in the protocol_handlers vector.
- typedef std::vector<net::URLRequestJobFactory::ProtocolHandler*>
- ProtocolHandlerVector;
- ProtocolHandlerVector protocol_interceptors;
+ // in the order in which they appear in the |request_interceptors| vector.
+ typedef std::vector<net::URLRequestInterceptor*>
+ URLRequestInterceptorVector;
+ URLRequestInterceptorVector request_interceptors;
// Note that even though the content:// scheme handler is created here,
// it cannot be used by child processes until access to it is granted via
// ChildProcessSecurityPolicy::GrantScheme(). This is done in
// AwContentBrowserClient.
- protocol_interceptors.push_back(
- CreateAndroidContentProtocolHandler().release());
- protocol_interceptors.push_back(
- CreateAndroidAssetFileProtocolHandler().release());
+ request_interceptors.push_back(
+ CreateAndroidContentRequestInterceptor().release());
+ request_interceptors.push_back(
+ CreateAndroidAssetFileRequestInterceptor().release());
// The AwRequestInterceptor must come after the content and asset file job
// factories. This for WebViewClassic compatibility where it was not
// possible to intercept resource loads to resolvable content:// and
// file:// URIs.
// This logical dependency is also the reason why the Content
- // ProtocolHandler has to be added as a ProtocolInterceptJobFactory rather
- // than via SetProtocolHandler.
- protocol_interceptors.push_back(new AwRequestInterceptor());
+ // URLRequestInterceptor has to be added as an interceptor rather than as a
+ // ProtocolHandler.
+ request_interceptors.push_back(new AwRequestInterceptor());
// The chain of responsibility will execute the handlers in reverse to the
// order in which the elements of the chain are created.
scoped_ptr<net::URLRequestJobFactory> job_factory(aw_job_factory.Pass());
- for (ProtocolHandlerVector::reverse_iterator
- i = protocol_interceptors.rbegin();
- i != protocol_interceptors.rend();
+ for (URLRequestInterceptorVector::reverse_iterator
+ i = request_interceptors.rbegin();
+ i != request_interceptors.rend();
++i) {
- job_factory.reset(new net::ProtocolInterceptJobFactory(
+ job_factory.reset(new net::URLRequestInterceptingJobFactory(
job_factory.Pass(), make_scoped_ptr(*i)));
}
« no previous file with comments | « android_webview/browser/aw_request_interceptor.cc ('k') | android_webview/browser/net/init_native_callback.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698