Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
|
bbudge
2013/12/31 00:51:53
2013
Peng
2013/12/31 23:33:54
Done.
| |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef PPAPI_PROXY_IO_STREAM_RESOURCE_H_ | |
| 6 #define PPAPI_PROXY_IO_STREAM_RESOURCE_H_ | |
| 7 | |
| 8 #include "ppapi/proxy/plugin_resource.h" | |
| 9 #include "ppapi/proxy/ppapi_proxy_export.h" | |
| 10 #include "ppapi/shared_impl/io_stream_shared.h" | |
| 11 | |
| 12 namespace ppapi { | |
| 13 namespace proxy { | |
| 14 | |
| 15 // The IOStreamResource is used for data transmission between plugin and | |
| 16 // renderer processes. It works as a ring buffer. Its underlayer is shared | |
|
bbudge
2013/12/31 00:51:53
How about:
It is implemented using shared memory.
Peng
2013/12/31 23:33:54
Done.
| |
| 17 // memory. | |
| 18 class PPAPI_PROXY_EXPORT IOStreamResource | |
| 19 : public PluginResource, public IOStreamShared { | |
| 20 protected: | |
| 21 IOStreamResource(Connection connection, | |
| 22 PP_Instance instance, | |
| 23 bool input); | |
| 24 | |
| 25 IOStreamResource(Connection connection, | |
| 26 PP_Instance instance, | |
| 27 int pending_renderer_id, | |
| 28 bool input); | |
| 29 | |
| 30 virtual ~IOStreamResource(); | |
| 31 | |
| 32 // Initializes IOStream resource. It allocates the underlying shared circular | |
| 33 // buffer. | |
| 34 // TODO(penghuang): Support initializing asynchronizely. | |
|
bbudge
2013/12/31 00:51:53
sp asynchronously
Peng
2013/12/31 23:33:54
Done.
| |
| 35 int32_t Init(uint32_t size); | |
| 36 | |
| 37 // Overridden from ppapi::proxy::PluginResource | |
| 38 virtual void OnReplyReceived(const proxy::ResourceMessageReplyParams& params, | |
| 39 const IPC::Message& msg) OVERRIDE; | |
| 40 | |
| 41 private: | |
| 42 // Handle Plugin MoveLimit message. | |
|
bbudge
2013/12/31 00:51:53
s/MoveLimit/Init
Peng
2013/12/31 23:33:54
Done.
| |
| 43 void OnPluginMsgInit(const ResourceMessageReplyParams& params, | |
| 44 uint32_t offset); | |
| 45 | |
| 46 // Handle Plugin MoveLimit message. | |
| 47 void OnPluginMsgMoveLimit(const ResourceMessageReplyParams& params, | |
| 48 uint32_t offset); | |
| 49 | |
| 50 // Overridden from ppapi::IOStreamShared. | |
| 51 void MovePeerLimit(uint32_t offset) OVERRIDE; | |
| 52 | |
| 53 DISALLOW_COPY_AND_ASSIGN(IOStreamResource); | |
| 54 }; | |
| 55 | |
| 56 } // namespace proxy | |
| 57 } // namespace ppapi | |
| 58 | |
| 59 #endif // PPAPI_PROXY_IO_STREAM_RESOURCE_H_ | |
| OLD | NEW |