Commit d32df3f2 authored by ssid's avatar ssid Committed by Commit bot

[tracing] Add api to create a skia dump adapter

The SkTraceMemoryDump interface is used for tracing skia objects. Blink
allocates various skia objects and for tracing these objects, an
implementation of the skia trace interface is needed. Since, we have
implementation in chrome side, this new api is a proxy create for the
chrome implementation. This also adds an api to add suballocations in
the memory dumps.

BUG=520842

Review URL: https://codereview.chromium.org/1313223007

Cr-Commit-Position: refs/heads/master@{#351553}
parent 287d294a
......@@ -7,8 +7,11 @@
#include "WebCommon.h"
#include "WebMemoryAllocatorDump.h"
#include "WebMemoryDumpProvider.h"
#include "WebString.h"
class SkTraceMemoryDump;
namespace blink {
// A container which holds all the dumps for the various allocators for a given
......@@ -77,6 +80,29 @@ public:
{
BLINK_ASSERT_NOT_REACHED();
}
// 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)
{
BLINK_ASSERT_NOT_REACHED();
}
// 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)
{
BLINK_ASSERT_NOT_REACHED();
return nullptr;
}
};
} // namespace blink
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment