diff options
author | zork@chromium.org <zork@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-20 00:26:45 +0000 |
---|---|---|
committer | zork@chromium.org <zork@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-20 00:26:45 +0000 |
commit | 6468898246c51a66808d05e8f4a95d7330204337 (patch) | |
tree | 2033e423c2ef4f73c87468ccf9303991d7fb47ec /content/browser/streams/stream.h | |
parent | fc9b1717c2f1f9305e3e69a0bc8e00feaab27032 (diff) | |
download | chromium_src-6468898246c51a66808d05e8f4a95d7330204337.zip chromium_src-6468898246c51a66808d05e8f4a95d7330204337.tar.gz chromium_src-6468898246c51a66808d05e8f4a95d7330204337.tar.bz2 |
Add Resource Handler for creating Streams to forward to extensions
BUG=171585
Review URL: https://chromiumcodereview.appspot.com/12645004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@189172 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/streams/stream.h')
-rw-r--r-- | content/browser/streams/stream.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/content/browser/streams/stream.h b/content/browser/streams/stream.h index 3aa389c..d6cd3b8 100644 --- a/content/browser/streams/stream.h +++ b/content/browser/streams/stream.h @@ -18,6 +18,8 @@ class IOBuffer; namespace content { +class StreamHandle; +class StreamHandleImpl; class StreamReadObserver; class StreamRegistry; class StreamWriteObserver; @@ -49,6 +51,9 @@ class CONTENT_EXPORT Stream : public base::RefCountedThreadSafe<Stream> { // Removes the read observer. |observer| must be the current observer. void RemoveReadObserver(StreamReadObserver* observer); + // Removes the write observer. |observer| must be the current observer. + void RemoveWriteObserver(StreamWriteObserver* observer); + // Adds the data in |buffer| to the stream. Takes ownership of |buffer|. void AddData(scoped_refptr<net::IOBuffer> buffer, size_t size); @@ -61,6 +66,10 @@ class CONTENT_EXPORT Stream : public base::RefCountedThreadSafe<Stream> { // and STREAM_COMPLETE if the stream is finalized and all data has been read. StreamState ReadRawData(net::IOBuffer* buf, int buf_size, int* bytes_read); + scoped_ptr<StreamHandle> CreateHandle(const GURL& original_url, + const std::string& mime_type); + void CloseHandle(); + // Indicates whether there is space in the buffer to add more data. bool can_add_data() const { return can_add_data_; } @@ -92,6 +101,8 @@ class CONTENT_EXPORT Stream : public base::RefCountedThreadSafe<Stream> { StreamReadObserver* read_observer_; StreamWriteObserver* write_observer_; + StreamHandleImpl* stream_handle_; + base::WeakPtrFactory<Stream> weak_ptr_factory_; DISALLOW_COPY_AND_ASSIGN(Stream); }; |