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

Side by Side Diff: android_webview/browser/net/fallback_protocol_handler.cc

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, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "android_webview/browser/net/fallback_protocol_handler.h"
6
7 using net::URLRequestJobFactory;
8
9 namespace android_webview {
10
11 namespace {
12
13 typedef std::vector<net::URLRequestJobFactory::ProtocolHandler*>
14 ProtocolHandlerVector;
15
16 } // namespace
17
18 FallbackProtocolHandler::FallbackProtocolHandler(
19 ProtocolHandlerVector* handlers,
20 scoped_ptr<URLRequestJobFactory::ProtocolHandler> fallback_handler)
21 : fallback_handler_(fallback_handler.Pass()) {
22 handlers_.swap(*handlers);
23 }
24
25 FallbackProtocolHandler::~FallbackProtocolHandler() {}
26
27 net::URLRequestJob* FallbackProtocolHandler::MaybeCreateJob(
28 net::URLRequest* request,
29 net::NetworkDelegate* network_delegate) const {
30
31 for (ProtocolHandlerVector::iterator i = handlers_.begin();
32 i != handlers_end();
33 ++i) {
34 net::URLRequestJob* job = i->MaybeCreateJob(request, network_delegate);
35 if (job)
36 return job;
37 }
38
39 return fallback_handler_->MaybeCreateJob(request, network_delegate);
40 }
41
42 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698