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 #include "content/browser/gpu/gpu_data_manager_impl_private.h" | 5 #include "content/browser/gpu/gpu_data_manager_impl_private.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <iterator> | 8 #include <iterator> |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 bool ShouldDisableHardwareAcceleration() { | 269 bool ShouldDisableHardwareAcceleration() { |
270 return base::CommandLine::ForCurrentProcess()->HasSwitch( | 270 return base::CommandLine::ForCurrentProcess()->HasSwitch( |
271 switches::kDisableGpu); | 271 switches::kDisableGpu); |
272 } | 272 } |
273 | 273 |
274 void OnVideoMemoryUsageStats(const gpu::VideoMemoryUsageStats& stats) { | 274 void OnVideoMemoryUsageStats(const gpu::VideoMemoryUsageStats& stats) { |
275 GpuDataManagerImpl::GetInstance()->UpdateVideoMemoryUsageStats(stats); | 275 GpuDataManagerImpl::GetInstance()->UpdateVideoMemoryUsageStats(stats); |
276 } | 276 } |
277 | 277 |
278 void RequestVideoMemoryUsageStats(GpuProcessHost* host) { | 278 void RequestVideoMemoryUsageStats(GpuProcessHost* host) { |
| 279 if (!host) |
| 280 return; |
279 host->gpu_service()->GetVideoMemoryUsageStats( | 281 host->gpu_service()->GetVideoMemoryUsageStats( |
280 base::Bind(&OnVideoMemoryUsageStats)); | 282 base::Bind(&OnVideoMemoryUsageStats)); |
281 } | 283 } |
282 | 284 |
283 } // namespace anonymous | 285 } // namespace anonymous |
284 | 286 |
285 void GpuDataManagerImplPrivate::InitializeForTesting( | 287 void GpuDataManagerImplPrivate::InitializeForTesting( |
286 const std::string& gpu_blacklist_json, | 288 const std::string& gpu_blacklist_json, |
287 const gpu::GPUInfo& gpu_info) { | 289 const gpu::GPUInfo& gpu_info) { |
288 // This function is for testing only, so disable histograms. | 290 // This function is for testing only, so disable histograms. |
(...skipping 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1372 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; | 1374 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; |
1373 #if defined(OS_WIN) | 1375 #if defined(OS_WIN) |
1374 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; | 1376 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; |
1375 #endif | 1377 #endif |
1376 complete_gpu_info_already_requested_ = true; | 1378 complete_gpu_info_already_requested_ = true; |
1377 // Some observers might be waiting. | 1379 // Some observers might be waiting. |
1378 NotifyGpuInfoUpdate(); | 1380 NotifyGpuInfoUpdate(); |
1379 } | 1381 } |
1380 | 1382 |
1381 } // namespace content | 1383 } // namespace content |
OLD | NEW |