Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(233)

Side by Side Diff: content/browser/gpu/gpu_process_host.cc

Issue 17074009: Created multi-process-friendly PowerMonitor interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressing Feedback Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698