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

Unified Diff: content/child/shared_memory_data_consumer_handle.h

Issue 1164493008: Implement WebDataConsumerHandle::Reader. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 | « no previous file | content/child/shared_memory_data_consumer_handle.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/shared_memory_data_consumer_handle.h
diff --git a/content/child/shared_memory_data_consumer_handle.h b/content/child/shared_memory_data_consumer_handle.h
index 03f3df08f42ab14a17429f5db33e567b65201b7f..188d028e2e399f1c4bc4cdf20757c0daf58a4907 100644
--- a/content/child/shared_memory_data_consumer_handle.h
+++ b/content/child/shared_memory_data_consumer_handle.h
@@ -39,10 +39,28 @@ class CONTENT_EXPORT SharedMemoryDataConsumerHandle final
DISALLOW_COPY_AND_ASSIGN(Writer);
};
+ class ReaderImpl final : public Reader {
+ public:
+ ReaderImpl(scoped_refptr<Context> context, Client* client);
+ virtual ~ReaderImpl();
+ virtual Result read(void* data, size_t size, Flags flags, size_t* readSize);
+ virtual Result beginRead(const void** buffer,
+ Flags flags,
+ size_t* available);
+ virtual Result endRead(size_t readSize);
+
+ private:
+ scoped_refptr<Context> context_;
+
+ DISALLOW_COPY_AND_ASSIGN(ReaderImpl);
+ };
+
SharedMemoryDataConsumerHandle(BackpressureMode mode,
scoped_ptr<Writer>* writer);
virtual ~SharedMemoryDataConsumerHandle();
+ scoped_ptr<Reader> ObtainReader(Client* client);
+
virtual Result read(void* data, size_t size, Flags flags, size_t* readSize);
virtual Result beginRead(const void** buffer, Flags flags, size_t* available);
virtual Result endRead(size_t readSize);
@@ -50,7 +68,13 @@ class CONTENT_EXPORT SharedMemoryDataConsumerHandle final
virtual void unregisterClient();
private:
+ virtual ReaderImpl* obtainReaderInternal(Client* client);
+ void LockImplicitly();
+ void UnlockImplicitly();
+
scoped_refptr<Context> context_;
+ // This is an implicitly acquired reader for deprecated APIs.
+ scoped_ptr<Reader> reader_;
DISALLOW_COPY_AND_ASSIGN(SharedMemoryDataConsumerHandle);
};
« no previous file with comments | « no previous file | content/child/shared_memory_data_consumer_handle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698