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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
12 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/memory/singleton.h" | 15 #include "base/memory/singleton.h" |
16 #include "base/process/kill.h" | 16 #include "base/process/kill.h" |
17 #include "base/synchronization/lock.h" | 17 #include "base/synchronization/lock.h" |
18 #include "base/time/time.h" | 18 #include "base/time/time.h" |
19 #include "base/values.h" | 19 #include "base/values.h" |
20 #include "content/public/browser/gpu_data_manager.h" | 20 #include "content/public/browser/gpu_data_manager.h" |
21 #include "content/public/common/gpu_memory_stats.h" | 21 #include "content/public/common/gpu_memory_stats.h" |
22 #include "content/public/common/three_d_api_types.h" | 22 #include "content/public/common/three_d_api_types.h" |
23 #include "gpu/config/gpu_info.h" | 23 #include "gpu/config/gpu_info.h" |
24 | 24 |
25 class CommandLine; | |
26 class GURL; | 25 class GURL; |
27 struct WebPreferences; | 26 struct WebPreferences; |
28 | 27 |
| 28 namespace base { |
| 29 class CommandLine; |
| 30 } |
| 31 |
29 namespace content { | 32 namespace content { |
30 | 33 |
31 class GpuDataManagerImplPrivate; | 34 class GpuDataManagerImplPrivate; |
32 | 35 |
33 class CONTENT_EXPORT GpuDataManagerImpl | 36 class CONTENT_EXPORT GpuDataManagerImpl |
34 : public NON_EXPORTED_BASE(GpuDataManager) { | 37 : public NON_EXPORTED_BASE(GpuDataManager) { |
35 public: | 38 public: |
36 // Indicates the guilt level of a domain which caused a GPU reset. | 39 // Indicates the guilt level of a domain which caused a GPU reset. |
37 // If a domain is 100% known to be guilty of resetting the GPU, then | 40 // If a domain is 100% known to be guilty of resetting the GPU, then |
38 // it will generally not cause other domains' use of 3D APIs to be | 41 // it will generally not cause other domains' use of 3D APIs to be |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 | 91 |
89 // Only update if the current GPUInfo is not finalized. If blacklist is | 92 // Only update if the current GPUInfo is not finalized. If blacklist is |
90 // loaded, run through blacklist and update blacklisted features. | 93 // loaded, run through blacklist and update blacklisted features. |
91 void UpdateGpuInfo(const gpu::GPUInfo& gpu_info); | 94 void UpdateGpuInfo(const gpu::GPUInfo& gpu_info); |
92 | 95 |
93 void UpdateVideoMemoryUsageStats( | 96 void UpdateVideoMemoryUsageStats( |
94 const GPUVideoMemoryUsageStats& video_memory_usage_stats); | 97 const GPUVideoMemoryUsageStats& video_memory_usage_stats); |
95 | 98 |
96 // Insert disable-feature switches corresponding to preliminary gpu feature | 99 // Insert disable-feature switches corresponding to preliminary gpu feature |
97 // flags into the renderer process command line. | 100 // flags into the renderer process command line. |
98 void AppendRendererCommandLine(CommandLine* command_line) const; | 101 void AppendRendererCommandLine(base::CommandLine* command_line) const; |
99 | 102 |
100 // Insert switches into gpu process command line: kUseGL, etc. | 103 // Insert switches into gpu process command line: kUseGL, etc. |
101 void AppendGpuCommandLine(CommandLine* command_line) const; | 104 void AppendGpuCommandLine(base::CommandLine* command_line) const; |
102 | 105 |
103 // Insert switches into plugin process command line: | 106 // Insert switches into plugin process command line: |
104 // kDisableCoreAnimationPlugins. | 107 // kDisableCoreAnimationPlugins. |
105 void AppendPluginCommandLine(CommandLine* command_line) const; | 108 void AppendPluginCommandLine(base::CommandLine* command_line) const; |
106 | 109 |
107 // Update WebPreferences for renderer based on blacklisting decisions. | 110 // Update WebPreferences for renderer based on blacklisting decisions. |
108 void UpdateRendererWebPrefs(WebPreferences* prefs) const; | 111 void UpdateRendererWebPrefs(WebPreferences* prefs) const; |
109 | 112 |
110 std::string GetBlacklistVersion() const; | 113 std::string GetBlacklistVersion() const; |
111 std::string GetDriverBugListVersion() const; | 114 std::string GetDriverBugListVersion() const; |
112 | 115 |
113 // Returns the reasons for the latest run of blacklisting decisions. | 116 // Returns the reasons for the latest run of blacklisting decisions. |
114 // For the structure of returned value, see documentation for | 117 // For the structure of returned value, see documentation for |
115 // GpuBlacklist::GetBlacklistedReasons(). | 118 // GpuBlacklist::GetBlacklistedReasons(). |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 | 205 |
203 mutable base::Lock lock_; | 206 mutable base::Lock lock_; |
204 scoped_ptr<GpuDataManagerImplPrivate> private_; | 207 scoped_ptr<GpuDataManagerImplPrivate> private_; |
205 | 208 |
206 DISALLOW_COPY_AND_ASSIGN(GpuDataManagerImpl); | 209 DISALLOW_COPY_AND_ASSIGN(GpuDataManagerImpl); |
207 }; | 210 }; |
208 | 211 |
209 } // namespace content | 212 } // namespace content |
210 | 213 |
211 #endif // CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_IMPL_H_ | 214 #endif // CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_IMPL_H_ |
OLD | NEW |