diff options
author | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-05 21:53:50 +0000 |
---|---|---|
committer | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-05 21:53:50 +0000 |
commit | 246a7045b9c45620fd725210aac51322e611c83f (patch) | |
tree | 6bdce605ae758c282a2b27e92a6b223d98b8d46a /chrome/browser/gpu_process_host.h | |
parent | c3240722a63ff142684575e3ea4eb89915edae72 (diff) | |
download | chromium_src-246a7045b9c45620fd725210aac51322e611c83f.zip chromium_src-246a7045b9c45620fd725210aac51322e611c83f.tar.gz chromium_src-246a7045b9c45620fd725210aac51322e611c83f.tar.bz2 |
Added support for opening a GPU command buffer from a renderer processes through a GPU channel.
Probably only works in windows only so far.
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/657046
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40783 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gpu_process_host.h')
-rw-r--r-- | chrome/browser/gpu_process_host.h | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/chrome/browser/gpu_process_host.h b/chrome/browser/gpu_process_host.h index d107b88..f64cdd8 100644 --- a/chrome/browser/gpu_process_host.h +++ b/chrome/browser/gpu_process_host.h @@ -13,9 +13,11 @@ #include "chrome/browser/child_process_launcher.h" #include "chrome/common/gpu_native_window_handle.h" #include "chrome/common/message_router.h" +#include "ipc/ipc_channel_handle.h" #include "ipc/ipc_channel_proxy.h" class ChildProcessLauncher; +class CommandBufferProxy; class GpuProcessHost : public IPC::Channel::Sender, public IPC::Channel::Listener, @@ -45,16 +47,51 @@ class GpuProcessHost : public IPC::Channel::Sender, void AddRoute(int32 routing_id, IPC::Channel::Listener* listener); void RemoveRoute(int32 routing_id); + // Tells the GPU process to create a new channel for communication with a + // renderer. Will asynchronously send message to object with given routing id + // on completion. + void EstablishGpuChannel(int renderer_id, int routing_id); + private: friend struct DefaultSingletonTraits<GpuProcessHost>; + // Used to queue pending channel requests. + struct ChannelRequest { + ChannelRequest(int renderer_id, + int routing_id) : + renderer_id(renderer_id), + routing_id(routing_id) {} + // Used to identify the renderer. The ID is used instead of a pointer to + // the RenderProcessHost in case it is destroyed while the request is + // pending. + // TODO(apatrick): investigate whether these IDs are used for future + // render processes. + int renderer_id; + + // Routing ID of object to receive reply message. + int routing_id; + }; + GpuProcessHost(); virtual ~GpuProcessHost(); + void OnControlMessageReceived(const IPC::Message& message); + + // Message handlers. + void OnChannelEstablished(const IPC::ChannelHandle& channel_handle); + + void ReplyToRenderer(int renderer_id, + int routing_id, + const IPC::ChannelHandle& channel); + + // These are the channel requests that we have already sent to + // the GPU process, but haven't heard back about yet. + std::queue<ChannelRequest> sent_requests_; + scoped_ptr<ChildProcessLauncher> child_process_; // A proxy for our IPC::Channel that lives on the IO thread (see - // browser_process.h). This will be NULL if the class failed to initialize. + // browser_process.h). This will be NULL if the class failed to connect. scoped_ptr<IPC::ChannelProxy> channel_; int last_routing_id_; |