OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_DATA_MANAGER_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_IMPL_H_ |
6 #define CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_IMPL_H_ | 6 #define CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_IMPL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
15 #include "base/logging.h" | 15 #include "base/logging.h" |
16 #include "base/macros.h" | 16 #include "base/macros.h" |
17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
18 #include "base/memory/singleton.h" | 18 #include "base/memory/singleton.h" |
19 #include "base/process/kill.h" | 19 #include "base/process/kill.h" |
20 #include "base/synchronization/lock.h" | 20 #include "base/synchronization/lock.h" |
21 #include "base/time/time.h" | 21 #include "base/time/time.h" |
22 #include "base/values.h" | 22 #include "base/values.h" |
23 #include "content/public/browser/gpu_data_manager.h" | 23 #include "content/public/browser/gpu_data_manager.h" |
24 #include "content/public/common/gpu_memory_stats.h" | |
25 #include "content/public/common/three_d_api_types.h" | 24 #include "content/public/common/three_d_api_types.h" |
26 #include "gpu/config/gpu_info.h" | 25 #include "gpu/config/gpu_info.h" |
27 | 26 |
28 class GURL; | 27 class GURL; |
29 | 28 |
30 namespace base { | 29 namespace base { |
31 class CommandLine; | 30 class CommandLine; |
32 } | 31 } |
33 | 32 |
| 33 namespace gpu { |
| 34 struct VideoMemoryUsageStats; |
| 35 } |
| 36 |
34 namespace content { | 37 namespace content { |
35 | 38 |
36 class GpuDataManagerImplPrivate; | 39 class GpuDataManagerImplPrivate; |
37 struct WebPreferences; | 40 struct WebPreferences; |
38 | 41 |
39 class CONTENT_EXPORT GpuDataManagerImpl | 42 class CONTENT_EXPORT GpuDataManagerImpl |
40 : public NON_EXPORTED_BASE(GpuDataManager) { | 43 : public NON_EXPORTED_BASE(GpuDataManager) { |
41 public: | 44 public: |
42 // Indicates the guilt level of a domain which caused a GPU reset. | 45 // Indicates the guilt level of a domain which caused a GPU reset. |
43 // If a domain is 100% known to be guilty of resetting the GPU, then | 46 // If a domain is 100% known to be guilty of resetting the GPU, then |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 // This collects preliminary GPU info, load GpuBlacklist, and compute the | 99 // This collects preliminary GPU info, load GpuBlacklist, and compute the |
97 // preliminary blacklisted features; it should only be called at browser | 100 // preliminary blacklisted features; it should only be called at browser |
98 // startup time in UI thread before the IO restriction is turned on. | 101 // startup time in UI thread before the IO restriction is turned on. |
99 void Initialize(); | 102 void Initialize(); |
100 | 103 |
101 // Only update if the current GPUInfo is not finalized. If blacklist is | 104 // Only update if the current GPUInfo is not finalized. If blacklist is |
102 // loaded, run through blacklist and update blacklisted features. | 105 // loaded, run through blacklist and update blacklisted features. |
103 void UpdateGpuInfo(const gpu::GPUInfo& gpu_info); | 106 void UpdateGpuInfo(const gpu::GPUInfo& gpu_info); |
104 | 107 |
105 void UpdateVideoMemoryUsageStats( | 108 void UpdateVideoMemoryUsageStats( |
106 const GPUVideoMemoryUsageStats& video_memory_usage_stats); | 109 const gpu::VideoMemoryUsageStats& video_memory_usage_stats); |
107 | 110 |
108 // Insert disable-feature switches corresponding to preliminary gpu feature | 111 // Insert disable-feature switches corresponding to preliminary gpu feature |
109 // flags into the renderer process command line. | 112 // flags into the renderer process command line. |
110 void AppendRendererCommandLine(base::CommandLine* command_line) const; | 113 void AppendRendererCommandLine(base::CommandLine* command_line) const; |
111 | 114 |
112 // Insert switches into gpu process command line: kUseGL, etc. | 115 // Insert switches into gpu process command line: kUseGL, etc. |
113 void AppendGpuCommandLine(base::CommandLine* command_line) const; | 116 void AppendGpuCommandLine(base::CommandLine* command_line) const; |
114 | 117 |
115 // Insert switches into plugin process command line: | 118 // Insert switches into plugin process command line: |
116 // kDisableCoreAnimationPlugins. | 119 // kDisableCoreAnimationPlugins. |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 | 221 |
219 mutable base::Lock lock_; | 222 mutable base::Lock lock_; |
220 scoped_ptr<GpuDataManagerImplPrivate> private_; | 223 scoped_ptr<GpuDataManagerImplPrivate> private_; |
221 | 224 |
222 DISALLOW_COPY_AND_ASSIGN(GpuDataManagerImpl); | 225 DISALLOW_COPY_AND_ASSIGN(GpuDataManagerImpl); |
223 }; | 226 }; |
224 | 227 |
225 } // namespace content | 228 } // namespace content |
226 | 229 |
227 #endif // CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_IMPL_H_ | 230 #endif // CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_IMPL_H_ |
OLD | NEW |