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

Unified Diff: content/child/web_data_consumer_handle_impl.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
Index: content/child/web_data_consumer_handle_impl.h
diff --git a/content/child/web_data_consumer_handle_impl.h b/content/child/web_data_consumer_handle_impl.h
index 530387586f421693388d315077a9a783d6f061a1..167fe400c14eef0dcdb2944232bd2dd808d0f9fe 100644
--- a/content/child/web_data_consumer_handle_impl.h
+++ b/content/child/web_data_consumer_handle_impl.h
@@ -16,23 +16,37 @@ namespace content {
class CONTENT_EXPORT WebDataConsumerHandleImpl final
: public NON_EXPORTED_BASE(blink::WebDataConsumerHandle) {
typedef mojo::ScopedDataPipeConsumerHandle Handle;
+ class Context;
+
public:
+ class CONTENT_EXPORT ReaderImpl final : public NON_EXPORTED_BASE(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:
+ Result HandleReadResult(MojoResult);
+ void StartWatching();
+ void OnHandleGotReadable(MojoResult);
+
+ scoped_refptr<Context> context_;
+ mojo::common::HandleWatcher handle_watcher_;
+ Client* client_;
+ };
+ scoped_ptr<Reader> ObtainReader(Client* client);
+
explicit WebDataConsumerHandleImpl(Handle handle);
virtual ~WebDataConsumerHandleImpl();
- 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);
- virtual void registerClient(Client* client);
- virtual void unregisterClient();
-
private:
- Result HandleReadResult(MojoResult);
- void OnHandleGotReadable(MojoResult);
+ virtual ReaderImpl* obtainReaderInternal(Client* client);
- Handle handle_;
- Client* client_;
- mojo::common::HandleWatcher handle_watcher_;
+ scoped_refptr<Context> context_;
};
} // namespace content
« no previous file with comments | « content/child/shared_memory_data_consumer_handle_unittest.cc ('k') | content/child/web_data_consumer_handle_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698