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

Side by Side Diff: content/common/gpu/gpu_channel.cc

Issue 1262333005: [tracing] Introduce MemoryDumpArgs to enable light and heavy dumps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years, 4 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
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 #if defined(OS_WIN) 5 #if defined(OS_WIN)
6 #include <windows.h> 6 #include <windows.h>
7 #endif 7 #endif
8 8
9 #include "content/common/gpu/gpu_channel.h" 9 #include "content/common/gpu/gpu_channel.h"
10 10
(...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after
891 client_id_); 891 client_id_);
892 } 892 }
893 } 893 }
894 } 894 }
895 895
896 void GpuChannel::HandleUpdateValueState( 896 void GpuChannel::HandleUpdateValueState(
897 unsigned int target, const gpu::ValueState& state) { 897 unsigned int target, const gpu::ValueState& state) {
898 pending_valuebuffer_state_->UpdateState(target, state); 898 pending_valuebuffer_state_->UpdateState(target, state);
899 } 899 }
900 900
901 bool GpuChannel::OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd) { 901 bool GpuChannel::OnMemoryDump(const base::trace_event::MemoryDumpArgs& args,
902 base::trace_event::ProcessMemoryDump* pmd) {
902 auto dump_name = GetChannelName(); 903 auto dump_name = GetChannelName();
903 std::replace(dump_name.begin(), dump_name.end(), '.', '_'); 904 std::replace(dump_name.begin(), dump_name.end(), '.', '_');
904 905
905 base::trace_event::MemoryAllocatorDump* dump = 906 base::trace_event::MemoryAllocatorDump* dump =
906 pmd->CreateAllocatorDump(base::StringPrintf("gl/%s", dump_name.c_str())); 907 pmd->CreateAllocatorDump(base::StringPrintf("gl/%s", dump_name.c_str()));
907 908
908 dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize, 909 dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize,
909 base::trace_event::MemoryAllocatorDump::kUnitsBytes, 910 base::trace_event::MemoryAllocatorDump::kUnitsBytes,
910 GetMemoryUsage()); 911 GetMemoryUsage());
911 912
912 return true; 913 return true;
913 } 914 }
914 915
915 } // namespace content 916 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/gpu_channel.h ('k') | content/common/host_discardable_shared_memory_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698