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

Unified Diff: android_webview/browser/intercepted_request_data.h

Issue 59903011: [android_webview] Fix UAF in request interception code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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/browser/intercepted_request_data.h
diff --git a/android_webview/browser/intercepted_request_data.h b/android_webview/browser/intercepted_request_data.h
index 672833c09e7df108a36c1b5025e760502390ce8e..3e67d0eb83eda3cd627beeb9b6e724076ffc57e2 100644
--- a/android_webview/browser/intercepted_request_data.h
+++ b/android_webview/browser/intercepted_request_data.h
@@ -8,6 +8,7 @@
#include <string>
#include "base/memory/scoped_ptr.h"
+#include "base/memory/ref_counted.h"
namespace net {
class URLRequest;
@@ -17,19 +18,22 @@ class NetworkDelegate;
namespace android_webview {
+class InterceptedRequestData;
+
// This class represents the Java-side data that is to be used to complete a
// particular URLRequest.
class InterceptedRequestData {
public:
+ typedef base::RefCountedData<scoped_ptr<InterceptedRequestData> > Holder;
virtual ~InterceptedRequestData() {}
- // This creates a URLRequestJob for the |request| wich will read data from
- // the |intercepted_request_data| structure (instead of going to the network
- // or to the cache).
- // The newly created job does not take ownership of |this|.
- virtual net::URLRequestJob* CreateJobFor(
+ // This creates a URLRequestJob for the |request| wich will read data from the
+ // |intercepted_request_data| structure obtained from |holder| (instead of
+ // going to the network or to the cache).
+ static net::URLRequestJob* CreateJobFor(
+ scoped_refptr<Holder> holder,
net::URLRequest* request,
- net::NetworkDelegate* network_delegate) const = 0;
+ net::NetworkDelegate* network_delegate);
protected:
InterceptedRequestData() {}
« no previous file with comments | « android_webview/browser/aw_request_interceptor.cc ('k') | android_webview/browser/net/android_stream_reader_url_request_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698