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

Unified Diff: third_party/WebKit/Source/platform/web_process_memory_dump_impl.cc

Issue 1660383002: Refactoring: Move some classes from content/child to platform (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add PLATFORM_EXPORT; Address haraken's review Created 4 years, 10 months 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
Index: third_party/WebKit/Source/platform/web_process_memory_dump_impl.cc
diff --git a/content/child/web_process_memory_dump_impl.cc b/third_party/WebKit/Source/platform/web_process_memory_dump_impl.cc
similarity index 90%
rename from content/child/web_process_memory_dump_impl.cc
rename to third_party/WebKit/Source/platform/web_process_memory_dump_impl.cc
index c96c3f2b544807dac10db4a14b59783d01ff0d1b..fabd109230f80118f7fae5062aa679c796f54169 100644
--- a/content/child/web_process_memory_dump_impl.cc
+++ b/third_party/WebKit/Source/platform/web_process_memory_dump_impl.cc
@@ -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/web_process_memory_dump_impl.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/web_memory_allocator_dump_impl.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_.set(
+ memory_allocator_dump, adoptPtr(web_memory_allocator_dump_impl));
return web_memory_allocator_dump_impl;
}
@@ -112,16 +112,15 @@ void WebProcessMemoryDumpImpl::takeAllDumpsFrom(
// 2) Move and transfer the ownership of the WebMemoryAllocatorDump wrappers.
const size_t expected_final_size = memory_allocator_dumps_.size() +
other_impl->memory_allocator_dumps_.size();
- while (!other_impl->memory_allocator_dumps_.empty()) {
+ while (!other_impl->memory_allocator_dumps_.isEmpty()) {
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));
+ first_entry->key;
+ memory_allocator_dumps_.set(memory_allocator_dump,
+ other_impl->memory_allocator_dumps_.take(memory_allocator_dump));
}
DCHECK_EQ(expected_final_size, memory_allocator_dumps_.size());
- DCHECK(other_impl->memory_allocator_dumps_.empty());
+ DCHECK(other_impl->memory_allocator_dumps_.isEmpty());
}
void WebProcessMemoryDumpImpl::addOwnershipEdge(
@@ -151,9 +150,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*

Powered by Google App Engine
This is Rietveld 408576698