Commit dc3569fd authored by Gyuyoung Kim's avatar Gyuyoung Kim Committed by Commit Bot

BlinkMemoryMgt: Annotate Blink's renderer/bindings with the macros of Allocator

This CL finishes annotating the rest of the classes of //third_party/blink/renderer/bindings
with the macros of Allocator.

After some analyzes, it was concluded that for the case of NodeBuilder, State, WorklistItemBase
classes, they makes sense to use USING_FAST_MALLOC because it has been used as a member variable
with new() or smart pointers.

Lastly, the rest of the classes this CL annotates make sense to use STACK_ALLOCATED.

Bug: 919389
Change-Id: I8590c31702d34ccdadf4d079c8123a192b36aeaf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1563130Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Gyuyoung Kim <gyuyoung@igalia.com>
Cr-Commit-Position: refs/heads/master@{#649777}
parent bbe43052
......@@ -10,6 +10,7 @@
#include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_testing.h"
#include "third_party/blink/renderer/core/testing/garbage_collected_script_wrappable.h"
#include "third_party/blink/renderer/platform/heap/heap.h"
#include "third_party/blink/renderer/platform/wtf/allocator.h"
#include "third_party/blink/renderer/platform/wtf/vector.h"
#define TEST_TOV8(expected, value) \
......@@ -55,6 +56,8 @@ class GarbageCollectedHolderForToV8Test
};
class OffHeapGarbageCollectedHolder {
STACK_ALLOCATED();
public:
OffHeapGarbageCollectedHolder(
GarbageCollectedScriptWrappable* script_wrappable)
......
......@@ -11,6 +11,7 @@
#include "third_party/blink/renderer/platform/bindings/script_wrappable.h"
#include "third_party/blink/renderer/platform/bindings/wrapper_type_info.h"
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
#include "third_party/blink/renderer/platform/wtf/allocator.h"
namespace blink {
......@@ -89,6 +90,8 @@ class EmbedderRootNode : public EmbedderNode {
};
class NodeBuilder final {
USING_FAST_MALLOC(NodeBuilder);
public:
explicit NodeBuilder(Graph* graph) : graph_(graph) {}
......@@ -202,6 +205,8 @@ class GC_PLUGIN_IGNORE(
};
class State final {
USING_FAST_MALLOC(State);
public:
State(Traceable traceable, const char* name, DomTreeState dom_tree_state)
: traceable_(traceable), name_(name), dom_tree_state_(dom_tree_state) {}
......@@ -248,6 +253,8 @@ class GC_PLUGIN_IGNORE(
// WorklistItemBase is used for different kinds of items that require
// processing the regular worklist.
class WorklistItemBase {
USING_FAST_MALLOC(WorklistItemBase);
public:
explicit WorklistItemBase(State* parent, State* to_process)
: parent_(parent), to_process_(to_process) {}
......
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