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

Unified Diff: android_webview/browser/net/fallback_protocol_handler.h

Issue 12377051: [android_webview] Don't intercept resource and asset URLRequests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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/fallback_protocol_handler.h
diff --git a/android_webview/browser/net/fallback_protocol_handler.h b/android_webview/browser/net/fallback_protocol_handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..b3edac749e104727deab90e88040afa370c05b0e
--- /dev/null
+++ b/android_webview/browser/net/fallback_protocol_handler.h
@@ -0,0 +1,48 @@
+// Copyright 2013 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_FALLBACK_PROTOCOL_HANDLER_H_
+#define ANDROID_WEBVIEW_BROWSER_NET_FALLBACK_PROTOCOL_HANDLER_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "base/memory/scoped_vector.h"
+#include "net/url_request/url_request_job_factory.h"
+
+class GURL;
+
+namespace net {
+class URLRequest;
+class URLRequestJob;
+class NetworkDelegate;
+}
+
+namespace android_webview {
+
+// This a protocol handler which delegates to a set of protocol handlers at
+// default priority and <F2>
boliu 2013/03/01 18:44:11 <F2>?
+class FallbackProtocolHandler :
+ public net::URLRequestJobFactory::ProtocolHandler {
+ public:
+ // The object takes ownership of all of the supplied protocol handlers
+ // (|handlers| will be swapped out with an empty ScopedVector).
+ FallbackProtocolHandler(
+ ScopedVector<net::URLRequestJobFactory::ProtocolHandler>* handlers,
+ scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> fallback_handler);
+ virtual ~FallbackProtocolHandler();
+
+ // net::URLRequestJobFactory::ProtocolHandler override -----------------------
+ virtual net::URLRequestJob* MaybeCreateJob(
+ net::URLRequest* request,
+ net::NetworkDelegate* network_delegate) const OVERRIDE;
+
+ private:
+ ScopedVector<net::URLRequestJobFactory::ProtocolHandler> handlers_;
+ scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> fallback_handler_;
+
+ DISALLOW_COPY_AND_ASSIGN(FallbackProtocolHandler);
+};
+
+} // namespace android_webview
+
+#endif // ANDROID_WEBVIEW_BROWSER_NET_FALLBACK_PROTOCOL_HANDLER_H_

Powered by Google App Engine
This is Rietveld 408576698