| 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_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/intercepted_request_data.h" | 8 #include "android_webview/browser/intercepted_request_data.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 { |
| 14 class HttpResponseHeaders; |
| 15 } |
| 16 |
| 13 namespace android_webview { | 17 namespace android_webview { |
| 14 | 18 |
| 15 class InputStream; | 19 class InputStream; |
| 16 | 20 |
| 17 class InterceptedRequestDataImpl : public InterceptedRequestData { | 21 class InterceptedRequestDataImpl : public InterceptedRequestData { |
| 18 public: | 22 public: |
| 19 // 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 |
| 20 // org.chromium.android_webview.InterceptedRequestData class. | 24 // org.chromium.android_webview.InterceptedRequestData class. |
| 21 InterceptedRequestDataImpl(const base::android::JavaRef<jobject>& obj); | 25 InterceptedRequestDataImpl(const base::android::JavaRef<jobject>& obj); |
| 22 virtual ~InterceptedRequestDataImpl(); | 26 virtual ~InterceptedRequestDataImpl(); |
| 23 | 27 |
| 24 virtual scoped_ptr<InputStream> GetInputStream(JNIEnv* env) const OVERRIDE; | 28 virtual scoped_ptr<InputStream> GetInputStream(JNIEnv* env) const OVERRIDE; |
| 25 virtual bool GetMimeType(JNIEnv* env, std::string* mime_type) const OVERRIDE; | 29 virtual bool GetMimeType(JNIEnv* env, std::string* mime_type) const OVERRIDE; |
| 26 virtual bool GetCharset(JNIEnv* env, std::string* charset) const OVERRIDE; | 30 virtual bool GetCharset(JNIEnv* env, std::string* charset) const OVERRIDE; |
| 31 virtual bool GetStatusInfo(JNIEnv* env, |
| 32 int* status_code, |
| 33 std::string* reason_phrase) const OVERRIDE; |
| 34 virtual bool GetHeaders( |
| 35 JNIEnv* env, |
| 36 net::HttpResponseHeaders* headers) const OVERRIDE; |
| 27 | 37 |
| 28 private: | 38 private: |
| 29 base::android::ScopedJavaGlobalRef<jobject> java_object_; | 39 base::android::ScopedJavaGlobalRef<jobject> java_object_; |
| 30 | 40 |
| 31 DISALLOW_COPY_AND_ASSIGN(InterceptedRequestDataImpl); | 41 DISALLOW_COPY_AND_ASSIGN(InterceptedRequestDataImpl); |
| 32 }; | 42 }; |
| 33 | 43 |
| 34 bool RegisterInterceptedRequestData(JNIEnv* env); | 44 bool RegisterInterceptedRequestData(JNIEnv* env); |
| 35 | 45 |
| 36 } // namespace android_webview | 46 } // namespace android_webview |
| 37 | 47 |
| 38 #endif // ANDROID_WEBVIEW_NATIVE_INTERCEPTED_REQUEST_DATA_IMPL_H_ | 48 #endif // ANDROID_WEBVIEW_NATIVE_INTERCEPTED_REQUEST_DATA_IMPL_H_ |
| OLD | NEW |