Commit 47d6f9ab authored by bashi's avatar bashi Committed by Commit bot

Remove abstract classes for memory dumper

WebProcessMemoryDump and WebMemoryAllocatorDump are abstract interfaces
because they lived in public/platform. Now they live in platform so there
is no reason to have such abstractions. Unify them with their impl classes.
This CL also replaces WebString with String.

BUG=605822

Review-Url: https://codereview.chromium.org/2028483002
Cr-Commit-Position: refs/heads/master@{#396803}
parent 378adfe1
......@@ -27,12 +27,12 @@
#include "core/fetch/CachedMetadataHandler.h"
#include "core/fetch/ResourceLoaderOptions.h"
#include "platform/Timer.h"
#include "platform/WebProcessMemoryDump.h"
#include "platform/network/ResourceError.h"
#include "platform/network/ResourceLoadPriority.h"
#include "platform/network/ResourceRequest.h"
#include "platform/network/ResourceResponse.h"
#include "platform/scheduler/CancellableTaskFactory.h"
#include "platform/web_process_memory_dump.h"
#include "public/platform/WebDataConsumerHandle.h"
#include "wtf/Allocator.h"
#include "wtf/HashCountedSet.h"
......
......@@ -32,7 +32,8 @@
#include "core/fetch/ResourceFetcher.h"
#include "platform/MIMETypeRegistry.h"
#include "platform/SharedBuffer.h"
#include "platform/WebProcessMemoryDump.h"
#include "platform/web_memory_allocator_dump.h"
#include "platform/web_process_memory_dump.h"
namespace blink {
......
......@@ -4,8 +4,6 @@
#include "platform/MemoryCacheDumpProvider.h"
#include "platform/web_process_memory_dump_impl.h"
namespace blink {
DEFINE_TRACE(MemoryCacheDumpClient)
......@@ -37,7 +35,7 @@ bool MemoryCacheDumpProvider::OnMemoryDump(const base::trace_event::MemoryDumpAr
return false;
}
WebProcessMemoryDumpImpl dump(args.level_of_detail, memoryDump);
WebProcessMemoryDump dump(args.level_of_detail, memoryDump);
return m_client->onMemoryDump(level, &dump);
}
......
......@@ -8,8 +8,8 @@
#include "base/trace_event/memory_dump_provider.h"
#include "base/trace_event/process_memory_dump.h"
#include "platform/PlatformExport.h"
#include "platform/WebProcessMemoryDump.h"
#include "platform/heap/Handle.h"
#include "platform/web_process_memory_dump.h"
#include "wtf/Allocator.h"
namespace blink {
......
......@@ -32,7 +32,7 @@
#include "base/memory/discardable_memory.h"
#include "base/memory/discardable_memory_allocator.h"
#include "platform/WebProcessMemoryDump.h"
#include "platform/web_process_memory_dump.h"
#include "wtf/Assertions.h"
#include "wtf/OwnPtr.h"
#include "wtf/PassOwnPtr.h"
......
......@@ -26,7 +26,7 @@
#include "platform/SharedBuffer.h"
#include "platform/WebProcessMemoryDump.h"
#include "platform/web_process_memory_dump.h"
#include "wtf/text/UTF8.h"
#include "wtf/text/Unicode.h"
......
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "platform/WebMemoryAllocatorDump.h"
namespace blink {
WebMemoryAllocatorDump::~WebMemoryAllocatorDump()
{
}
} // namespace blink
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef WebMemoryAllocatorDump_h
#define WebMemoryAllocatorDump_h
#include "public/platform/WebCommon.h"
#include "public/platform/WebString.h"
namespace blink {
typedef uint64_t WebMemoryAllocatorDumpGuid;
// A container which holds all the attributes of a particular dump for a given
// allocator.
class BLINK_PLATFORM_EXPORT WebMemoryAllocatorDump {
public:
virtual ~WebMemoryAllocatorDump();
// Adds a scalar attribute to the dump.
// Arguments:
// name: name of the attribute. Typical names, emitted by most allocators
// dump providers are: "size" and "objects_count".
// units: the units for the attribute. Gives a hint to the trace-viewer UI
// about the semantics of the attribute.
// Currently supported values are "bytes" and "objects".
// value: the value of the attribute.
virtual void addScalar(const char* name, const char* units, uint64_t value) {}
virtual void addScalarF(const char* name, const char* units, double value) {}
virtual void addString(const char* name, const char* units, const WebString& value) {}
// |guid| is an optional global dump identifier, unique across all processes
// within the scope of a global dump. It is only required when using the
// graph APIs (see AddOwnershipEdge) to express retention / suballocation or
// cross process sharing. See crbug.com/492102 for design docs.
// Subsequent MemoryAllocatorDump(s) with the same |absolute_name| are
// expected to have the same guid.
virtual WebMemoryAllocatorDumpGuid guid() const = 0;
};
} // namespace blink
#endif // WebMemoryAllocatorDump_h
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "platform/WebProcessMemoryDump.h"
namespace blink {
WebProcessMemoryDump::~WebProcessMemoryDump()
{
}
} // namespace blink
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef WebProcessMemoryDump_h
#define WebProcessMemoryDump_h
#include "base/trace_event/heap_profiler_allocation_context.h"
#include "platform/WebMemoryAllocatorDump.h"
#include "public/platform/WebCommon.h"
#include "public/platform/WebString.h"
class SkTraceMemoryDump;
namespace base {
class DiscardableMemory;
namespace trace_event {
class ProcessMemoryDump;
class TraceEventMemoryOverhead;
} // namespace trace_event
} // namespace base
namespace blink {
// Used to specify the type of memory dump the WebProcessMemoryDump should
// generate on dump requests.
// TODO(hajimehoshi): Remove this and use base::trace_event::
// MemoryDumpLevelOfDetail instead.
enum class WebMemoryDumpLevelOfDetail {
Light,
Detailed
};
// A container which holds all the dumps for the various allocators for a given
// process. Embedders of WebMemoryDumpProvider are expected to populate a
// WebProcessMemoryDump instance with the stats of their allocators.
class BLINK_PLATFORM_EXPORT WebProcessMemoryDump {
public:
virtual ~WebProcessMemoryDump();
// Creates a new MemoryAllocatorDump with the given name and returns the
// empty object back to the caller. |absoluteName| uniquely identifies the
// dump within the scope of a ProcessMemoryDump. It is possible to express
// nesting by means of a slash-separated path naming (e.g.,
// "allocator_name/arena_1/subheap_X").
// |guid| is an optional identifier, unique among all processes within the
// scope of a global dump. This is only relevant when using
// addOwnershipEdge(). If omitted, it will be automatically generated.
virtual WebMemoryAllocatorDump* createMemoryAllocatorDump(const WebString& absoluteName, WebMemoryAllocatorDumpGuid) = 0;
virtual WebMemoryAllocatorDump* createMemoryAllocatorDump(const WebString& absoluteName) = 0;
// Gets a previously created MemoryAllocatorDump given its name.
virtual WebMemoryAllocatorDump* getMemoryAllocatorDump(const WebString& absoluteName) const = 0;
// Removes all the WebMemoryAllocatorDump(s) contained in this instance.
// This WebProcessMemoryDump can be safely reused as if it was new once this
// method returns.
virtual void clear() = 0;
// Merges all WebMemoryAllocatorDump(s) contained in |other| inside this
// WebProcessMemoryDump, transferring their ownership to this instance.
// |other| will be an empty WebProcessMemoryDump after this method returns
// and can be reused as if it was new.
virtual void takeAllDumpsFrom(WebProcessMemoryDump* other) = 0;
// Adds an ownership relationship between two MemoryAllocatorDump(s) with
// the semantics: |source| owns |target|, and has the effect of attributing
// the memory usage of |target| to |source|. |importance| is optional and
// relevant only for the cases of co-ownership, where it acts as a z-index:
// the owner with the highest importance will be attributed |target|'s
// memory.
virtual void addOwnershipEdge(WebMemoryAllocatorDumpGuid source, WebMemoryAllocatorDumpGuid target, int importance) = 0;
virtual void addOwnershipEdge(WebMemoryAllocatorDumpGuid source, WebMemoryAllocatorDumpGuid target) = 0;
// Utility method to add a suballocation relationship with the following
// semantics: |source| is suballocated from |target_node_name|.
// This creates a child node of |target_node_name| and adds an ownership
// edge between |source| and the new child node. As a result, the UI will
// not account the memory of |source| in the target node.
virtual void addSuballocation(WebMemoryAllocatorDumpGuid source, const WebString& targetNodeName) = 0;
// Returns the SkTraceMemoryDump proxy interface that can be passed to Skia
// to dump into this WebProcessMemoryDump. Multiple SkTraceMemoryDump
// objects can be created using this method. The created dumpers are owned
// by WebProcessMemoryDump and cannot outlive the WebProcessMemoryDump
// object owning them. |dumpNamePrefix| is prefix appended to each dump
// created by the SkTraceMemoryDump implementation, if the dump should be
// placed under different namespace and not "skia".
virtual SkTraceMemoryDump* createDumpAdapterForSkia(const WebString& dumpNamePrefix) = 0;
virtual blink::WebMemoryAllocatorDump* createDiscardableMemoryAllocatorDump(const std::string& name, base::DiscardableMemory*) = 0;
// Dumps heap memory usage. |allocatorName| is used as an absolute name for
// base::trace_event::ProcessMemoryDump::DumpHeapUsage().
virtual void dumpHeapUsage(const base::hash_map<base::trace_event::AllocationContext, base::trace_event::AllocationMetrics>& metricsByContext, base::trace_event::TraceEventMemoryOverhead&, const char* allocatorName) = 0;
};
} // namespace blink
#endif // WebProcessMemoryDump_h
......@@ -132,10 +132,6 @@
'UserGestureIndicator.h',
'WaitableEvent.cpp',
'WaitableEvent.h',
'WebMemoryAllocatorDump.cpp',
'WebMemoryAllocatorDump.h',
'WebProcessMemoryDump.cpp',
'WebProcessMemoryDump.h',
'WebScheduler.cpp',
'WebTaskRunner.cpp',
'WebThreadSupportingGC.cpp',
......@@ -1111,10 +1107,10 @@
'v8_inspector/public/V8InspectorSessionClient.h',
'v8_inspector/public/V8StackTrace.h',
'v8_inspector/public/V8ToProtocolValue.h',
'web_memory_allocator_dump_impl.cc',
'web_memory_allocator_dump_impl.h',
'web_process_memory_dump_impl.cc',
'web_process_memory_dump_impl.h',
'web_memory_allocator_dump.cc',
'web_memory_allocator_dump.h',
'web_process_memory_dump.cc',
'web_process_memory_dump.h',
'weborigin/KURL.cpp',
'weborigin/KURL.h',
'weborigin/KURLHash.h',
......@@ -1243,7 +1239,7 @@
'transforms/TransformTestHelper.h',
'transforms/TransformationMatrixTest.cpp',
'transforms/RotationTest.cpp',
'web_process_memory_dump_impl_test.cc',
'web_process_memory_dump_test.cc',
'weborigin/KnownPortsTest.cpp',
'weborigin/KURLTest.cpp',
'weborigin/OriginAccessEntryTest.cpp',
......
......@@ -33,8 +33,6 @@
#include "platform/FontFamilyNames.h"
#include "platform/Histogram.h"
#include "platform/RuntimeEnabledFeatures.h"
#include "platform/WebMemoryAllocatorDump.h"
#include "platform/WebProcessMemoryDump.h"
#include "platform/fonts/AcceptLanguagesResolver.h"
#include "platform/fonts/AlternateFontFamily.h"
#include "platform/fonts/FontCacheClient.h"
......@@ -47,6 +45,8 @@
#include "platform/fonts/TextRenderingMode.h"
#include "platform/fonts/opentype/OpenTypeVerticalData.h"
#include "platform/fonts/shaping/ShapeCache.h"
#include "platform/web_memory_allocator_dump.h"
#include "platform/web_process_memory_dump.h"
#include "public/platform/Platform.h"
#include "wtf/HashMap.h"
#include "wtf/ListHashSet.h"
......
......@@ -9,9 +9,8 @@
#include "base/trace_event/memory_allocator_dump.h"
#include "base/trace_event/process_memory_dump.h"
#include "base/trace_event/trace_event_memory_overhead.h"
#include "platform/WebMemoryAllocatorDump.h"
#include "platform/heap/Handle.h"
#include "platform/web_process_memory_dump_impl.h"
#include "platform/web_memory_allocator_dump.h"
#include "public/platform/Platform.h"
#include "wtf/StdLibExtras.h"
#include "wtf/Threading.h"
......
......@@ -34,8 +34,6 @@
#include "platform/Histogram.h"
#include "platform/ScriptForbiddenScope.h"
#include "platform/TraceEvent.h"
#include "platform/WebMemoryAllocatorDump.h"
#include "platform/WebProcessMemoryDump.h"
#include "platform/heap/BlinkGCMemoryDumpProvider.h"
#include "platform/heap/CallbackStack.h"
#include "platform/heap/MarkingVisitor.h"
......@@ -43,6 +41,8 @@
#include "platform/heap/PagePool.h"
#include "platform/heap/SafePoint.h"
#include "platform/heap/ThreadState.h"
#include "platform/web_memory_allocator_dump.h"
#include "platform/web_process_memory_dump.h"
#include "public/platform/Platform.h"
#include "wtf/Assertions.h"
#include "wtf/CurrentTime.h"
......
......@@ -33,8 +33,6 @@
#include "base/trace_event/process_memory_dump.h"
#include "platform/ScriptForbiddenScope.h"
#include "platform/TraceEvent.h"
#include "platform/WebMemoryAllocatorDump.h"
#include "platform/WebProcessMemoryDump.h"
#include "platform/heap/BlinkGCMemoryDumpProvider.h"
#include "platform/heap/CallbackStack.h"
#include "platform/heap/Heap.h"
......@@ -43,6 +41,8 @@
#include "platform/heap/PagePool.h"
#include "platform/heap/SafePoint.h"
#include "platform/heap/ThreadState.h"
#include "platform/web_memory_allocator_dump.h"
#include "platform/web_process_memory_dump.h"
#include "public/platform/Platform.h"
#include "wtf/Assertions.h"
#include "wtf/ContainerAnnotations.h"
......
......@@ -34,14 +34,14 @@
#include "platform/Histogram.h"
#include "platform/ScriptForbiddenScope.h"
#include "platform/TraceEvent.h"
#include "platform/WebMemoryAllocatorDump.h"
#include "platform/WebProcessMemoryDump.h"
#include "platform/heap/BlinkGCMemoryDumpProvider.h"
#include "platform/heap/CallbackStack.h"
#include "platform/heap/Handle.h"
#include "platform/heap/Heap.h"
#include "platform/heap/SafePoint.h"
#include "platform/heap/Visitor.h"
#include "platform/web_memory_allocator_dump.h"
#include "platform/web_process_memory_dump.h"
#include "public/platform/Platform.h"
#include "public/platform/WebScheduler.h"
#include "public/platform/WebThread.h"
......
......@@ -2,40 +2,43 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "platform/web_memory_allocator_dump_impl.h"
#include "platform/web_memory_allocator_dump.h"
#include "base/trace_event/memory_allocator_dump.h"
#include "wtf/text/StringUTF8Adaptor.h"
namespace blink {
WebMemoryAllocatorDumpImpl::WebMemoryAllocatorDumpImpl(
WebMemoryAllocatorDump::WebMemoryAllocatorDump(
base::trace_event::MemoryAllocatorDump* memory_allocator_dump)
: memory_allocator_dump_(memory_allocator_dump),
guid_(memory_allocator_dump->guid().ToUint64()) {
}
WebMemoryAllocatorDumpImpl::~WebMemoryAllocatorDumpImpl() {
WebMemoryAllocatorDump::~WebMemoryAllocatorDump() {
}
void WebMemoryAllocatorDumpImpl::addScalar(const char* name,
void WebMemoryAllocatorDump::addScalar(const char* name,
const char* units,
uint64_t value) {
memory_allocator_dump_->AddScalar(name, units, value);
}
void WebMemoryAllocatorDumpImpl::addScalarF(const char* name,
void WebMemoryAllocatorDump::addScalarF(const char* name,
const char* units,
double value) {
memory_allocator_dump_->AddScalarF(name, units, value);
}
void WebMemoryAllocatorDumpImpl::addString(const char* name,
void WebMemoryAllocatorDump::addString(const char* name,
const char* units,
const blink::WebString& value) {
memory_allocator_dump_->AddString(name, units, value.utf8());
const String& value) {
StringUTF8Adaptor adapter(value);
std::string utf8(adapter.data(), adapter.length());
memory_allocator_dump_->AddString(name, units, utf8);
}
WebMemoryAllocatorDumpGuid WebMemoryAllocatorDumpImpl::guid() const {
WebMemoryAllocatorDumpGuid WebMemoryAllocatorDump::guid() const {
return guid_;
}
......
......@@ -2,13 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef WebMemoryAllocatorDumpImpl_h
#define WebMemoryAllocatorDumpImpl_h
#ifndef WebMemoryAllocatorDump_h
#define WebMemoryAllocatorDump_h
#include <stdint.h>
#include "base/macros.h"
#include "platform/WebMemoryAllocatorDump.h"
#include "platform/PlatformExport.h"
#include "wtf/text/WTFString.h"
namespace base {
namespace trace_event {
......@@ -18,31 +19,45 @@ class MemoryAllocatorDump;
namespace blink {
// Implements the blink::WebMemoryAllocatorDump interface by means of proxying
// the Add*() calls to the underlying base::trace_event::MemoryAllocatorDump
// instance.
class WebMemoryAllocatorDumpImpl : public blink::WebMemoryAllocatorDump {
typedef uint64_t WebMemoryAllocatorDumpGuid;
// A container which holds all the attributes of a particular dump for a given
// allocator.
class PLATFORM_EXPORT WebMemoryAllocatorDump final {
public:
explicit WebMemoryAllocatorDumpImpl(
explicit WebMemoryAllocatorDump(
base::trace_event::MemoryAllocatorDump* memory_allocator_dump);
~WebMemoryAllocatorDumpImpl() override;
// blink::WebMemoryAllocatorDump implementation.
void addScalar(const char* name, const char* units, uint64_t value) override;
void addScalarF(const char* name, const char* units, double value) override;
~WebMemoryAllocatorDump();
// Adds a scalar attribute to the dump.
// Arguments:
// name: name of the attribute. Typical names, emitted by most allocators
// dump providers are: "size" and "objects_count".
// units: the units for the attribute. Gives a hint to the trace-viewer UI
// about the semantics of the attribute.
// Currently supported values are "bytes" and "objects".
// value: the value of the attribute.
void addScalar(const char* name, const char* units, uint64_t value);
void addScalarF(const char* name, const char* units, double value);
void addString(const char* name,
const char* units,
const blink::WebString& value) override;
const String& value);
blink::WebMemoryAllocatorDumpGuid guid() const override;
// |guid| is an optional global dump identifier, unique across all processes
// within the scope of a global dump. It is only required when using the
// graph APIs (see AddOwnershipEdge) to express retention / suballocation or
// cross process sharing. See crbug.com/492102 for design docs.
// Subsequent MemoryAllocatorDump(s) with the same |absolute_name| are
// expected to have the same guid.
blink::WebMemoryAllocatorDumpGuid guid() const;
private:
base::trace_event::MemoryAllocatorDump* memory_allocator_dump_; // Not owned.
blink::WebMemoryAllocatorDumpGuid guid_;
DISALLOW_COPY_AND_ASSIGN(WebMemoryAllocatorDumpImpl);
DISALLOW_COPY_AND_ASSIGN(WebMemoryAllocatorDump);
};
} // namespace blink
#endif // WebMemoryAllocatorDumpImpl_h
#endif // WebMemoryAllocatorDump_h
......@@ -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 "platform/web_process_memory_dump_impl.h"
#include "platform/web_process_memory_dump.h"
#include "base/memory/discardable_memory.h"
#include "base/memory/ptr_util.h"
......@@ -11,73 +11,80 @@
#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 "platform/web_memory_allocator_dump_impl.h"
#include "platform/web_memory_allocator_dump.h"
#include "skia/ext/skia_trace_memory_dump_impl.h"
#include "wtf/text/StringUTF8Adaptor.h"
#include <stddef.h>
namespace blink {
WebProcessMemoryDumpImpl::WebProcessMemoryDumpImpl()
WebProcessMemoryDump::WebProcessMemoryDump()
: owned_process_memory_dump_(
new base::trace_event::ProcessMemoryDump(nullptr)),
process_memory_dump_(owned_process_memory_dump_.get()),
level_of_detail_(base::trace_event::MemoryDumpLevelOfDetail::DETAILED) {}
WebProcessMemoryDumpImpl::WebProcessMemoryDumpImpl(
WebProcessMemoryDump::WebProcessMemoryDump(
base::trace_event::MemoryDumpLevelOfDetail level_of_detail,
base::trace_event::ProcessMemoryDump* process_memory_dump)
: process_memory_dump_(process_memory_dump),
level_of_detail_(level_of_detail) {}
WebProcessMemoryDumpImpl::~WebProcessMemoryDumpImpl() {
WebProcessMemoryDump::~WebProcessMemoryDump() {
}
blink::WebMemoryAllocatorDump*
WebProcessMemoryDumpImpl::createMemoryAllocatorDump(
const blink::WebString& absolute_name) {
WebProcessMemoryDump::createMemoryAllocatorDump(
const String& absolute_name) {
StringUTF8Adaptor adapter(absolute_name);
std::string name(adapter.data(), adapter.length());
// Get a MemoryAllocatorDump from the base/ object.
base::trace_event::MemoryAllocatorDump* memory_allocator_dump =
process_memory_dump_->CreateAllocatorDump(absolute_name.utf8());
process_memory_dump_->CreateAllocatorDump(name);
return createWebMemoryAllocatorDump(memory_allocator_dump);
}
blink::WebMemoryAllocatorDump*
WebProcessMemoryDumpImpl::createMemoryAllocatorDump(
const blink::WebString& absolute_name,
WebProcessMemoryDump::createMemoryAllocatorDump(
const String& absolute_name,
blink::WebMemoryAllocatorDumpGuid guid) {
StringUTF8Adaptor adapter(absolute_name);
std::string name(adapter.data(), adapter.length());
// Get a MemoryAllocatorDump from the base/ object with given guid.
base::trace_event::MemoryAllocatorDump* memory_allocator_dump =
process_memory_dump_->CreateAllocatorDump(
absolute_name.utf8(),
name,
base::trace_event::MemoryAllocatorDumpGuid(guid));
return createWebMemoryAllocatorDump(memory_allocator_dump);
}
blink::WebMemoryAllocatorDump*
WebProcessMemoryDumpImpl::createWebMemoryAllocatorDump(
WebProcessMemoryDump::createWebMemoryAllocatorDump(
base::trace_event::MemoryAllocatorDump* memory_allocator_dump) {
if (!memory_allocator_dump)
return nullptr;
// Wrap it and return to blink.
WebMemoryAllocatorDumpImpl* web_memory_allocator_dump_impl =
new WebMemoryAllocatorDumpImpl(memory_allocator_dump);
WebMemoryAllocatorDump* web_memory_allocator_dump =
new WebMemoryAllocatorDump(memory_allocator_dump);
// memory_allocator_dumps_ will take ownership of
// |web_memory_allocator_dumpd_impl|.
// |web_memory_allocator_dump|.
memory_allocator_dumps_.set(
memory_allocator_dump, adoptPtr(web_memory_allocator_dump_impl));
return web_memory_allocator_dump_impl;
memory_allocator_dump, adoptPtr(web_memory_allocator_dump));
return web_memory_allocator_dump;
}
blink::WebMemoryAllocatorDump* WebProcessMemoryDumpImpl::getMemoryAllocatorDump(
const blink::WebString& absolute_name) const {
blink::WebMemoryAllocatorDump* WebProcessMemoryDump::getMemoryAllocatorDump(
const String& absolute_name) const {
StringUTF8Adaptor adapter(absolute_name);
std::string name(adapter.data(), adapter.length());
// Retrieve the base MemoryAllocatorDump object and then reverse lookup
// its wrapper.
base::trace_event::MemoryAllocatorDump* memory_allocator_dump =
process_memory_dump_->GetAllocatorDump(absolute_name.utf8());
process_memory_dump_->GetAllocatorDump(name);
if (!memory_allocator_dump)
return nullptr;
......@@ -90,7 +97,7 @@ blink::WebMemoryAllocatorDump* WebProcessMemoryDumpImpl::getMemoryAllocatorDump(
return web_memory_allocator_dump;
}
void WebProcessMemoryDumpImpl::clear() {
void WebProcessMemoryDump::clear() {
// Clear all the WebMemoryAllocatorDump wrappers.
memory_allocator_dumps_.clear();
......@@ -98,33 +105,32 @@ void WebProcessMemoryDumpImpl::clear() {
process_memory_dump_->Clear();
}
void WebProcessMemoryDumpImpl::takeAllDumpsFrom(
void WebProcessMemoryDump::takeAllDumpsFrom(
blink::WebProcessMemoryDump* other) {
auto other_impl = static_cast<WebProcessMemoryDumpImpl*>(other);
// WebProcessMemoryDumpImpl is a container of WebMemoryAllocatorDump(s) which
// WebProcessMemoryDump is a container of WebMemoryAllocatorDump(s) which