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

Side by Side Diff: cc/resources/resource_provider.cc

Issue 1406213005: [tracing] Add names to memory-infra dumpers for debugging (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@memory-infra-runtime
Patch Set: Rebase + fix android 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
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/atomic_sequence_num.h" 10 #include "base/atomic_sequence_num.h"
(...skipping 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after
1029 } 1029 }
1030 1030
1031 void ResourceProvider::Initialize() { 1031 void ResourceProvider::Initialize() {
1032 DCHECK(thread_checker_.CalledOnValidThread()); 1032 DCHECK(thread_checker_.CalledOnValidThread());
1033 1033
1034 // In certain cases, ThreadTaskRunnerHandle isn't set (Android Webview). 1034 // In certain cases, ThreadTaskRunnerHandle isn't set (Android Webview).
1035 // Don't register a dump provider in these cases. 1035 // Don't register a dump provider in these cases.
1036 // TODO(ericrk): Get this working in Android Webview. crbug.com/517156 1036 // TODO(ericrk): Get this working in Android Webview. crbug.com/517156
1037 if (base::ThreadTaskRunnerHandle::IsSet()) { 1037 if (base::ThreadTaskRunnerHandle::IsSet()) {
1038 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( 1038 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
1039 this, base::ThreadTaskRunnerHandle::Get()); 1039 this, "cc::ResourceProvider", base::ThreadTaskRunnerHandle::Get());
1040 } 1040 }
1041 1041
1042 GLES2Interface* gl = ContextGL(); 1042 GLES2Interface* gl = ContextGL();
1043 if (!gl) { 1043 if (!gl) {
1044 default_resource_type_ = RESOURCE_TYPE_BITMAP; 1044 default_resource_type_ = RESOURCE_TYPE_BITMAP;
1045 // Pick an arbitrary limit here similar to what hardware might. 1045 // Pick an arbitrary limit here similar to what hardware might.
1046 max_texture_size_ = 16 * 1024; 1046 max_texture_size_ = 16 * 1024;
1047 best_texture_format_ = RGBA_8888; 1047 best_texture_format_ = RGBA_8888;
1048 return; 1048 return;
1049 } 1049 }
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
1637 const int kImportance = 2; 1637 const int kImportance = 2;
1638 pmd->CreateSharedGlobalAllocatorDump(guid); 1638 pmd->CreateSharedGlobalAllocatorDump(guid);
1639 pmd->AddOwnershipEdge(dump->guid(), guid, kImportance); 1639 pmd->AddOwnershipEdge(dump->guid(), guid, kImportance);
1640 } 1640 }
1641 } 1641 }
1642 1642
1643 return true; 1643 return true;
1644 } 1644 }
1645 1645
1646 } // namespace cc 1646 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/resource_pool.cc ('k') | components/tracing/child_trace_message_filter_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698