| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_NATIVE_INTERCEPTED_REQUEST_DATA_IMPL_H_ | 5 #ifndef ANDROID_WEBVIEW_NATIVE_INTERCEPTED_REQUEST_DATA_IMPL_H_ |
| 6 #define ANDROID_WEBVIEW_NATIVE_INTERCEPTED_REQUEST_DATA_IMPL_H_ | 6 #define ANDROID_WEBVIEW_NATIVE_INTERCEPTED_REQUEST_DATA_IMPL_H_ |
| 7 | 7 |
| 8 #include "android_webview/browser/aw_web_resource_response.h" | 8 #include "android_webview/browser/aw_web_resource_response.h" |
| 9 #include "base/android/scoped_java_ref.h" | 9 #include "base/android/scoped_java_ref.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 | 12 |
| 13 namespace net { | 13 namespace net { |
| 14 class HttpResponseHeaders; | 14 class HttpResponseHeaders; |
| 15 } | 15 } |
| 16 | 16 |
| 17 namespace android_webview { | 17 namespace android_webview { |
| 18 | 18 |
| 19 class InputStream; | 19 class InputStream; |
| 20 | 20 |
| 21 class AwWebResourceResponseImpl : public AwWebResourceResponse { | 21 class AwWebResourceResponseImpl : public AwWebResourceResponse { |
| 22 public: | 22 public: |
| 23 // It is expected that |obj| is an instance of the Java-side | 23 // It is expected that |obj| is an instance of the Java-side |
| 24 // org.chromium.android_webview.AwWebResourceResponse class. | 24 // org.chromium.android_webview.AwWebResourceResponse class. |
| 25 AwWebResourceResponseImpl(const base::android::JavaRef<jobject>& obj); | 25 AwWebResourceResponseImpl(const base::android::JavaRef<jobject>& obj); |
| 26 virtual ~AwWebResourceResponseImpl(); | 26 ~AwWebResourceResponseImpl() override; |
| 27 | 27 |
| 28 virtual scoped_ptr<InputStream> GetInputStream(JNIEnv* env) const override; | 28 scoped_ptr<InputStream> GetInputStream(JNIEnv* env) const override; |
| 29 virtual bool GetMimeType(JNIEnv* env, std::string* mime_type) const override; | 29 bool GetMimeType(JNIEnv* env, std::string* mime_type) const override; |
| 30 virtual bool GetCharset(JNIEnv* env, std::string* charset) const override; | 30 bool GetCharset(JNIEnv* env, std::string* charset) const override; |
| 31 virtual bool GetStatusInfo(JNIEnv* env, | 31 bool GetStatusInfo(JNIEnv* env, |
| 32 int* status_code, | 32 int* status_code, |
| 33 std::string* reason_phrase) const override; | 33 std::string* reason_phrase) const override; |
| 34 virtual bool GetResponseHeaders( | 34 bool GetResponseHeaders(JNIEnv* env, |
| 35 JNIEnv* env, | 35 net::HttpResponseHeaders* headers) const override; |
| 36 net::HttpResponseHeaders* headers) const override; | |
| 37 | 36 |
| 38 private: | 37 private: |
| 39 base::android::ScopedJavaGlobalRef<jobject> java_object_; | 38 base::android::ScopedJavaGlobalRef<jobject> java_object_; |
| 40 | 39 |
| 41 DISALLOW_COPY_AND_ASSIGN(AwWebResourceResponseImpl); | 40 DISALLOW_COPY_AND_ASSIGN(AwWebResourceResponseImpl); |
| 42 }; | 41 }; |
| 43 | 42 |
| 44 bool RegisterAwWebResourceResponse(JNIEnv* env); | 43 bool RegisterAwWebResourceResponse(JNIEnv* env); |
| 45 | 44 |
| 46 } // namespace android_webview | 45 } // namespace android_webview |
| 47 | 46 |
| 48 #endif // ANDROID_WEBVIEW_NATIVE_INTERCEPTED_REQUEST_DATA_IMPL_H_ | 47 #endif // ANDROID_WEBVIEW_NATIVE_INTERCEPTED_REQUEST_DATA_IMPL_H_ |
| OLD | NEW |