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

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 piman feedback [Part 2] 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 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 g_gpu_process_hosts[kind] = this; 433 g_gpu_process_hosts[kind] = this;
434 434
435 // Post a task to create the corresponding GpuProcessHostUIShim. The 435 // Post a task to create the corresponding GpuProcessHostUIShim. The
436 // GpuProcessHostUIShim will be destroyed if either the browser exits, 436 // GpuProcessHostUIShim will be destroyed if either the browser exits,
437 // in which case it calls GpuProcessHostUIShim::DestroyAll, or the 437 // in which case it calls GpuProcessHostUIShim::DestroyAll, or the
438 // GpuProcessHost is destroyed, which happens when the corresponding GPU 438 // GpuProcessHost is destroyed, which happens when the corresponding GPU
439 // process terminates or fails to launch. 439 // process terminates or fails to launch.
440 BrowserThread::PostTask( 440 BrowserThread::PostTask(
441 BrowserThread::UI, 441 BrowserThread::UI,
442 FROM_HERE, 442 FROM_HERE,
443 base::Bind(base::IgnoreResult(&GpuProcessHostUIShim::Create), host_id)); 443 base::Bind(base::IgnoreResult(&GpuProcessHostUIShim::Create),
444 host_id, in_process_));
444 445
445 process_.reset(new BrowserChildProcessHostImpl(PROCESS_TYPE_GPU, this)); 446 process_.reset(new BrowserChildProcessHostImpl(PROCESS_TYPE_GPU, this));
446 } 447 }
447 448
448 GpuProcessHost::~GpuProcessHost() { 449 GpuProcessHost::~GpuProcessHost() {
449 DCHECK(CalledOnValidThread()); 450 DCHECK(CalledOnValidThread());
450 451
451 SendOutstandingReplies(); 452 SendOutstandingReplies();
452 453
453 // Maximum number of times the gpu process is allowed to crash in a session. 454 // Maximum number of times the gpu process is allowed to crash in a session.
(...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after
1270 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); 1271 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader");
1271 ClientIdToShaderCacheMap::iterator iter = 1272 ClientIdToShaderCacheMap::iterator iter =
1272 client_id_to_shader_cache_.find(client_id); 1273 client_id_to_shader_cache_.find(client_id);
1273 // If the cache doesn't exist then this is an off the record profile. 1274 // If the cache doesn't exist then this is an off the record profile.
1274 if (iter == client_id_to_shader_cache_.end()) 1275 if (iter == client_id_to_shader_cache_.end())
1275 return; 1276 return;
1276 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); 1277 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader);
1277 } 1278 }
1278 1279
1279 } // namespace content 1280 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698