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

Unified Diff: android_webview/native/android_protocol_handler.cc

Issue 11428052: [android_webview] Fix use after free in intercepted requests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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 side-by-side diff with in-line comments
Download patch
Index: android_webview/native/android_protocol_handler.cc
diff --git a/android_webview/native/android_protocol_handler.cc b/android_webview/native/android_protocol_handler.cc
index 839c4e3d5d0c9c5b30cc428434540b50997bab57..fb7283a723b2053ee141d3f62da8e89068c88235 100644
--- a/android_webview/native/android_protocol_handler.cc
+++ b/android_webview/native/android_protocol_handler.cc
@@ -54,12 +54,12 @@ class AndroidStreamReaderURLRequestJobDelegateImpl
virtual bool GetMimeType(JNIEnv* env,
net::URLRequest* request,
- const InputStream& stream,
+ InputStream* stream,
std::string* mime_type) OVERRIDE;
virtual bool GetCharset(JNIEnv* env,
net::URLRequest* request,
- const InputStream& stream,
+ InputStream* stream,
std::string* charset) OVERRIDE;
virtual ~AndroidStreamReaderURLRequestJobDelegateImpl();
@@ -151,7 +151,7 @@ AndroidStreamReaderURLRequestJobDelegateImpl::OpenInputStream(
bool AndroidStreamReaderURLRequestJobDelegateImpl::GetMimeType(
JNIEnv* env,
net::URLRequest* request,
- const android_webview::InputStream& stream,
+ android_webview::InputStream* stream,
std::string* mime_type) {
DCHECK(env);
DCHECK(request);
@@ -162,7 +162,7 @@ bool AndroidStreamReaderURLRequestJobDelegateImpl::GetMimeType(
ScopedJavaLocalRef<jstring> url =
ConvertUTF8ToJavaString(env, request->url().spec());
const InputStreamImpl* stream_impl =
- InputStreamImpl::FromInputStream(&stream);
+ InputStreamImpl::FromInputStream(stream);
ScopedJavaLocalRef<jstring> returned_type =
android_webview::Java_AndroidProtocolHandler_getMimeType(
env,
@@ -178,7 +178,7 @@ bool AndroidStreamReaderURLRequestJobDelegateImpl::GetMimeType(
bool AndroidStreamReaderURLRequestJobDelegateImpl::GetCharset(
JNIEnv* env,
net::URLRequest* request,
- const android_webview::InputStream& stream,
+ android_webview::InputStream* stream,
std::string* charset) {
// TODO: We should probably be getting this from the managed side.
return false;
« no previous file with comments | « android_webview/browser/net/input_stream_reader_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