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

Side by Side Diff: android_webview/browser/input_stream.h

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 | « no previous file | android_webview/browser/net/android_stream_reader_url_request_job.h » ('j') | 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 #ifndef ANDROID_WEBVIEW_BROWSER_INPUT_STREAM_H_ 5 #ifndef ANDROID_WEBVIEW_BROWSER_INPUT_STREAM_H_
6 #define ANDROID_WEBVIEW_BROWSER_INPUT_STREAM_H_ 6 #define ANDROID_WEBVIEW_BROWSER_INPUT_STREAM_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 9
10 namespace net { 10 namespace net {
11 class IOBuffer; 11 class IOBuffer;
12 } 12 }
13 13
14 namespace android_webview { 14 namespace android_webview {
15 15
16 // Abstract wrapper used to access the InputStream Java class. 16 // Abstract wrapper used to access the InputStream Java class.
17 // This class is safe to pass around between threads (the destructor,
18 // constructor and methods can be called on different threads) but calling
19 // methods concurrently might have undefined results.
17 class InputStream { 20 class InputStream {
18 public: 21 public:
19 virtual ~InputStream() {} 22 virtual ~InputStream() {}
20 23
21 // Sets |bytes_available| to the number of bytes that can be read (or skipped 24 // Sets |bytes_available| to the number of bytes that can be read (or skipped
22 // over) from this input stream without blocking by the next caller of a 25 // over) from this input stream without blocking by the next caller of a
23 // method for this input stream. 26 // method for this input stream.
24 // Returns true if completed successfully or false if an exception was 27 // Returns true if completed successfully or false if an exception was
25 // thrown. 28 // thrown.
26 virtual bool BytesAvailable(int* bytes_available) const = 0; 29 virtual bool BytesAvailable(int* bytes_available) const = 0;
(...skipping 12 matching lines...) Expand all
39 // thrown. 42 // thrown.
40 virtual bool Read(net::IOBuffer* dest, int length, int* bytes_read) = 0; 43 virtual bool Read(net::IOBuffer* dest, int length, int* bytes_read) = 0;
41 44
42 protected: 45 protected:
43 InputStream() {} 46 InputStream() {}
44 }; 47 };
45 48
46 } // namespace android_webview 49 } // namespace android_webview
47 50
48 #endif // ANDROID_WEBVIEW_BROWSER_INPUT_STREAM_H_ 51 #endif // ANDROID_WEBVIEW_BROWSER_INPUT_STREAM_H_
OLDNEW
« no previous file with comments | « no previous file | 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