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_GPU_GPU_THREAD_H_ | 5 #ifndef CHROME_GPU_GPU_THREAD_H_ |
6 #define CHROME_GPU_GPU_THREAD_H_ | 6 #define CHROME_GPU_GPU_THREAD_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
| 9 #include <string> |
| 10 |
9 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
10 #include "base/command_line.h" | 12 #include "base/command_line.h" |
11 #include "base/scoped_ptr.h" | 13 #include "base/scoped_ptr.h" |
12 #include "base/time.h" | 14 #include "base/time.h" |
13 #include "build/build_config.h" | 15 #include "build/build_config.h" |
14 #include "chrome/common/child_thread.h" | 16 #include "chrome/common/child_thread.h" |
15 #include "chrome/common/gpu_info.h" | 17 #include "chrome/common/gpu_info.h" |
16 #include "chrome/gpu/gpu_channel.h" | 18 #include "chrome/gpu/gpu_channel.h" |
17 #include "chrome/gpu/gpu_config.h" | 19 #include "chrome/gpu/gpu_config.h" |
18 #include "chrome/gpu/x_util.h" | 20 #include "chrome/gpu/x_util.h" |
19 #include "gfx/native_widget_types.h" | 21 #include "gfx/native_widget_types.h" |
20 | 22 |
21 namespace IPC { | 23 namespace IPC { |
22 struct ChannelHandle; | 24 struct ChannelHandle; |
23 } | 25 } |
24 | 26 |
25 class GpuWatchdogThread; | 27 class GpuWatchdogThread; |
26 | 28 |
27 class GpuThread : public ChildThread { | 29 class GpuThread : public ChildThread { |
28 public: | 30 public: |
29 explicit GpuThread(const CommandLine& command_line); | 31 GpuThread(); |
| 32 |
| 33 // For single-process mode. |
| 34 explicit GpuThread(const std::string& channel_id); |
| 35 |
30 ~GpuThread(); | 36 ~GpuThread(); |
31 | 37 |
32 void Init(const base::Time& process_start_time); | 38 void Init(const base::Time& process_start_time); |
33 void StopWatchdog(); | 39 void StopWatchdog(); |
34 | 40 |
35 // Remove the channel for a particular renderer. | 41 // Remove the channel for a particular renderer. |
36 void RemoveChannel(int renderer_id); | 42 void RemoveChannel(int renderer_id); |
37 | 43 |
38 private: | 44 private: |
39 // ChildThread overrides. | 45 // ChildThread overrides. |
(...skipping 11 matching lines...) Expand all Loading... |
51 void OnDidDestroyAcceleratedSurface(int renderer_id, int32 renderer_route_id); | 57 void OnDidDestroyAcceleratedSurface(int renderer_id, int32 renderer_route_id); |
52 #endif | 58 #endif |
53 void OnCrash(); | 59 void OnCrash(); |
54 void OnHang(); | 60 void OnHang(); |
55 | 61 |
56 #if defined(OS_WIN) | 62 #if defined(OS_WIN) |
57 static void CollectDxDiagnostics(GpuThread* thread); | 63 static void CollectDxDiagnostics(GpuThread* thread); |
58 static void SetDxDiagnostics(GpuThread* thread, const DxDiagNode& node); | 64 static void SetDxDiagnostics(GpuThread* thread, const DxDiagNode& node); |
59 #endif | 65 #endif |
60 | 66 |
61 CommandLine command_line_; | |
62 base::Time process_start_time_; | 67 base::Time process_start_time_; |
63 scoped_refptr<GpuWatchdogThread> watchdog_thread_; | 68 scoped_refptr<GpuWatchdogThread> watchdog_thread_; |
64 | 69 |
65 typedef base::hash_map<int, scoped_refptr<GpuChannel> > GpuChannelMap; | 70 typedef base::hash_map<int, scoped_refptr<GpuChannel> > GpuChannelMap; |
66 GpuChannelMap gpu_channels_; | 71 GpuChannelMap gpu_channels_; |
67 | 72 |
68 // Information about the GPU, such as device and vendor ID. | 73 // Information about the GPU, such as device and vendor ID. |
69 GPUInfo gpu_info_; | 74 GPUInfo gpu_info_; |
70 | 75 |
71 DISALLOW_COPY_AND_ASSIGN(GpuThread); | 76 DISALLOW_COPY_AND_ASSIGN(GpuThread); |
72 }; | 77 }; |
73 | 78 |
74 #endif // CHROME_GPU_GPU_THREAD_H_ | 79 #endif // CHROME_GPU_GPU_THREAD_H_ |
OLD | NEW |