| 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/common/gpu/gpu_memory_manager.h" | 5 #include "content/common/gpu/gpu_memory_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
| 12 #include "base/process/process_handle.h" | 12 #include "base/process/process_handle.h" |
| 13 #include "base/strings/string_number_conversions.h" | 13 #include "base/strings/string_number_conversions.h" |
| 14 #include "base/trace_event/trace_event.h" | 14 #include "base/trace_event/trace_event.h" |
| 15 #include "content/common/gpu/gpu_channel_manager.h" | 15 #include "content/common/gpu/gpu_channel_manager.h" |
| 16 #include "content/common/gpu/gpu_channel_manager_delegate.h" | 16 #include "content/common/gpu/gpu_channel_manager_delegate.h" |
| 17 #include "content/common/gpu/gpu_memory_tracking.h" | 17 #include "content/common/gpu/gpu_memory_tracking.h" |
| 18 #include "content/common/gpu/gpu_memory_uma_stats.h" | |
| 19 #include "gpu/command_buffer/common/gpu_memory_allocation.h" | 18 #include "gpu/command_buffer/common/gpu_memory_allocation.h" |
| 20 #include "gpu/command_buffer/service/gpu_switches.h" | 19 #include "gpu/command_buffer/service/gpu_switches.h" |
| 20 #include "gpu/ipc/common/gpu_memory_uma_stats.h" |
| 21 #include "gpu/ipc/common/memory_stats.h" | 21 #include "gpu/ipc/common/memory_stats.h" |
| 22 | 22 |
| 23 using gpu::MemoryAllocation; | 23 using gpu::MemoryAllocation; |
| 24 | 24 |
| 25 namespace content { | 25 namespace content { |
| 26 namespace { | 26 namespace { |
| 27 | 27 |
| 28 const uint64_t kBytesAllocatedStep = 16 * 1024 * 1024; | 28 const uint64_t kBytesAllocatedStep = 16 * 1024 * 1024; |
| 29 | 29 |
| 30 void TrackValueChanged(uint64_t old_size, | 30 void TrackValueChanged(uint64_t old_size, |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 void GpuMemoryManager::SendUmaStatsToHost() { | 116 void GpuMemoryManager::SendUmaStatsToHost() { |
| 117 if (!channel_manager_) | 117 if (!channel_manager_) |
| 118 return; | 118 return; |
| 119 GPUMemoryUmaStats params; | 119 GPUMemoryUmaStats params; |
| 120 params.bytes_allocated_current = GetCurrentUsage(); | 120 params.bytes_allocated_current = GetCurrentUsage(); |
| 121 params.bytes_allocated_max = bytes_allocated_historical_max_; | 121 params.bytes_allocated_max = bytes_allocated_historical_max_; |
| 122 params.context_group_count = static_cast<uint32_t>(tracking_groups_.size()); | 122 params.context_group_count = static_cast<uint32_t>(tracking_groups_.size()); |
| 123 channel_manager_->delegate()->GpuMemoryUmaStats(params); | 123 channel_manager_->delegate()->GpuMemoryUmaStats(params); |
| 124 } | 124 } |
| 125 } // namespace content | 125 } // namespace content |
| OLD | NEW |