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

Side by Side Diff: cc/resources/resource_provider.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 "cc/resources/resource_provider.h" 5 #include "cc/resources/resource_provider.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/containers/hash_tables.h" 10 #include "base/containers/hash_tables.h"
(...skipping 1950 matching lines...) Expand 10 before | Expand all | Expand 10 after
1961 return context_provider ? context_provider->ContextGL() : NULL; 1961 return context_provider ? context_provider->ContextGL() : NULL;
1962 } 1962 }
1963 1963
1964 class GrContext* ResourceProvider::GrContext(bool worker_context) const { 1964 class GrContext* ResourceProvider::GrContext(bool worker_context) const {
1965 ContextProvider* context_provider = 1965 ContextProvider* context_provider =
1966 worker_context ? output_surface_->worker_context_provider() 1966 worker_context ? output_surface_->worker_context_provider()
1967 : output_surface_->context_provider(); 1967 : output_surface_->context_provider();
1968 return context_provider ? context_provider->GrContext() : NULL; 1968 return context_provider ? context_provider->GrContext() : NULL;
1969 } 1969 }
1970 1970
1971 bool ResourceProvider::OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd) { 1971 bool ResourceProvider::OnMemoryDump(
1972 const base::trace_event::MemoryDumpArgs& args,
1973 base::trace_event::ProcessMemoryDump* pmd) {
1972 DCHECK(thread_checker_.CalledOnValidThread()); 1974 DCHECK(thread_checker_.CalledOnValidThread());
1973 1975
1974 const uint64 tracing_process_id = 1976 const uint64 tracing_process_id =
1975 base::trace_event::MemoryDumpManager::GetInstance() 1977 base::trace_event::MemoryDumpManager::GetInstance()
1976 ->GetTracingProcessId(); 1978 ->GetTracingProcessId();
1977 1979
1978 for (const auto& resource_entry : resources_) { 1980 for (const auto& resource_entry : resources_) {
1979 const auto& resource = resource_entry.second; 1981 const auto& resource = resource_entry.second;
1980 1982
1981 std::string dump_name = base::StringPrintf("cc/resource_memory/resource_%d", 1983 std::string dump_name = base::StringPrintf("cc/resource_memory/resource_%d",
(...skipping 25 matching lines...) Expand all
2007 const int kImportance = 2; 2009 const int kImportance = 2;
2008 pmd->CreateSharedGlobalAllocatorDump(guid); 2010 pmd->CreateSharedGlobalAllocatorDump(guid);
2009 pmd->AddOwnershipEdge(dump->guid(), guid, kImportance); 2011 pmd->AddOwnershipEdge(dump->guid(), guid, kImportance);
2010 } 2012 }
2011 } 2013 }
2012 2014
2013 return true; 2015 return true;
2014 } 2016 }
2015 2017
2016 } // namespace cc 2018 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/resource_provider.h ('k') | content/browser/gpu/browser_gpu_memory_buffer_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698