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

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: 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 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after
1032 } 1032 }
1033 1033
1034 void ResourceProvider::Initialize() { 1034 void ResourceProvider::Initialize() {
1035 DCHECK(thread_checker_.CalledOnValidThread()); 1035 DCHECK(thread_checker_.CalledOnValidThread());
1036 1036
1037 // In certain cases, ThreadTaskRunnerHandle isn't set (Android Webview). 1037 // In certain cases, ThreadTaskRunnerHandle isn't set (Android Webview).
1038 // Don't register a dump provider in these cases. 1038 // Don't register a dump provider in these cases.
1039 // TODO(ericrk): Get this working in Android Webview. crbug.com/517156 1039 // TODO(ericrk): Get this working in Android Webview. crbug.com/517156
1040 if (base::ThreadTaskRunnerHandle::IsSet()) { 1040 if (base::ThreadTaskRunnerHandle::IsSet()) {
1041 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( 1041 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
1042 this, base::ThreadTaskRunnerHandle::Get()); 1042 this, "cc::ResourceProvider", base::ThreadTaskRunnerHandle::Get());
1043 } 1043 }
1044 1044
1045 GLES2Interface* gl = ContextGL(); 1045 GLES2Interface* gl = ContextGL();
1046 if (!gl) { 1046 if (!gl) {
1047 default_resource_type_ = RESOURCE_TYPE_BITMAP; 1047 default_resource_type_ = RESOURCE_TYPE_BITMAP;
1048 // Pick an arbitrary limit here similar to what hardware might. 1048 // Pick an arbitrary limit here similar to what hardware might.
1049 max_texture_size_ = 16 * 1024; 1049 max_texture_size_ = 16 * 1024;
1050 best_texture_format_ = RGBA_8888; 1050 best_texture_format_ = RGBA_8888;
1051 return; 1051 return;
1052 } 1052 }
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
1640 const int kImportance = 2; 1640 const int kImportance = 2;
1641 pmd->CreateSharedGlobalAllocatorDump(guid); 1641 pmd->CreateSharedGlobalAllocatorDump(guid);
1642 pmd->AddOwnershipEdge(dump->guid(), guid, kImportance); 1642 pmd->AddOwnershipEdge(dump->guid(), guid, kImportance);
1643 } 1643 }
1644 } 1644 }
1645 1645
1646 return true; 1646 return true;
1647 } 1647 }
1648 1648
1649 } // namespace cc 1649 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698