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

BlinkMemoryMgt: Annotate the classes of renderer/core/timing with the macros of Allocator

The OnionSoup effort has a goal of allocating all garbage-collectable Blink objects
with Oilpan or PartitionAlloc. However, the some classes of //blink/renderer/core/timing
has not yet been allocated with them so far. So their uses of non-garbage-collected objects
should be restricted to cases where the garbage collector can discover their references.
The macros of Allocator will be useful for the non-garbage-collected objects to avoid
unintended allocations.

After some analyzes, it was concluded that for the case of the EventTiming, SubTaskAttribution,
and TimeClamper classes, they make sense to use USING_FAST_MALLOC because they have been used
with smart pointers.

Bug: 919389
Change-Id: Ib8cddb4c1e4db37b6542bfabae7a13cc4a6d5749
Reviewed-on: https://chromium-review.googlesource.com/c/1482250Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Gyuyoung Kim <gyuyoung@igalia.com>
Cr-Commit-Position: refs/heads/master@{#634603}
parent c8d31666
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/core/timing/window_performance.h" #include "third_party/blink/renderer/core/timing/window_performance.h"
#include "third_party/blink/renderer/platform/wtf/allocator.h"
namespace blink { namespace blink {
...@@ -19,6 +20,8 @@ class Event; ...@@ -19,6 +20,8 @@ class Event;
// input latency. // input latency.
// See also: https://github.com/wicg/event-timing // See also: https://github.com/wicg/event-timing
class CORE_EXPORT EventTiming final { class CORE_EXPORT EventTiming final {
USING_FAST_MALLOC(EventTiming);
public: public:
explicit EventTiming(LocalDOMWindow*); explicit EventTiming(LocalDOMWindow*);
......
...@@ -9,12 +9,15 @@ ...@@ -9,12 +9,15 @@
#include "third_party/blink/renderer/core/dom/dom_high_res_time_stamp.h" #include "third_party/blink/renderer/core/dom/dom_high_res_time_stamp.h"
#include "third_party/blink/renderer/platform/heap/handle.h" #include "third_party/blink/renderer/platform/heap/handle.h"
#include "third_party/blink/renderer/platform/wtf/allocator.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h" #include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
#include "third_party/blink/renderer/platform/wtf/time.h" #include "third_party/blink/renderer/platform/wtf/time.h"
namespace blink { namespace blink {
class SubTaskAttribution { class SubTaskAttribution {
USING_FAST_MALLOC(SubTaskAttribution);
public: public:
using EntriesVector = Vector<std::unique_ptr<SubTaskAttribution>>; using EntriesVector = Vector<std::unique_ptr<SubTaskAttribution>>;
......
...@@ -8,12 +8,15 @@ ...@@ -8,12 +8,15 @@
#include "base/macros.h" #include "base/macros.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/platform/wtf/allocator.h"
#include <stdint.h> #include <stdint.h>
namespace blink { namespace blink {
class CORE_EXPORT TimeClamper { class CORE_EXPORT TimeClamper {
USING_FAST_MALLOC(TimeClamper);
public: public:
// As site isolation is enabled on desktop platforms, we can safely provide // As site isolation is enabled on desktop platforms, we can safely provide
// more timing resolution. Jittering is still enabled everywhere. // more timing resolution. Jittering is still enabled everywhere.
......
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