OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ | 5 #ifndef CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ |
6 #define CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ | 6 #define CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <queue> | 10 #include <queue> |
(...skipping 11 matching lines...) Expand all Loading... | |
22 #include "ipc/ipc_message.h" | 22 #include "ipc/ipc_message.h" |
23 #include "ui/gfx/native_widget_types.h" | 23 #include "ui/gfx/native_widget_types.h" |
24 | 24 |
25 class GpuMainThread; | 25 class GpuMainThread; |
26 struct GPUCreateCommandBufferConfig; | 26 struct GPUCreateCommandBufferConfig; |
27 struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params; | 27 struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params; |
28 struct GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params; | 28 struct GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params; |
29 struct GpuHostMsg_AcceleratedSurfaceRelease_Params; | 29 struct GpuHostMsg_AcceleratedSurfaceRelease_Params; |
30 | 30 |
31 class BrowserChildProcessHostImpl; | 31 class BrowserChildProcessHostImpl; |
32 class RenderWidgetHelper; | |
32 | 33 |
33 class GpuProcessHost : public content::BrowserChildProcessHostDelegate, | 34 class GpuProcessHost : public content::BrowserChildProcessHostDelegate, |
34 public IPC::Message::Sender, | 35 public IPC::Message::Sender, |
35 public base::NonThreadSafe { | 36 public base::NonThreadSafe { |
36 public: | 37 public: |
37 enum GpuProcessKind { | 38 enum GpuProcessKind { |
38 GPU_PROCESS_KIND_UNSANDBOXED, | 39 GPU_PROCESS_KIND_UNSANDBOXED, |
39 GPU_PROCESS_KIND_SANDBOXED, | 40 GPU_PROCESS_KIND_SANDBOXED, |
40 GPU_PROCESS_KIND_COUNT | 41 GPU_PROCESS_KIND_COUNT |
41 }; | 42 }; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
110 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 111 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
111 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; | 112 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; |
112 virtual void OnProcessLaunched() OVERRIDE; | 113 virtual void OnProcessLaunched() OVERRIDE; |
113 virtual void OnProcessCrashed(int exit_code) OVERRIDE; | 114 virtual void OnProcessCrashed(int exit_code) OVERRIDE; |
114 | 115 |
115 // Message handlers. | 116 // Message handlers. |
116 void OnChannelEstablished(const IPC::ChannelHandle& channel_handle); | 117 void OnChannelEstablished(const IPC::ChannelHandle& channel_handle); |
117 void OnCommandBufferCreated(const int32 route_id); | 118 void OnCommandBufferCreated(const int32 route_id); |
118 void OnDestroyCommandBuffer(int32 surface_id); | 119 void OnDestroyCommandBuffer(int32 surface_id); |
119 | 120 |
121 #if defined(OS_MACOSX) | |
122 void OnAcceleratedSurfaceBuffersSwapped( | |
123 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params); | |
124 #endif | |
120 #if defined(OS_WIN) && !defined(USE_AURA) | 125 #if defined(OS_WIN) && !defined(USE_AURA) |
121 void OnAcceleratedSurfaceBuffersSwapped( | 126 void OnAcceleratedSurfaceBuffersSwapped( |
122 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params); | 127 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params); |
123 void OnAcceleratedSurfacePostSubBuffer( | 128 void OnAcceleratedSurfacePostSubBuffer( |
124 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params); | 129 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params); |
125 void OnAcceleratedSurfaceSuspend(int32 surface_id); | 130 void OnAcceleratedSurfaceSuspend(int32 surface_id); |
126 void OnAcceleratedSurfaceRelease( | 131 void OnAcceleratedSurfaceRelease( |
127 const GpuHostMsg_AcceleratedSurfaceRelease_Params& params); | 132 const GpuHostMsg_AcceleratedSurfaceRelease_Params& params); |
128 #endif | 133 #endif |
129 | 134 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
181 | 186 |
182 // Master switch for enabling/disabling GPU acceleration for the current | 187 // Master switch for enabling/disabling GPU acceleration for the current |
183 // browser session. It does not change the acceleration settings for | 188 // browser session. It does not change the acceleration settings for |
184 // existing tabs, just the future ones. | 189 // existing tabs, just the future ones. |
185 static bool gpu_enabled_; | 190 static bool gpu_enabled_; |
186 | 191 |
187 static bool hardware_gpu_enabled_; | 192 static bool hardware_gpu_enabled_; |
188 | 193 |
189 scoped_ptr<BrowserChildProcessHostImpl> process_; | 194 scoped_ptr<BrowserChildProcessHostImpl> process_; |
190 | 195 |
196 std::map<int, scoped_refptr<RenderWidgetHelper> > render_widget_helpers_; | |
darin (slow to review)
2012/04/23 16:47:14
this shouldn't be needed now, right?
jbates
2012/04/23 20:48:18
Done. Nice catch :)
| |
197 | |
191 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost); | 198 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost); |
192 }; | 199 }; |
193 | 200 |
194 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ | 201 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ |
OLD | NEW |