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

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

Issue 1420533009: Cleanup GpuMemoryManager and helpers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more cleanup. Created 5 years, 1 month 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
« no previous file with comments | « no previous file | content/common/gpu/gpu_channel_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 // GPU process exits, assume something went wrong, and block their 463 // GPU process exits, assume something went wrong, and block their
464 // URLs from accessing client 3D APIs without prompting. 464 // URLs from accessing client 3D APIs without prompting.
465 BlockLiveOffscreenContexts(); 465 BlockLiveOffscreenContexts();
466 466
467 UMA_HISTOGRAM_COUNTS_100("GPU.AtExitSurfaceCount", 467 UMA_HISTOGRAM_COUNTS_100("GPU.AtExitSurfaceCount",
468 GpuSurfaceTracker::Get()->GetSurfaceCount()); 468 GpuSurfaceTracker::Get()->GetSurfaceCount());
469 UMA_HISTOGRAM_BOOLEAN("GPU.AtExitReceivedMemoryStats", 469 UMA_HISTOGRAM_BOOLEAN("GPU.AtExitReceivedMemoryStats",
470 uma_memory_stats_received_); 470 uma_memory_stats_received_);
471 471
472 if (uma_memory_stats_received_) { 472 if (uma_memory_stats_received_) {
473 UMA_HISTOGRAM_COUNTS_100("GPU.AtExitManagedMemoryClientCount",
474 uma_memory_stats_.client_count);
475 UMA_HISTOGRAM_COUNTS_100("GPU.AtExitContextGroupCount", 473 UMA_HISTOGRAM_COUNTS_100("GPU.AtExitContextGroupCount",
476 uma_memory_stats_.context_group_count); 474 uma_memory_stats_.context_group_count);
477 UMA_HISTOGRAM_CUSTOM_COUNTS( 475 UMA_HISTOGRAM_CUSTOM_COUNTS(
478 "GPU.AtExitMBytesAllocated", 476 "GPU.AtExitMBytesAllocated",
479 uma_memory_stats_.bytes_allocated_current / 1024 / 1024, 1, 2000, 50); 477 uma_memory_stats_.bytes_allocated_current / 1024 / 1024, 1, 2000, 50);
480 UMA_HISTOGRAM_CUSTOM_COUNTS( 478 UMA_HISTOGRAM_CUSTOM_COUNTS(
481 "GPU.AtExitMBytesAllocatedMax", 479 "GPU.AtExitMBytesAllocatedMax",
482 uma_memory_stats_.bytes_allocated_max / 1024 / 1024, 1, 2000, 50); 480 uma_memory_stats_.bytes_allocated_max / 1024 / 1024, 1, 2000, 50);
483 UMA_HISTOGRAM_CUSTOM_COUNTS(
484 "GPU.AtExitMBytesLimit",
485 uma_memory_stats_.bytes_limit / 1024 / 1024, 1, 2000, 50);
486 } 481 }
487 482
488 std::string message; 483 std::string message;
489 if (!in_process_) { 484 if (!in_process_) {
490 int exit_code; 485 int exit_code;
491 base::TerminationStatus status = process_->GetTerminationStatus( 486 base::TerminationStatus status = process_->GetTerminationStatus(
492 false /* known_dead */, &exit_code); 487 false /* known_dead */, &exit_code);
493 UMA_HISTOGRAM_ENUMERATION("GPU.GPUProcessTerminationStatus", 488 UMA_HISTOGRAM_ENUMERATION("GPU.GPUProcessTerminationStatus",
494 status, 489 status,
495 base::TERMINATION_STATUS_MAX_ENUM); 490 base::TERMINATION_STATUS_MAX_ENUM);
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after
1173 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); 1168 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader");
1174 ClientIdToShaderCacheMap::iterator iter = 1169 ClientIdToShaderCacheMap::iterator iter =
1175 client_id_to_shader_cache_.find(client_id); 1170 client_id_to_shader_cache_.find(client_id);
1176 // If the cache doesn't exist then this is an off the record profile. 1171 // If the cache doesn't exist then this is an off the record profile.
1177 if (iter == client_id_to_shader_cache_.end()) 1172 if (iter == client_id_to_shader_cache_.end())
1178 return; 1173 return;
1179 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); 1174 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader);
1180 } 1175 }
1181 1176
1182 } // namespace content 1177 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/common/gpu/gpu_channel_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698