Index: third_party/WebKit/Source/platform/WebProcessMemoryDumpImpl.cpp |
diff --git a/content/child/web_process_memory_dump_impl.cc b/third_party/WebKit/Source/platform/WebProcessMemoryDumpImpl.cpp |
similarity index 89% |
rename from content/child/web_process_memory_dump_impl.cc |
rename to third_party/WebKit/Source/platform/WebProcessMemoryDumpImpl.cpp |
index c96c3f2b544807dac10db4a14b59783d01ff0d1b..0992532c41728ba04274a7fde022a2be06173f79 100644 |
--- a/content/child/web_process_memory_dump_impl.cc |
+++ b/third_party/WebKit/Source/platform/WebProcessMemoryDumpImpl.cpp |
@@ -2,7 +2,7 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include "content/child/web_process_memory_dump_impl.h" |
+#include "platform/WebProcessMemoryDumpImpl.h" |
#include <stddef.h> |
@@ -12,10 +12,10 @@ |
#include "base/trace_event/process_memory_dump.h" |
#include "base/trace_event/trace_event_argument.h" |
#include "base/trace_event/trace_event_memory_overhead.h" |
-#include "content/child/web_memory_allocator_dump_impl.h" |
+#include "platform/WebMemoryAllocatorDumpImpl.h" |
#include "skia/ext/skia_trace_memory_dump_impl.h" |
-namespace content { |
+namespace blink { |
WebProcessMemoryDumpImpl::WebProcessMemoryDumpImpl() |
: owned_process_memory_dump_( |
@@ -66,8 +66,8 @@ WebProcessMemoryDumpImpl::createWebMemoryAllocatorDump( |
// memory_allocator_dumps_ will take ownership of |
// |web_memory_allocator_dumpd_impl|. |
- memory_allocator_dumps_.set(memory_allocator_dump, |
- make_scoped_ptr(web_memory_allocator_dump_impl)); |
+ memory_allocator_dumps_.insert(std::make_pair( |
+ memory_allocator_dump, make_scoped_ptr(web_memory_allocator_dump_impl))); |
return web_memory_allocator_dump_impl; |
} |
@@ -84,7 +84,7 @@ blink::WebMemoryAllocatorDump* WebProcessMemoryDumpImpl::getMemoryAllocatorDump( |
// is something from blink trying to get a MAD that was created from chromium, |
// which is an odd use case. |
blink::WebMemoryAllocatorDump* web_memory_allocator_dump = |
- memory_allocator_dumps_.get(memory_allocator_dump); |
+ memory_allocator_dumps_.at(memory_allocator_dump).get(); |
DCHECK(web_memory_allocator_dump); |
return web_memory_allocator_dump; |
} |
@@ -116,9 +116,11 @@ void WebProcessMemoryDumpImpl::takeAllDumpsFrom( |
auto first_entry = other_impl->memory_allocator_dumps_.begin(); |
base::trace_event::MemoryAllocatorDump* memory_allocator_dump = |
first_entry->first; |
- memory_allocator_dumps_.set( |
- memory_allocator_dump, |
- other_impl->memory_allocator_dumps_.take_and_erase(first_entry)); |
+ auto other_dump_impl = |
+ other_impl->memory_allocator_dumps_.at(first_entry->first).release(); |
+ memory_allocator_dumps_.insert(std::make_pair(memory_allocator_dump, |
+ make_scoped_ptr(other_dump_impl))); |
+ other_impl->memory_allocator_dumps_.erase(first_entry->first); |
} |
DCHECK_EQ(expected_final_size, memory_allocator_dumps_.size()); |
DCHECK(other_impl->memory_allocator_dumps_.empty()); |
@@ -151,9 +153,10 @@ void WebProcessMemoryDumpImpl::addSuballocation( |
SkTraceMemoryDump* WebProcessMemoryDumpImpl::createDumpAdapterForSkia( |
const blink::WebString& dump_name_prefix) { |
- sk_trace_dump_list_.push_back(new skia::SkiaTraceMemoryDumpImpl( |
- dump_name_prefix.utf8(), level_of_detail_, process_memory_dump_)); |
- return sk_trace_dump_list_.back(); |
+ sk_trace_dump_list_.push_back(make_scoped_ptr( |
+ new skia::SkiaTraceMemoryDumpImpl( |
+ dump_name_prefix.utf8(), level_of_detail_, process_memory_dump_))); |
+ return sk_trace_dump_list_.back().get(); |
} |
blink::WebMemoryAllocatorDump* |