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

Unified Diff: content/child/web_data_producer_handle_impl.h

Issue 850043008: [DO NOT REVIEW][DO NOT COMMIT] Implement WebDataProducerHandleImpl. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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/child/web_data_consumer_handle_impl.cc ('k') | content/child/web_data_producer_handle_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/web_data_producer_handle_impl.h
diff --git a/content/child/web_data_producer_handle_impl.h b/content/child/web_data_producer_handle_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..629798609734cfe5eef6da06389321f837ae61d8
--- /dev/null
+++ b/content/child/web_data_producer_handle_impl.h
@@ -0,0 +1,41 @@
+// Copyright 2015 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_PRODUCER_HANDLE_IMPL_H_
+#define CONTENT_CHILD_WEB_DATA_PRODUCER_HANDLE_IMPL_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "content/common/content_export.h"
+#include "mojo/common/handle_watcher.h"
+#include "mojo/public/cpp/system/data_pipe.h"
+#include "third_party/WebKit/public/platform/WebDataProducerHandle.h"
+
+namespace content {
+
+class CONTENT_EXPORT WebDataProducerHandleImpl final
+ : public NON_EXPORTED_BASE(blink::WebDataProducerHandle) {
+ typedef mojo::ScopedDataPipeProducerHandle Handle;
+ public:
+ explicit WebDataProducerHandleImpl(Handle handle);
+ virtual ~WebDataProducerHandleImpl();
+
+ virtual Result write(const void* data, size_t size, Flags flags,
+ size_t* writtenSize);
+ virtual Result beginWrite(void** buffer, Flags flags, size_t* available);
+ virtual Result endWrite(size_t writtenSize);
+ virtual void registerClient(Client* client);
+ virtual void unregisterClient();
+
+ private:
+ Result HandleWriteResult(MojoResult);
+ void OnHandleGotWritable(MojoResult);
+
+ Handle handle_;
+ Client* client_;
+ mojo::common::HandleWatcher handle_watcher_;
+};
+
+} // namespace content
+
+#endif // CONTENT_CHILD_WEB_DATA_PRODUCER_HANDLE_IMPL_H_
« no previous file with comments | « content/child/web_data_consumer_handle_impl.cc ('k') | content/child/web_data_producer_handle_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698