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_PRIVATE_H_ | 5 #ifndef CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_IMPL_PRIVATE_H_ |
6 #define CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_IMPL_PRIVATE_H_ | 6 #define CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_IMPL_PRIVATE_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/memory/singleton.h" | 14 #include "base/memory/singleton.h" |
15 #include "base/observer_list_threadsafe.h" | 15 #include "base/observer_list_threadsafe.h" |
16 #include "content/browser/gpu/gpu_data_manager_impl.h" | 16 #include "content/browser/gpu/gpu_data_manager_impl.h" |
17 #include "gpu/config/gpu_blacklist.h" | 17 #include "gpu/config/gpu_blacklist.h" |
18 #include "gpu/config/gpu_driver_bug_list.h" | 18 #include "gpu/config/gpu_driver_bug_list.h" |
19 #include "gpu/config/gpu_switching_list.h" | |
20 | 19 |
21 namespace content { | 20 namespace content { |
22 | 21 |
23 class CONTENT_EXPORT GpuDataManagerImplPrivate { | 22 class CONTENT_EXPORT GpuDataManagerImplPrivate { |
24 public: | 23 public: |
25 static GpuDataManagerImplPrivate* Create(GpuDataManagerImpl* owner); | 24 static GpuDataManagerImplPrivate* Create(GpuDataManagerImpl* owner); |
26 | 25 |
27 void InitializeForTesting( | 26 void InitializeForTesting( |
28 const std::string& gpu_blacklist_json, | 27 const std::string& gpu_blacklist_json, |
29 const gpu::GPUInfo& gpu_info); | 28 const gpu::GPUInfo& gpu_info); |
(...skipping 28 matching lines...) Expand all Loading... |
58 const GPUVideoMemoryUsageStats& video_memory_usage_stats); | 57 const GPUVideoMemoryUsageStats& video_memory_usage_stats); |
59 | 58 |
60 void AppendRendererCommandLine(CommandLine* command_line) const; | 59 void AppendRendererCommandLine(CommandLine* command_line) const; |
61 | 60 |
62 void AppendGpuCommandLine(CommandLine* command_line) const; | 61 void AppendGpuCommandLine(CommandLine* command_line) const; |
63 | 62 |
64 void AppendPluginCommandLine(CommandLine* command_line) const; | 63 void AppendPluginCommandLine(CommandLine* command_line) const; |
65 | 64 |
66 void UpdateRendererWebPrefs(WebPreferences* prefs) const; | 65 void UpdateRendererWebPrefs(WebPreferences* prefs) const; |
67 | 66 |
68 gpu::GpuSwitchingOption GetGpuSwitchingOption() const; | |
69 | |
70 std::string GetBlacklistVersion() const; | 67 std::string GetBlacklistVersion() const; |
71 std::string GetDriverBugListVersion() const; | 68 std::string GetDriverBugListVersion() const; |
72 | 69 |
73 void GetBlacklistReasons(base::ListValue* reasons) const; | 70 void GetBlacklistReasons(base::ListValue* reasons) const; |
74 | 71 |
75 void GetDriverBugWorkarounds(base::ListValue* workarounds) const; | 72 void GetDriverBugWorkarounds(base::ListValue* workarounds) const; |
76 | 73 |
77 void AddLogMessage(int level, | 74 void AddLogMessage(int level, |
78 const std::string& header, | 75 const std::string& header, |
79 const std::string& message); | 76 const std::string& message); |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 }; | 159 }; |
163 | 160 |
164 typedef std::map<std::string, DomainBlockEntry> DomainBlockMap; | 161 typedef std::map<std::string, DomainBlockEntry> DomainBlockMap; |
165 | 162 |
166 typedef ObserverListThreadSafe<GpuDataManagerObserver> | 163 typedef ObserverListThreadSafe<GpuDataManagerObserver> |
167 GpuDataManagerObserverList; | 164 GpuDataManagerObserverList; |
168 | 165 |
169 explicit GpuDataManagerImplPrivate(GpuDataManagerImpl* owner); | 166 explicit GpuDataManagerImplPrivate(GpuDataManagerImpl* owner); |
170 | 167 |
171 void InitializeImpl(const std::string& gpu_blacklist_json, | 168 void InitializeImpl(const std::string& gpu_blacklist_json, |
172 const std::string& gpu_switching_list_json, | |
173 const std::string& gpu_driver_bug_list_json, | 169 const std::string& gpu_driver_bug_list_json, |
174 const gpu::GPUInfo& gpu_info); | 170 const gpu::GPUInfo& gpu_info); |
175 | 171 |
176 void UpdateBlacklistedFeatures(const std::set<int>& features); | 172 void UpdateBlacklistedFeatures(const std::set<int>& features); |
177 | 173 |
178 // This should only be called once at initialization time, when preliminary | 174 // This should only be called once at initialization time, when preliminary |
179 // gpu info is collected. | 175 // gpu info is collected. |
180 void UpdatePreliminaryBlacklistedFeatures(); | 176 void UpdatePreliminaryBlacklistedFeatures(); |
181 | 177 |
182 // Update the GPU switching status. | 178 // Update the GPU switching status. |
(...skipping 16 matching lines...) Expand all Loading... |
199 base::Time at_time); | 195 base::Time at_time); |
200 GpuDataManagerImpl::DomainBlockStatus Are3DAPIsBlockedAtTime( | 196 GpuDataManagerImpl::DomainBlockStatus Are3DAPIsBlockedAtTime( |
201 const GURL& url, base::Time at_time) const; | 197 const GURL& url, base::Time at_time) const; |
202 int64 GetBlockAllDomainsDurationInMs() const; | 198 int64 GetBlockAllDomainsDurationInMs() const; |
203 | 199 |
204 bool complete_gpu_info_already_requested_; | 200 bool complete_gpu_info_already_requested_; |
205 | 201 |
206 std::set<int> blacklisted_features_; | 202 std::set<int> blacklisted_features_; |
207 std::set<int> preliminary_blacklisted_features_; | 203 std::set<int> preliminary_blacklisted_features_; |
208 | 204 |
209 gpu::GpuSwitchingOption gpu_switching_; | |
210 | |
211 std::set<int> gpu_driver_bugs_; | 205 std::set<int> gpu_driver_bugs_; |
212 | 206 |
213 gpu::GPUInfo gpu_info_; | 207 gpu::GPUInfo gpu_info_; |
214 | 208 |
215 scoped_ptr<gpu::GpuBlacklist> gpu_blacklist_; | 209 scoped_ptr<gpu::GpuBlacklist> gpu_blacklist_; |
216 scoped_ptr<gpu::GpuSwitchingList> gpu_switching_list_; | |
217 scoped_ptr<gpu::GpuDriverBugList> gpu_driver_bug_list_; | 210 scoped_ptr<gpu::GpuDriverBugList> gpu_driver_bug_list_; |
218 | 211 |
219 const scoped_refptr<GpuDataManagerObserverList> observer_list_; | 212 const scoped_refptr<GpuDataManagerObserverList> observer_list_; |
220 | 213 |
221 base::ListValue log_messages_; | 214 base::ListValue log_messages_; |
222 | 215 |
223 bool use_swiftshader_; | 216 bool use_swiftshader_; |
224 | 217 |
225 base::FilePath swiftshader_path_; | 218 base::FilePath swiftshader_path_; |
226 | 219 |
(...skipping 23 matching lines...) Expand all Loading... |
250 // True if all future Initialize calls should be ignored. | 243 // True if all future Initialize calls should be ignored. |
251 bool finalized_; | 244 bool finalized_; |
252 | 245 |
253 DISALLOW_COPY_AND_ASSIGN(GpuDataManagerImplPrivate); | 246 DISALLOW_COPY_AND_ASSIGN(GpuDataManagerImplPrivate); |
254 }; | 247 }; |
255 | 248 |
256 } // namespace content | 249 } // namespace content |
257 | 250 |
258 #endif // CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_IMPL_PRIVATE_H_ | 251 #endif // CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_IMPL_PRIVATE_H_ |
259 | 252 |
OLD | NEW |