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/base_switches.h" | 7 #include "base/base_switches.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 } | 425 } |
426 | 426 |
427 int exit_code; | 427 int exit_code; |
428 base::TerminationStatus status = process_->GetTerminationStatus(&exit_code); | 428 base::TerminationStatus status = process_->GetTerminationStatus(&exit_code); |
429 UMA_HISTOGRAM_ENUMERATION("GPU.GPUProcessTerminationStatus", | 429 UMA_HISTOGRAM_ENUMERATION("GPU.GPUProcessTerminationStatus", |
430 status, | 430 status, |
431 base::TERMINATION_STATUS_MAX_ENUM); | 431 base::TERMINATION_STATUS_MAX_ENUM); |
432 | 432 |
433 UMA_HISTOGRAM_COUNTS_100("GPU.AtExitSurfaceCount", | 433 UMA_HISTOGRAM_COUNTS_100("GPU.AtExitSurfaceCount", |
434 GpuSurfaceTracker::Get()->GetSurfaceCount()); | 434 GpuSurfaceTracker::Get()->GetSurfaceCount()); |
435 | |
436 UMA_HISTOGRAM_BOOLEAN("GPU.AtExitReceivedMemoryStats", | 435 UMA_HISTOGRAM_BOOLEAN("GPU.AtExitReceivedMemoryStats", |
437 uma_memory_stats_received_); | 436 uma_memory_stats_received_); |
438 | 437 |
439 if (uma_memory_stats_received_) { | 438 if (uma_memory_stats_received_) { |
440 UMA_HISTOGRAM_COUNTS_100("GPU.AtExitWindowCount", | |
441 uma_memory_stats_.window_count); | |
442 UMA_HISTOGRAM_COUNTS_100("GPU.AtExitManagedMemoryClientCount", | 439 UMA_HISTOGRAM_COUNTS_100("GPU.AtExitManagedMemoryClientCount", |
443 uma_memory_stats_.client_count); | 440 uma_memory_stats_.client_count); |
444 UMA_HISTOGRAM_COUNTS_100("GPU.AtExitContextGroupCount", | 441 UMA_HISTOGRAM_COUNTS_100("GPU.AtExitContextGroupCount", |
445 uma_memory_stats_.context_group_count); | 442 uma_memory_stats_.context_group_count); |
446 UMA_HISTOGRAM_CUSTOM_COUNTS( | 443 UMA_HISTOGRAM_CUSTOM_COUNTS( |
447 "GPU.AtExitMBytesAllocated", | 444 "GPU.AtExitMBytesAllocated", |
448 uma_memory_stats_.bytes_allocated_current / 1024 / 1024, 1, 2000, 50); | 445 uma_memory_stats_.bytes_allocated_current / 1024 / 1024, 1, 2000, 50); |
449 UMA_HISTOGRAM_CUSTOM_COUNTS( | 446 UMA_HISTOGRAM_CUSTOM_COUNTS( |
450 "GPU.AtExitMBytesAllocatedMax", | 447 "GPU.AtExitMBytesAllocatedMax", |
451 uma_memory_stats_.bytes_allocated_max / 1024 / 1024, 1, 2000, 50); | 448 uma_memory_stats_.bytes_allocated_max / 1024 / 1024, 1, 2000, 50); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 in_process_gpu_thread_->Start(); | 518 in_process_gpu_thread_->Start(); |
522 | 519 |
523 OnProcessLaunched(); // Fake a callback that the process is ready. | 520 OnProcessLaunched(); // Fake a callback that the process is ready. |
524 } else if (!LaunchGpuProcess(channel_id)) { | 521 } else if (!LaunchGpuProcess(channel_id)) { |
525 return false; | 522 return false; |
526 } | 523 } |
527 | 524 |
528 if (!Send(new GpuMsg_Initialize())) | 525 if (!Send(new GpuMsg_Initialize())) |
529 return false; | 526 return false; |
530 | 527 |
531 return Send(new GpuMsg_SetVideoMemoryWindowCount( | 528 return true; |
532 GpuDataManagerImpl::GetInstance()->GetWindowCount())); | |
533 } | 529 } |
534 | 530 |
535 void GpuProcessHost::RouteOnUIThread(const IPC::Message& message) { | 531 void GpuProcessHost::RouteOnUIThread(const IPC::Message& message) { |
536 BrowserThread::PostTask( | 532 BrowserThread::PostTask( |
537 BrowserThread::UI, | 533 BrowserThread::UI, |
538 FROM_HERE, | 534 FROM_HERE, |
539 base::Bind(&RouteToGpuProcessHostUIShimTask, host_id_, message)); | 535 base::Bind(&RouteToGpuProcessHostUIShimTask, host_id_, message)); |
540 } | 536 } |
541 | 537 |
542 bool GpuProcessHost::Send(IPC::Message* msg) { | 538 bool GpuProcessHost::Send(IPC::Message* msg) { |
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1089 void GpuProcessHost::BlockLiveOffscreenContexts() { | 1085 void GpuProcessHost::BlockLiveOffscreenContexts() { |
1090 for (std::multiset<GURL>::iterator iter = | 1086 for (std::multiset<GURL>::iterator iter = |
1091 urls_with_live_offscreen_contexts_.begin(); | 1087 urls_with_live_offscreen_contexts_.begin(); |
1092 iter != urls_with_live_offscreen_contexts_.end(); ++iter) { | 1088 iter != urls_with_live_offscreen_contexts_.end(); ++iter) { |
1093 GpuDataManagerImpl::GetInstance()->BlockDomainFrom3DAPIs( | 1089 GpuDataManagerImpl::GetInstance()->BlockDomainFrom3DAPIs( |
1094 *iter, GpuDataManagerImpl::DOMAIN_GUILT_UNKNOWN); | 1090 *iter, GpuDataManagerImpl::DOMAIN_GUILT_UNKNOWN); |
1095 } | 1091 } |
1096 } | 1092 } |
1097 | 1093 |
1098 } // namespace content | 1094 } // namespace content |
OLD | NEW |