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

Unified Diff: content/renderer/pepper/pepper_io_stream_host.h

Issue 119853003: [PPAPI] Implement an IOStreamResource for data transmission between plugin and renderer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update Created 6 years, 12 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/renderer/pepper/pepper_io_stream_host.h
diff --git a/content/renderer/pepper/pepper_io_stream_host.h b/content/renderer/pepper/pepper_io_stream_host.h
new file mode 100644
index 0000000000000000000000000000000000000000..51bbf9f334af1daf1d603ed65bee48f769bb090c
--- /dev/null
+++ b/content/renderer/pepper/pepper_io_stream_host.h
@@ -0,0 +1,52 @@
+// Copyright (c) 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_RENDERER_PEPPER_PEPPER_IO_STREAM_HOST_H_
+#define CONTENT_RENDERER_PEPPER_PEPPER_IO_STREAM_HOST_H_
+
+#include "base/compiler_specific.h"
+#include "content/common/content_export.h"
+#include "ppapi/host/host_message_context.h"
+#include "ppapi/host/resource_host.h"
+#include "ppapi/shared_impl/io_stream_shared.h"
+
+namespace content {
+
+class RendererPpapiHost;
+
+class PepperIOStreamHost
+ : public ppapi::host::ResourceHost,
+ public ppapi::IOStreamShared {
+ protected:
+ PepperIOStreamHost(RendererPpapiHost* host,
+ PP_Instance instance,
+ PP_Resource resource,
+ bool is_input);
+
+ virtual ~PepperIOStreamHost();
+
+ virtual int32_t OnResourceMessageReceived(
+ const IPC::Message& msg,
+ ppapi::host::HostMessageContext* context) OVERRIDE;
+
+ bool InitSharedBufferAndNotifyPlugin(uint32_t size);
+
+ private:
+ bool InitSharedBuffer(uint32_t size);
+
+ int32_t OnHostMsgInit(ppapi::host::HostMessageContext* context,
+ uint32_t size);
+
+ int32_t OnHostMsgMoveLimit(ppapi::host::HostMessageContext* context,
+ uint32_t offset);
+
+ // Overridden from ppapi::IOStreamShared.
+ void MovePeerLimit(uint32_t offset) OVERRIDE;
+
+ DISALLOW_COPY_AND_ASSIGN(PepperIOStreamHost);
+};
+
+} // namespace content
+
+#endif // CONTENT_RENDERER_PEPPER_PEPPER_IO_STREAM_HOST_H_

Powered by Google App Engine
This is Rietveld 408576698