Separate Simple Backend creation from initialization.
[chromium-blink-merge.git] / android_webview / browser / aw_request_interceptor.h
blob51a7af84e6c83d6120cf6d8f72e18a5ecc82dc0e
1 // Copyright (c) 2012 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.
5 #ifndef ANDROID_WEBVIEW_BROWSER_AW_REQUEST_INTERCEPTOR_H_
6 #define ANDROID_WEBVIEW_BROWSER_AW_REQUEST_INTERCEPTOR_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "net/url_request/url_request_job_factory.h"
11 class GURL;
13 namespace net {
14 class URLRequest;
15 class URLRequestContextGetter;
16 class URLRequestJob;
17 class NetworkDelegate;
20 namespace android_webview {
22 class InterceptedRequestData;
24 // This class allows the Java-side embedder to substitute the default
25 // URLRequest of a given request for an alternative job that will read data
26 // from a Java stream.
27 class AwRequestInterceptor : public net::URLRequestJobFactory::ProtocolHandler {
28 public:
29 AwRequestInterceptor();
30 virtual ~AwRequestInterceptor();
32 // net::URLRequestJobFactory::ProtocolHandler override -----------------------
33 virtual net::URLRequestJob* MaybeCreateJob(
34 net::URLRequest* request,
35 net::NetworkDelegate* network_delegate) const OVERRIDE;
37 private:
38 scoped_ptr<InterceptedRequestData> QueryForInterceptedRequestData(
39 const GURL& location,
40 net::URLRequest* request) const;
42 DISALLOW_COPY_AND_ASSIGN(AwRequestInterceptor);
45 } // namespace android_webview
47 #endif // ANDROID_WEBVIEW_BROWSER_AW_REQUEST_INTERCEPTOR_H_