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

Side by Side Diff: ppapi/proxy/io_stream_resource.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, 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved.
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 "base/memory/weak_ptr.h"
9 #include "ppapi/proxy/plugin_resource.h"
10 #include "ppapi/proxy/ppapi_proxy_export.h"
11 #include "ppapi/shared_impl/io_stream_shared.h"
12
13 namespace ppapi {
14 namespace proxy {
15
16 // The IOStreamResource is used for data transmission between plugin and
17 // renderer processes. It works as a ring buffer. It is implemented using
18 // shared memory.
19 class PPAPI_PROXY_EXPORT IOStreamResource
yzshen1 2014/01/03 21:51:41 I think if it is intended to be a base class for m
20 : public PluginResource,
21 public IOStreamShared {
22 protected:
23 IOStreamResource(Connection connection,
24 PP_Instance instance,
25 bool is_input);
26
27 IOStreamResource(Connection connection,
28 PP_Instance instance,
29 int pending_renderer_id,
30 bool is_input);
31
32 virtual ~IOStreamResource();
33
34 // Initializes IOStream resource. It allocates the underlying shared circular
35 // buffer.
36 int32_t Init(uint32_t size, scoped_refptr<TrackedCallback> callback);
37
38 // Overridden from ppapi::proxy::PluginResource
39 virtual void OnReplyReceived(const proxy::ResourceMessageReplyParams& params,
yzshen1 2014/01/03 21:51:41 no need to have proxy::
40 const IPC::Message& msg) OVERRIDE;
41
42 private:
43 // Handle Plugin Init message.
yzshen1 2014/01/03 21:51:41 handle*s* (here and below)
44 void OnPluginMsgInit(const ResourceMessageReplyParams& params,
45 uint32_t offset);
46
47 // Handle Plugin MoveLimit message.
48 void OnPluginMsgMoveLimit(const ResourceMessageReplyParams& params,
49 uint32_t offset);
50
51 void OnPluginMsgInitReply(uint32_t size,
52 scoped_refptr<TrackedCallback> callback,
53 const ResourceMessageReplyParams& params);
54
55 // Overridden from ppapi::IOStreamShared.
56 void MovePeerLimit(uint32_t offset) OVERRIDE;
57
58 base::WeakPtrFactory<IOStreamResource> weak_factory_;
59
60 DISALLOW_COPY_AND_ASSIGN(IOStreamResource);
61 };
62
63 } // namespace proxy
64 } // namespace ppapi
65
66 #endif // PPAPI_PROXY_IO_STREAM_RESOURCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698