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

Side by Side Diff: android_webview/native/intercepted_request_data_impl.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 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
« no previous file with comments | « android_webview/native/android_protocol_handler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "android_webview/native/intercepted_request_data_impl.h" 5 #include "android_webview/native/intercepted_request_data_impl.h"
6 6
7 #include "android_webview/browser/net/android_stream_reader_url_request_job.h" 7 #include "android_webview/browser/net/android_stream_reader_url_request_job.h"
8 #include "android_webview/native/input_stream_impl.h" 8 #include "android_webview/native/input_stream_impl.h"
9 #include "base/android/jni_android.h" 9 #include "base/android/jni_android.h"
10 #include "base/android/jni_string.h" 10 #include "base/android/jni_string.h"
(...skipping 17 matching lines...) Expand all
28 } 28 }
29 29
30 virtual scoped_ptr<InputStream> OpenInputStream( 30 virtual scoped_ptr<InputStream> OpenInputStream(
31 JNIEnv* env, 31 JNIEnv* env,
32 net::URLRequest* request) OVERRIDE { 32 net::URLRequest* request) OVERRIDE {
33 return intercepted_request_data_impl_->GetInputStream(env).Pass(); 33 return intercepted_request_data_impl_->GetInputStream(env).Pass();
34 } 34 }
35 35
36 virtual bool GetMimeType(JNIEnv* env, 36 virtual bool GetMimeType(JNIEnv* env,
37 net::URLRequest* request, 37 net::URLRequest* request,
38 const android_webview::InputStream& stream, 38 android_webview::InputStream* stream,
39 std::string* mime_type) OVERRIDE { 39 std::string* mime_type) OVERRIDE {
40 return intercepted_request_data_impl_->GetMimeType(env, mime_type); 40 return intercepted_request_data_impl_->GetMimeType(env, mime_type);
41 } 41 }
42 42
43 virtual bool GetCharset(JNIEnv* env, 43 virtual bool GetCharset(JNIEnv* env,
44 net::URLRequest* request, 44 net::URLRequest* request,
45 const android_webview::InputStream& stream, 45 android_webview::InputStream* stream,
46 std::string* charset) OVERRIDE { 46 std::string* charset) OVERRIDE {
47 return intercepted_request_data_impl_->GetCharset(env, charset); 47 return intercepted_request_data_impl_->GetCharset(env, charset);
48 } 48 }
49 49
50 private: 50 private:
51 const InterceptedRequestDataImpl* intercepted_request_data_impl_; 51 const InterceptedRequestDataImpl* intercepted_request_data_impl_;
52 }; 52 };
53 53
54 } // namespace 54 } // namespace
55 55
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 net::URLRequestJob* InterceptedRequestDataImpl::CreateJobFor( 97 net::URLRequestJob* InterceptedRequestDataImpl::CreateJobFor(
98 net::URLRequest* request, 98 net::URLRequest* request,
99 net::NetworkDelegate* network_delegate) const { 99 net::NetworkDelegate* network_delegate) const {
100 scoped_ptr<AndroidStreamReaderURLRequestJob::Delegate> 100 scoped_ptr<AndroidStreamReaderURLRequestJob::Delegate>
101 stream_reader_job_delegate_impl(new StreamReaderJobDelegateImpl(this)); 101 stream_reader_job_delegate_impl(new StreamReaderJobDelegateImpl(this));
102 return new AndroidStreamReaderURLRequestJob( 102 return new AndroidStreamReaderURLRequestJob(
103 request, network_delegate, stream_reader_job_delegate_impl.Pass()); 103 request, network_delegate, stream_reader_job_delegate_impl.Pass());
104 } 104 }
105 105
106 } // namespace android_webview 106 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/native/android_protocol_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698