summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlukasza <lukasza@chromium.org>2016-01-07 16:13:18 -0800
committerCommit bot <commit-bot@chromium.org>2016-01-08 00:15:07 +0000
commitcf4cad0723200734c283dae2d0c92a88054713f6 (patch)
tree7b1159486bcc2ce43c8ddc1f5c472d2af117bada
parentfd8628f36798e7bb989a7c70c25fbefeca7dac79 (diff)
downloadchromium_src-cf4cad0723200734c283dae2d0c92a88054713f6.zip
chromium_src-cf4cad0723200734c283dae2d0c92a88054713f6.tar.gz
chromium_src-cf4cad0723200734c283dae2d0c92a88054713f6.tar.bz2
Revert of Don't dump not-yet-allocated resources. (patchset #2 id:20001 of https://codereview.chromium.org/1547453002/ )
Reason for revert: primiano@ points out that this is the main suspect for 575377. Original issue's description: > Don't dump not-yet-allocated resources. > > Currently the ResourceProvider dumps resources which have not yet been > allocated - it just does not assign them with a global edge. This isn't > really correct, as these resoruces have no backing memory and should not > be contributing to totals. This CL removes these resources from the dump > and cleans up the logic that generates global edges to be clearer about > what is expected. > > BUG= > CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel > > Committed: https://crrev.com/fe2a79471f6318413426d51ead7f9d1e43ffb2ed > Cr-Commit-Position: refs/heads/master@{#368137} TBR=reveman@chromium.org,ssid@chromium.org,ericrk@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG= Review URL: https://codereview.chromium.org/1571533002 Cr-Commit-Position: refs/heads/master@{#368210}
-rw-r--r--cc/resources/resource_provider.cc46
1 files changed, 19 insertions, 27 deletions
diff --git a/cc/resources/resource_provider.cc b/cc/resources/resource_provider.cc
index 05bae2c..f1a4cf2 100644
--- a/cc/resources/resource_provider.cc
+++ b/cc/resources/resource_provider.cc
@@ -1656,11 +1656,6 @@ bool ResourceProvider::OnMemoryDump(
for (const auto& resource_entry : resources_) {
const auto& resource = resource_entry.second;
- if (!resource.allocated) {
- // Don't log unallocated resources - they have no backing memory.
- continue;
- }
-
// Resource IDs are not process-unique, so log with the ResourceProvider's
// unique id.
std::string dump_name =
@@ -1675,31 +1670,28 @@ bool ResourceProvider::OnMemoryDump(
base::trace_event::MemoryAllocatorDump::kUnitsBytes,
static_cast<uint64_t>(total_bytes));
- // Resources may be shared across processes and require a shared GUID to
- // prevent double counting the memory.
+ // Resources which are shared across processes require a shared GUID to
+ // prevent double counting the memory. We currently support shared GUIDs for
+ // GpuMemoryBuffer, SharedBitmap, and GL backed resources.
base::trace_event::MemoryAllocatorDumpGuid guid;
- switch (resource.type) {
- case RESOURCE_TYPE_GPU_MEMORY_BUFFER:
- guid = gfx::GetGpuMemoryBufferGUIDForTracing(
- tracing_process_id, resource.gpu_memory_buffer->GetHandle().id);
- break;
- case RESOURCE_TYPE_GL_TEXTURE:
- guid = gfx::GetGLTextureClientGUIDForTracing(
- output_surface_->context_provider()
- ->ContextSupport()
- ->ShareGroupTracingGUID(),
- resource.gl_id);
- break;
- case RESOURCE_TYPE_BITMAP:
- guid = GetSharedBitmapGUIDForTracing(resource.shared_bitmap->id());
- break;
+ if (resource.gpu_memory_buffer) {
+ guid = gfx::GetGpuMemoryBufferGUIDForTracing(
+ tracing_process_id, resource.gpu_memory_buffer->GetHandle().id);
+ } else if (resource.shared_bitmap) {
+ guid = GetSharedBitmapGUIDForTracing(resource.shared_bitmap->id());
+ } else if (resource.gl_id && resource.allocated) {
+ guid = gfx::GetGLTextureClientGUIDForTracing(
+ output_surface_->context_provider()
+ ->ContextSupport()
+ ->ShareGroupTracingGUID(),
+ resource.gl_id);
}
- DCHECK(!guid.empty());
-
- const int kImportance = 2;
- pmd->CreateSharedGlobalAllocatorDump(guid);
- pmd->AddOwnershipEdge(dump->guid(), guid, kImportance);
+ if (!guid.empty()) {
+ const int kImportance = 2;
+ pmd->CreateSharedGlobalAllocatorDump(guid);
+ pmd->AddOwnershipEdge(dump->guid(), guid, kImportance);
+ }
}
return true;