blob: 2a167c36f9a41689d8718e64f0a34bf2371944a7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
// Copyright (c) 2009 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 CHROME_PLUGIN_COMMAND_BUFFER_STUB_H_
#define CHROME_PLUGIN_COMMAND_BUFFER_STUB_H_
#if defined(ENABLE_GPU)
#include "app/gfx/native_widget_types.h"
#include "base/ref_counted.h"
#include "gpu/command_buffer/service/command_buffer_service.h"
#include "gpu/command_buffer/service/gpu_processor.h"
#include "ipc/ipc_channel.h"
#include "ipc/ipc_message.h"
class PluginChannel;
class CommandBufferService;
class CommandBufferStub : public IPC::Channel::Listener,
public IPC::Message::Sender {
public:
CommandBufferStub(PluginChannel* channel, gfx::NativeView view);
virtual ~CommandBufferStub();
// IPC::Channel::Listener implementation:
virtual void OnMessageReceived(const IPC::Message& message);
virtual void OnChannelError();
// IPC::Message::Sender implementation:
virtual bool Send(IPC::Message* msg);
int route_id() const { return route_id_; }
private:
// Message handlers:
void OnInitialize(int32 size, base::SharedMemoryHandle* ring_buffer);
void OnSyncOffsets(int32 put_offset, int32* get_offset);
void OnGetGetOffset(int32* get_offset);
void OnGetPutOffset(int32* put_offset);
void OnCreateTransferBuffer(int32 size, int32* id);
void OnDestroyTransferBuffer(int32 id);
void OnGetTransferBuffer(int32 id,
base::SharedMemoryHandle* transfer_buffer);
void OnGetToken(int32* token);
void OnResetParseError(int32* parse_error);
void OnGetErrorStatus(bool* error_status);
scoped_refptr<PluginChannel> channel_;
gfx::NativeView view_;
int route_id_;
scoped_ptr<gpu::CommandBufferService> command_buffer_;
scoped_refptr<gpu::GPUProcessor> processor_;
};
#endif // ENABLE_GPU
#endif // CHROME_PLUGIN_COMMAND_BUFFER_STUB_H_
|