OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_GPU_PROCESS_HOST_H_ | 5 #ifndef CHROME_BROWSER_GPU_PROCESS_HOST_H_ |
6 #define CHROME_BROWSER_GPU_PROCESS_HOST_H_ | 6 #define CHROME_BROWSER_GPU_PROCESS_HOST_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <queue> | 9 #include <queue> |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 } | 30 } |
31 | 31 |
32 class GpuProcessHost : public BrowserChildProcessHost, public NonThreadSafe { | 32 class GpuProcessHost : public BrowserChildProcessHost, public NonThreadSafe { |
33 public: | 33 public: |
34 // Getter for the singleton. This will return NULL on failure. | 34 // Getter for the singleton. This will return NULL on failure. |
35 static GpuProcessHost* Get(); | 35 static GpuProcessHost* Get(); |
36 | 36 |
37 virtual bool Send(IPC::Message* msg); | 37 virtual bool Send(IPC::Message* msg); |
38 | 38 |
39 // IPC::Channel::Listener implementation. | 39 // IPC::Channel::Listener implementation. |
40 virtual void OnMessageReceived(const IPC::Message& message); | 40 virtual bool OnMessageReceived(const IPC::Message& message); |
41 | 41 |
42 // Tells the GPU process to create a new channel for communication with a | 42 // Tells the GPU process to create a new channel for communication with a |
43 // renderer. Will asynchronously send message to object with given routing id | 43 // renderer. Will asynchronously send message to object with given routing id |
44 // on completion. | 44 // on completion. |
45 void EstablishGpuChannel(int renderer_id, RenderMessageFilter* filter); | 45 void EstablishGpuChannel(int renderer_id, RenderMessageFilter* filter); |
46 | 46 |
47 // Sends a reply message later when the next GpuHostMsg_SynchronizeReply comes | 47 // Sends a reply message later when the next GpuHostMsg_SynchronizeReply comes |
48 // in. | 48 // in. |
49 void Synchronize(IPC::Message* reply, RenderMessageFilter* filter); | 49 void Synchronize(IPC::Message* reply, RenderMessageFilter* filter); |
50 | 50 |
(...skipping 19 matching lines...) Expand all Loading... |
70 // Used to send the reply message back to the renderer. | 70 // Used to send the reply message back to the renderer. |
71 scoped_refptr<RenderMessageFilter> filter; | 71 scoped_refptr<RenderMessageFilter> filter; |
72 }; | 72 }; |
73 | 73 |
74 GpuProcessHost(); | 74 GpuProcessHost(); |
75 virtual ~GpuProcessHost(); | 75 virtual ~GpuProcessHost(); |
76 | 76 |
77 bool EnsureInitialized(); | 77 bool EnsureInitialized(); |
78 bool Init(); | 78 bool Init(); |
79 | 79 |
80 void OnControlMessageReceived(const IPC::Message& message); | 80 bool OnControlMessageReceived(const IPC::Message& message); |
81 | 81 |
82 // Message handlers. | 82 // Message handlers. |
83 void OnChannelEstablished(const IPC::ChannelHandle& channel_handle, | 83 void OnChannelEstablished(const IPC::ChannelHandle& channel_handle, |
84 const GPUInfo& gpu_info); | 84 const GPUInfo& gpu_info); |
85 void OnSynchronizeReply(); | 85 void OnSynchronizeReply(); |
86 #if defined(OS_LINUX) | 86 #if defined(OS_LINUX) |
87 void OnGetViewXID(gfx::NativeViewId id, IPC::Message* reply_msg); | 87 void OnGetViewXID(gfx::NativeViewId id, IPC::Message* reply_msg); |
88 void OnReleaseXID(unsigned long xid); | 88 void OnReleaseXID(unsigned long xid); |
89 void OnResizeXID(unsigned long xid, gfx::Size size, IPC::Message* reply_msg); | 89 void OnResizeXID(unsigned long xid, gfx::Size size, IPC::Message* reply_msg); |
90 #elif defined(OS_MACOSX) | 90 #elif defined(OS_MACOSX) |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 // the GPU process, but haven't heard back about yet. | 124 // the GPU process, but haven't heard back about yet. |
125 std::queue<ChannelRequest> sent_requests_; | 125 std::queue<ChannelRequest> sent_requests_; |
126 | 126 |
127 // The pending synchronization requests we need to reply to. | 127 // The pending synchronization requests we need to reply to. |
128 std::queue<SynchronizationRequest> queued_synchronization_replies_; | 128 std::queue<SynchronizationRequest> queued_synchronization_replies_; |
129 | 129 |
130 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost); | 130 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost); |
131 }; | 131 }; |
132 | 132 |
133 #endif // CHROME_BROWSER_GPU_PROCESS_HOST_H_ | 133 #endif // CHROME_BROWSER_GPU_PROCESS_HOST_H_ |
OLD | NEW |