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