OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_process_host.h" | 5 #include "content/browser/gpu/gpu_process_host.h" |
6 | 6 |
7 #include "base/base64.h" | 7 #include "base/base64.h" |
8 #include "base/base_switches.h" | 8 #include "base/base_switches.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 } | 422 } |
423 | 423 |
424 GpuProcessHost::GpuProcessHost(int host_id, GpuProcessKind kind) | 424 GpuProcessHost::GpuProcessHost(int host_id, GpuProcessKind kind) |
425 : host_id_(host_id), | 425 : host_id_(host_id), |
426 valid_(true), | 426 valid_(true), |
427 in_process_(false), | 427 in_process_(false), |
428 swiftshader_rendering_(false), | 428 swiftshader_rendering_(false), |
429 kind_(kind), | 429 kind_(kind), |
430 process_launched_(false), | 430 process_launched_(false), |
431 initialized_(false), | 431 initialized_(false), |
432 uma_memory_stats_received_(false) { | 432 uma_memory_stats_received_(false), |
| 433 power_monitor_broadcaster_(this) { |
433 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess) || | 434 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess) || |
434 CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessGPU)) { | 435 CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessGPU)) { |
435 in_process_ = true; | 436 in_process_ = true; |
436 } | 437 } |
437 | 438 |
438 // If the 'single GPU process' policy ever changes, we still want to maintain | 439 // If the 'single GPU process' policy ever changes, we still want to maintain |
439 // it for 'gpu thread' mode and only create one instance of host and thread. | 440 // it for 'gpu thread' mode and only create one instance of host and thread. |
440 DCHECK(!in_process_ || g_gpu_process_hosts[kind] == NULL); | 441 DCHECK(!in_process_ || g_gpu_process_hosts[kind] == NULL); |
441 | 442 |
442 g_gpu_process_hosts[kind] = this; | 443 g_gpu_process_hosts[kind] = this; |
(...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1276 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); | 1277 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); |
1277 ClientIdToShaderCacheMap::iterator iter = | 1278 ClientIdToShaderCacheMap::iterator iter = |
1278 client_id_to_shader_cache_.find(client_id); | 1279 client_id_to_shader_cache_.find(client_id); |
1279 // If the cache doesn't exist then this is an off the record profile. | 1280 // If the cache doesn't exist then this is an off the record profile. |
1280 if (iter == client_id_to_shader_cache_.end()) | 1281 if (iter == client_id_to_shader_cache_.end()) |
1281 return; | 1282 return; |
1282 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); | 1283 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); |
1283 } | 1284 } |
1284 | 1285 |
1285 } // namespace content | 1286 } // namespace content |
OLD | NEW |