OLD | NEW |
---|---|
(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 #ifndef ANDROID_WEBVIEW_BROWSER_NET_FALLBACK_PROTOCOL_HANDLER_H_ | |
6 #define ANDROID_WEBVIEW_BROWSER_NET_FALLBACK_PROTOCOL_HANDLER_H_ | |
7 | |
8 #include "base/memory/scoped_ptr.h" | |
9 #include "base/memory/scoped_vector.h" | |
10 #include "net/url_request/url_request_job_factory.h" | |
11 | |
12 class GURL; | |
13 | |
14 namespace net { | |
15 class URLRequest; | |
16 class URLRequestJob; | |
17 class NetworkDelegate; | |
18 } | |
19 | |
20 namespace android_webview { | |
21 | |
22 // This a protocol handler which delegates to a set of protocol handlers at | |
23 // default priority and <F2> | |
boliu
2013/03/01 18:44:11
<F2>?
| |
24 class FallbackProtocolHandler : | |
25 public net::URLRequestJobFactory::ProtocolHandler { | |
26 public: | |
27 // The object takes ownership of all of the supplied protocol handlers | |
28 // (|handlers| will be swapped out with an empty ScopedVector). | |
29 FallbackProtocolHandler( | |
30 ScopedVector<net::URLRequestJobFactory::ProtocolHandler>* handlers, | |
31 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> fallback_handler); | |
32 virtual ~FallbackProtocolHandler(); | |
33 | |
34 // net::URLRequestJobFactory::ProtocolHandler override ----------------------- | |
35 virtual net::URLRequestJob* MaybeCreateJob( | |
36 net::URLRequest* request, | |
37 net::NetworkDelegate* network_delegate) const OVERRIDE; | |
38 | |
39 private: | |
40 ScopedVector<net::URLRequestJobFactory::ProtocolHandler> handlers_; | |
41 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> fallback_handler_; | |
42 | |
43 DISALLOW_COPY_AND_ASSIGN(FallbackProtocolHandler); | |
44 }; | |
45 | |
46 } // namespace android_webview | |
47 | |
48 #endif // ANDROID_WEBVIEW_BROWSER_NET_FALLBACK_PROTOCOL_HANDLER_H_ | |
OLD | NEW |