OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 // Can be called from any thread. | 45 // Can be called from any thread. |
46 CONTENT_EXPORT static void SendOnIO(int renderer_id, | 46 CONTENT_EXPORT static void SendOnIO(int renderer_id, |
47 content::CauseForGpuLaunch cause, | 47 content::CauseForGpuLaunch cause, |
48 IPC::Message* message); | 48 IPC::Message* message); |
49 | 49 |
50 // Get the GPU process host for the GPU process with the given ID. Returns | 50 // Get the GPU process host for the GPU process with the given ID. Returns |
51 // null if the process no longer exists. | 51 // null if the process no longer exists. |
52 static GpuProcessHost* FromID(int host_id); | 52 static GpuProcessHost* FromID(int host_id); |
53 int host_id() const { return host_id_; } | 53 int host_id() const { return host_id_; } |
54 | 54 |
55 virtual bool Send(IPC::Message* msg); | 55 virtual bool Send(IPC::Message* msg) OVERRIDE; |
56 | 56 |
57 // ChildProcessHost implementation. | 57 // ChildProcessHost implementation. |
58 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 58 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
59 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; | 59 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; |
60 | 60 |
61 typedef Callback3<const IPC::ChannelHandle&, | 61 typedef Callback3<const IPC::ChannelHandle&, |
62 base::ProcessHandle, | 62 base::ProcessHandle, |
63 const content::GPUInfo&>::Type | 63 const content::GPUInfo&>::Type |
64 EstablishChannelCallback; | 64 EstablishChannelCallback; |
65 | 65 |
(...skipping 19 matching lines...) Expand all Loading... |
85 | 85 |
86 private: | 86 private: |
87 GpuProcessHost(int host_id); | 87 GpuProcessHost(int host_id); |
88 virtual ~GpuProcessHost(); | 88 virtual ~GpuProcessHost(); |
89 | 89 |
90 bool Init(); | 90 bool Init(); |
91 | 91 |
92 // Post an IPC message to the UI shim's message handler on the UI thread. | 92 // Post an IPC message to the UI shim's message handler on the UI thread. |
93 void RouteOnUIThread(const IPC::Message& message); | 93 void RouteOnUIThread(const IPC::Message& message); |
94 | 94 |
95 virtual bool CanShutdown(); | 95 virtual bool CanShutdown() OVERRIDE; |
96 virtual void OnProcessLaunched(); | 96 virtual void OnProcessLaunched() OVERRIDE; |
97 virtual void OnChildDied(); | 97 virtual void OnChildDied() OVERRIDE; |
98 virtual void OnProcessCrashed(int exit_code); | 98 virtual void OnProcessCrashed(int exit_code) OVERRIDE; |
99 | 99 |
100 // Message handlers. | 100 // Message handlers. |
101 void OnChannelEstablished(const IPC::ChannelHandle& channel_handle); | 101 void OnChannelEstablished(const IPC::ChannelHandle& channel_handle); |
102 void OnCommandBufferCreated(const int32 route_id); | 102 void OnCommandBufferCreated(const int32 route_id); |
103 void OnDestroyCommandBuffer( | 103 void OnDestroyCommandBuffer( |
104 gfx::PluginWindowHandle window, int32 renderer_id, int32 render_view_id); | 104 gfx::PluginWindowHandle window, int32 renderer_id, int32 render_view_id); |
105 void OnGraphicsInfoCollected(const content::GPUInfo& gpu_info); | 105 void OnGraphicsInfoCollected(const content::GPUInfo& gpu_info); |
106 | 106 |
107 bool LaunchGpuProcess(); | 107 bool LaunchGpuProcess(); |
108 | 108 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 | 158 |
159 // Master switch for enabling/disabling GPU acceleration for the current | 159 // Master switch for enabling/disabling GPU acceleration for the current |
160 // browser session. It does not change the acceleration settings for | 160 // browser session. It does not change the acceleration settings for |
161 // existing tabs, just the future ones. | 161 // existing tabs, just the future ones. |
162 CONTENT_EXPORT static bool gpu_enabled_; | 162 CONTENT_EXPORT static bool gpu_enabled_; |
163 | 163 |
164 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost); | 164 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost); |
165 }; | 165 }; |
166 | 166 |
167 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ | 167 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ |
OLD | NEW |