Chromium Code Reviews| 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_ |