diff options
author | apatrick@google.com <apatrick@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-12 00:11:25 +0000 |
---|---|---|
committer | apatrick@google.com <apatrick@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-12 00:11:25 +0000 |
commit | a7a27ace0760f1ed19016822a45c6ec5300e861c (patch) | |
tree | b7641f10c9fb3130c0ae8f50e7223db2ae722cda /chrome/plugin/command_buffer_stub.h | |
parent | 82017272e7272182443d7054911c4f890346353e (diff) | |
download | chromium_src-a7a27ace0760f1ed19016822a45c6ec5300e861c.zip chromium_src-a7a27ace0760f1ed19016822a45c6ec5300e861c.tar.gz chromium_src-a7a27ace0760f1ed19016822a45c6ec5300e861c.tar.bz2 |
Added CommandBufferProxy, CommandBufferStub. Replaced NPAPI with IPC for synchronous messages. WebPluginDelegateImpl can instantiate a command buffer. Removed remaining dependencies on NPAPI.
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/465040
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34397 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/plugin/command_buffer_stub.h')
-rw-r--r-- | chrome/plugin/command_buffer_stub.h | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/chrome/plugin/command_buffer_stub.h b/chrome/plugin/command_buffer_stub.h new file mode 100644 index 0000000..2a167c3 --- /dev/null +++ b/chrome/plugin/command_buffer_stub.h @@ -0,0 +1,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_ |