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

Unified Diff: content/browser/streams/stream.h

Issue 12645004: Add Resource Handler for creating Streams to forward to extensions (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Disable Stream Resource Throttle Created 7 years, 9 months 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
« no previous file with comments | « content/browser/loader/stream_resource_handler.cc ('k') | content/browser/streams/stream.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/streams/stream.h
diff --git a/content/browser/streams/stream.h b/content/browser/streams/stream.h
index 3aa389c8d96326868fcdda340d44d85db55f85cc..d6cd3b8e9430f256c938074f9fb64873f536f464 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);
};
« no previous file with comments | « content/browser/loader/stream_resource_handler.cc ('k') | content/browser/streams/stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698