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

Unified Diff: third_party/WebKit/Source/platform/WebProcessMemoryDumpImpl.cpp

Issue 1660383002: Refactoring: Move some classes from content/child to platform (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: kinuko'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/WebProcessMemoryDumpImpl.cpp
diff --git a/content/child/web_process_memory_dump_impl.cc b/third_party/WebKit/Source/platform/WebProcessMemoryDumpImpl.cpp
similarity index 91%
rename from content/child/web_process_memory_dump_impl.cc
rename to third_party/WebKit/Source/platform/WebProcessMemoryDumpImpl.cpp
index a95c9d7a583ef74d00aa98e209049e6430b0f936..e8e5a9b00dd365256bcb6f3cbd9eb4bb789a60e9 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>
@@ -11,14 +11,14 @@
#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_(
- new base::trace_event::ProcessMemoryDump(nullptr)),
+ adoptPtr(new base::trace_event::ProcessMemoryDump(nullptr))),
process_memory_dump_(owned_process_memory_dump_.get()),
level_of_detail_(base::trace_event::MemoryDumpLevelOfDetail::DETAILED) {}
@@ -66,7 +66,7 @@ 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));
+ adoptPtr(web_memory_allocator_dump_impl));
return web_memory_allocator_dump_impl;
}
@@ -111,16 +111,16 @@ 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;
+ first_entry->key;
memory_allocator_dumps_.set(
memory_allocator_dump,
- other_impl->memory_allocator_dumps_.take_and_erase(first_entry));
+ other_impl->memory_allocator_dumps_.take(first_entry->key));
}
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(
@@ -150,9 +150,9 @@ 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_.append(adoptPtr(new skia::SkiaTraceMemoryDumpImpl(
+ dump_name_prefix.utf8(), level_of_detail_, process_memory_dump_)));
+ return sk_trace_dump_list_.last().get();
}
blink::WebMemoryAllocatorDump*

Powered by Google App Engine
This is Rietveld 408576698