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 |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ab5a691bd59f65168fab99e89a78946aedfa5d1a |
--- /dev/null |
+++ b/content/child/web_data_consumer_handle_impl.h |
@@ -0,0 +1,40 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CONTENT_CHILD_WEB_DATA_CONSUMER_HANDLE_IMPL_H_ |
+#define CONTENT_CHILD_WEB_DATA_CONSUMER_HANDLE_IMPL_H_ |
+ |
+#include "base/memory/scoped_ptr.h" |
+#include "mojo/common/handle_watcher.h" |
+#include "mojo/public/cpp/system/data_pipe.h" |
+#include "third_party/WebKit/public/platform/WebDataConsumerHandle.h" |
+ |
+namespace content { |
+ |
+class WebDataConsumerHandleImpl final : public blink::WebDataConsumerHandle { |
+ typedef mojo::ScopedDataPipeConsumerHandle Handle; |
+ public: |
+ explicit WebDataConsumerHandleImpl(Handle handle); |
+ virtual ~WebDataConsumerHandleImpl(); |
+ |
+ virtual Result read(void* data, size_t size, Flags flags, |
+ size_t* readSize) override; |
tyoshino (SeeGerritForStatus)
2014/10/23 07:22:43
I remember I was asked not to specify override to
yhirano
2014/10/23 08:35:39
Maybe. Should I make WebDataConsumerHandle's metho
tyoshino (SeeGerritForStatus)
2014/10/23 09:38:50
Yeah. Please.
|
+ virtual Result beginRead(const void** buffer, Flags flags, |
+ size_t* available) override; |
+ virtual Result endRead(size_t readSize) override; |
+ virtual void registerClient(Client* client); |
+ virtual void unregisterClient(); |
+ |
+ private: |
+ Result HandleReadResult(MojoResult); |
+ void OnHandleGotReadable(MojoResult); |
+ |
+ Handle handle_; |
+ Client* client_; |
+ mojo::common::HandleWatcher handle_watcher_; |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_CHILD_WEB_DATA_CONSUMER_HANDLE_IMPL_H_ |