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

Side by Side Diff: chrome/renderer/command_buffer_proxy.h

Issue 465040: Added CommandBufferClient, CommandBufferStub and some IPC messages.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years 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 | Annotate | Revision Log
« no previous file with comments | « chrome/plugin/webplugin_delegate_stub.cc ('k') | chrome/renderer/command_buffer_proxy.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2009 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 CHROME_RENDERER_COMMAND_BUFFER_PROXY_H_
6 #define CHROME_RENDERER_COMMAND_BUFFER_PROXY_H_
7
8 #if defined(ENABLE_GPU)
9
10 #include <map>
11
12 #include "base/linked_ptr.h"
13 #include "base/ref_counted.h"
14 #include "base/scoped_ptr.h"
15 #include "base/shared_memory.h"
16 #include "gpu/command_buffer/common/command_buffer.h"
17 #include "ipc/ipc_channel.h"
18 #include "ipc/ipc_message.h"
19
20 class PluginChannelHost;
21
22 // Client side proxy that forwards messages synchronously to a
23 // CommandBufferStub.
24 class CommandBufferProxy : public gpu::CommandBuffer,
25 public IPC::Message::Sender {
26 public:
27 explicit CommandBufferProxy(
28 PluginChannelHost* channel,
29 int route_id);
30 virtual ~CommandBufferProxy();
31
32 // IPC::Message::Sender implementation:
33 virtual bool Send(IPC::Message* msg);
34
35 // CommandBuffer implementation:
36 virtual base::SharedMemory* Initialize(int32 size);
37 virtual base::SharedMemory* GetRingBuffer();
38 virtual int32 GetSize();
39 virtual int32 SyncOffsets(int32 put_offset);
40 virtual int32 GetGetOffset();
41 virtual void SetGetOffset(int32 get_offset);
42 virtual int32 GetPutOffset();
43 virtual void SetPutOffsetChangeCallback(Callback0::Type* callback);
44 virtual int32 CreateTransferBuffer(size_t size);
45 virtual void DestroyTransferBuffer(int32 id);
46 virtual base::SharedMemory* GetTransferBuffer(int32 handle);
47 virtual int32 GetToken();
48 virtual void SetToken(int32 token);
49 virtual int32 ResetParseError();
50 virtual void SetParseError(int32 parse_error);
51 virtual bool GetErrorStatus();
52 virtual void RaiseErrorStatus();
53
54 private:
55 // As with the service, the client takes ownership of the ring buffer.
56 int32 size_;
57 scoped_ptr<base::SharedMemory> ring_buffer_;
58
59 // Local cache of id to transfer buffer mapping.
60 typedef std::map<int32, linked_ptr<base::SharedMemory> > TransferBufferMap;
61 TransferBufferMap transfer_buffers_;
62
63 scoped_refptr<PluginChannelHost> channel_;
64 int route_id_;
65
66 DISALLOW_COPY_AND_ASSIGN(CommandBufferProxy);
67 };
68
69 #endif // ENABLE_GPU
70
71 #endif // CHROME_RENDERER_COMMAND_BUFFER_PROXY_H_
OLDNEW
« no previous file with comments | « chrome/plugin/webplugin_delegate_stub.cc ('k') | chrome/renderer/command_buffer_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698