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> |
11 | 11 |
12 #include "base/callback.h" | 12 #include "base/callback.h" |
13 #include "base/memory/linked_ptr.h" | 13 #include "base/memory/linked_ptr.h" |
14 #include "base/process.h" | 14 #include "base/process.h" |
15 #include "base/threading/non_thread_safe.h" | 15 #include "base/threading/non_thread_safe.h" |
16 #include "content/common/content_export.h" | 16 #include "content/common/content_export.h" |
17 #include "content/common/gpu/gpu_process_launch_causes.h" | 17 #include "content/common/gpu/gpu_process_launch_causes.h" |
18 #include "content/public/browser/browser_child_process_host_delegate.h" | 18 #include "content/public/browser/browser_child_process_host_delegate.h" |
19 #include "content/public/common/gpu_info.h" | 19 #include "content/public/common/gpu_info.h" |
20 #include "ipc/ipc_message.h" | 20 #include "ipc/ipc_message.h" |
21 #include "ui/gfx/native_widget_types.h" | 21 #include "ui/gfx/native_widget_types.h" |
22 | 22 |
23 class GpuMainThread; | 23 class GpuMainThread; |
24 struct GPUCreateCommandBufferConfig; | 24 struct GPUCreateCommandBufferConfig; |
25 | 25 |
26 class BrowserChildProcessHost; | 26 class BrowserChildProcessHostImpl; |
27 | 27 |
28 class GpuProcessHost : public content::BrowserChildProcessHostDelegate, | 28 class GpuProcessHost : public content::BrowserChildProcessHostDelegate, |
29 public IPC::Message::Sender, | 29 public IPC::Message::Sender, |
30 public base::NonThreadSafe { | 30 public base::NonThreadSafe { |
31 public: | 31 public: |
32 static bool gpu_enabled() { return gpu_enabled_; } | 32 static bool gpu_enabled() { return gpu_enabled_; } |
33 | 33 |
34 // Creates a new GpuProcessHost or gets one for a particular | 34 // Creates a new GpuProcessHost or gets one for a particular |
35 // renderer process, resulting in the launching of a GPU process if required. | 35 // renderer process, resulting in the launching of a GPU process if required. |
36 // Returns null on failure. It is not safe to store the pointer once control | 36 // Returns null on failure. It is not safe to store the pointer once control |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 | 150 |
151 bool software_rendering_; | 151 bool software_rendering_; |
152 | 152 |
153 scoped_ptr<GpuMainThread> in_process_gpu_thread_; | 153 scoped_ptr<GpuMainThread> in_process_gpu_thread_; |
154 | 154 |
155 // Master switch for enabling/disabling GPU acceleration for the current | 155 // Master switch for enabling/disabling GPU acceleration for the current |
156 // browser session. It does not change the acceleration settings for | 156 // browser session. It does not change the acceleration settings for |
157 // existing tabs, just the future ones. | 157 // existing tabs, just the future ones. |
158 CONTENT_EXPORT static bool gpu_enabled_; | 158 CONTENT_EXPORT static bool gpu_enabled_; |
159 | 159 |
160 scoped_ptr<BrowserChildProcessHost> process_; | 160 scoped_ptr<BrowserChildProcessHostImpl> process_; |
161 | 161 |
162 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost); | 162 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost); |
163 }; | 163 }; |
164 | 164 |
165 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ | 165 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ |
OLD | NEW |