| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef ANDROID_WEBVIEW_BROWSER_AW_REQUEST_INTERCEPTOR_H_ | 5 #ifndef ANDROID_WEBVIEW_BROWSER_NET_AW_REQUEST_INTERCEPTOR_H_ |
| 6 #define ANDROID_WEBVIEW_BROWSER_AW_REQUEST_INTERCEPTOR_H_ | 6 #define ANDROID_WEBVIEW_BROWSER_NET_AW_REQUEST_INTERCEPTOR_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "net/url_request/url_request_interceptor.h" | 9 #include "net/url_request/url_request_interceptor.h" |
| 10 | 10 |
| 11 class GURL; | |
| 12 | |
| 13 namespace net { | 11 namespace net { |
| 14 class URLRequest; | 12 class URLRequest; |
| 15 class URLRequestContextGetter; | |
| 16 class URLRequestJob; | 13 class URLRequestJob; |
| 17 class NetworkDelegate; | 14 class NetworkDelegate; |
| 18 } | 15 } |
| 19 | 16 |
| 20 namespace android_webview { | 17 namespace android_webview { |
| 21 | 18 |
| 22 class AwWebResourceResponse; | |
| 23 | |
| 24 // This class allows the Java-side embedder to substitute the default | 19 // 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 | 20 // URLRequest of a given request for an alternative job that will read data |
| 26 // from a Java stream. | 21 // from a Java stream. |
| 27 class AwRequestInterceptor : public net::URLRequestInterceptor { | 22 class AwRequestInterceptor : public net::URLRequestInterceptor { |
| 28 public: | 23 public: |
| 29 AwRequestInterceptor(); | 24 AwRequestInterceptor(); |
| 30 ~AwRequestInterceptor() override; | 25 ~AwRequestInterceptor() override; |
| 31 | 26 |
| 32 // net::URLRequestInterceptor override -------------------------------------- | 27 // net::URLRequestInterceptor override -------------------------------------- |
| 33 net::URLRequestJob* MaybeInterceptRequest( | 28 net::URLRequestJob* MaybeInterceptRequest( |
| 34 net::URLRequest* request, | 29 net::URLRequest* request, |
| 35 net::NetworkDelegate* network_delegate) const override; | 30 net::NetworkDelegate* network_delegate) const override; |
| 36 | 31 |
| 37 private: | 32 private: |
| 38 scoped_ptr<AwWebResourceResponse> QueryForAwWebResourceResponse( | |
| 39 net::URLRequest* request) const; | |
| 40 | |
| 41 DISALLOW_COPY_AND_ASSIGN(AwRequestInterceptor); | 33 DISALLOW_COPY_AND_ASSIGN(AwRequestInterceptor); |
| 42 }; | 34 }; |
| 43 | 35 |
| 44 } // namespace android_webview | 36 } // namespace android_webview |
| 45 | 37 |
| 46 #endif // ANDROID_WEBVIEW_BROWSER_AW_REQUEST_INTERCEPTOR_H_ | 38 #endif // ANDROID_WEBVIEW_BROWSER_NET_AW_REQUEST_INTERCEPTOR_H_ |
| OLD | NEW |