Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(437)

Side by Side Diff: android_webview/native/intercepted_request_data_impl.h

Issue 11363123: [android_webview] Don't block the IO thread when reading from an InputStream. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 12
12 namespace android_webview { 13 namespace android_webview {
13 14
15 class InputStream;
16
14 class InterceptedRequestDataImpl : public InterceptedRequestData { 17 class InterceptedRequestDataImpl : public InterceptedRequestData {
15 public: 18 public:
16 // It is expected that |obj| is an instance of the Java-side 19 // It is expected that |obj| is an instance of the Java-side
17 // org.chromium.android_webview.InterceptedRequestData class. 20 // org.chromium.android_webview.InterceptedRequestData class.
18 InterceptedRequestDataImpl(const base::android::JavaRef<jobject>& obj); 21 InterceptedRequestDataImpl(const base::android::JavaRef<jobject>& obj);
19 virtual ~InterceptedRequestDataImpl(); 22 virtual ~InterceptedRequestDataImpl();
20 23
21 virtual base::android::ScopedJavaLocalRef<jobject> 24 virtual scoped_ptr<InputStream> GetInputStream(JNIEnv* env) const;
22 GetInputStream(JNIEnv* env) const;
23 virtual bool GetMimeType(JNIEnv* env, std::string* mime_type) const; 25 virtual bool GetMimeType(JNIEnv* env, std::string* mime_type) const;
24 virtual bool GetCharset(JNIEnv* env, std::string* charset) const; 26 virtual bool GetCharset(JNIEnv* env, std::string* charset) const;
25 27
26 virtual net::URLRequestJob* CreateJobFor( 28 virtual net::URLRequestJob* CreateJobFor(
27 net::URLRequest* request, 29 net::URLRequest* request,
28 net::NetworkDelegate* network_delegate) const OVERRIDE; 30 net::NetworkDelegate* network_delegate) const OVERRIDE;
29 31
30 private: 32 private:
31 base::android::ScopedJavaGlobalRef<jobject> java_object_; 33 base::android::ScopedJavaGlobalRef<jobject> java_object_;
32 34
33 DISALLOW_COPY_AND_ASSIGN(InterceptedRequestDataImpl); 35 DISALLOW_COPY_AND_ASSIGN(InterceptedRequestDataImpl);
34 }; 36 };
35 37
36 bool RegisterInterceptedRequestData(JNIEnv* env); 38 bool RegisterInterceptedRequestData(JNIEnv* env);
37 39
38 } // namespace android_webview 40 } // namespace android_webview
39 41
40 #endif // ANDROID_WEBVIEW_NATIVE_INTERCEPTED_REQUEST_DATA_IMPL_H_ 42 #endif // ANDROID_WEBVIEW_NATIVE_INTERCEPTED_REQUEST_DATA_IMPL_H_
OLDNEW
« no previous file with comments | « android_webview/native/input_stream_unittest.cc ('k') | android_webview/native/intercepted_request_data_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698