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

Unified Diff: cc/raster/staging_buffer_pool.cc

Issue 2467973004: Revert of Add BACKGROUND dump mode to various GPU/CC MemoryDumpProviders (Closed)
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | cc/resources/resource_pool.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/raster/staging_buffer_pool.cc
diff --git a/cc/raster/staging_buffer_pool.cc b/cc/raster/staging_buffer_pool.cc
index ef78e4d317e60f4a8f3b3b5ca1298a05446fb60d..0e2a88a14a7f84fa26e17b42c8e320c702438eca 100644
--- a/cc/raster/staging_buffer_pool.cc
+++ b/cc/raster/staging_buffer_pool.cc
@@ -17,10 +17,6 @@
#include "gpu/command_buffer/client/gles2_interface.h"
#include "ui/gfx/gpu_memory_buffer_tracing.h"
-using base::trace_event::MemoryAllocatorDump;
-using base::trace_event::MemoryAllocatorDumpGuid;
-using base::trace_event::MemoryDumpLevelOfDetail;
-
namespace cc {
namespace {
@@ -100,21 +96,23 @@
gfx::GpuMemoryBufferId buffer_id = gpu_memory_buffer->GetId();
std::string buffer_dump_name =
base::StringPrintf("cc/one_copy/staging_memory/buffer_%d", buffer_id.id);
- MemoryAllocatorDump* buffer_dump = pmd->CreateAllocatorDump(buffer_dump_name);
+ base::trace_event::MemoryAllocatorDump* buffer_dump =
+ pmd->CreateAllocatorDump(buffer_dump_name);
uint64_t buffer_size_in_bytes =
ResourceUtil::UncheckedSizeInBytes<uint64_t>(size, format);
- buffer_dump->AddScalar(MemoryAllocatorDump::kNameSize,
- MemoryAllocatorDump::kUnitsBytes,
+ buffer_dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize,
+ base::trace_event::MemoryAllocatorDump::kUnitsBytes,
buffer_size_in_bytes);
- buffer_dump->AddScalar("free_size", MemoryAllocatorDump::kUnitsBytes,
+ buffer_dump->AddScalar("free_size",
+ base::trace_event::MemoryAllocatorDump::kUnitsBytes,
in_free_list ? buffer_size_in_bytes : 0);
// Emit an ownership edge towards a global allocator dump node.
const uint64_t tracing_process_id =
base::trace_event::MemoryDumpManager::GetInstance()
->GetTracingProcessId();
- MemoryAllocatorDumpGuid shared_buffer_guid =
+ base::trace_event::MemoryAllocatorDumpGuid shared_buffer_guid =
gfx::GetGpuMemoryBufferGUIDForTracing(tracing_process_id, buffer_id);
pmd->CreateSharedGlobalAllocatorDump(shared_buffer_guid);
@@ -189,23 +187,16 @@
base::trace_event::ProcessMemoryDump* pmd) {
base::AutoLock lock(lock_);
- if (args.level_of_detail == MemoryDumpLevelOfDetail::BACKGROUND) {
- std::string dump_name("cc/one_copy/staging_memory");
- MemoryAllocatorDump* dump = pmd->CreateAllocatorDump(dump_name);
- dump->AddScalar(MemoryAllocatorDump::kNameSize,
- MemoryAllocatorDump::kUnitsBytes,
- staging_buffer_usage_in_bytes_);
- } else {
- for (const auto* buffer : buffers_) {
- auto in_free_buffers =
- std::find_if(free_buffers_.begin(), free_buffers_.end(),
- [buffer](const std::unique_ptr<StagingBuffer>& b) {
- return b.get() == buffer;
- });
- buffer->OnMemoryDump(pmd, buffer->format,
- in_free_buffers != free_buffers_.end());
- }
- }
+ for (const auto* buffer : buffers_) {
+ auto in_free_buffers =
+ std::find_if(free_buffers_.begin(), free_buffers_.end(),
+ [buffer](const std::unique_ptr<StagingBuffer>& b) {
+ return b.get() == buffer;
+ });
+ buffer->OnMemoryDump(pmd, buffer->format,
+ in_free_buffers != free_buffers_.end());
+ }
+
return true;
}
« no previous file with comments | « no previous file | cc/resources/resource_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698