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

BlinkMemoryMgt: Annotate some classes of Blink's presentation module with USING_FAST_MALLOC

The OnionSoup effort has a goal of allocating all garbage-collectible Blink objects
with Oilpan or PartitionAlloc. However, some classes of
//blink/renderer/modules/presentation have 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 PresentationAvailabilityCallbacks,
PresentationAvailabilityState and PresentationConnectionCallbacks classes, they make sense
to use USING_FAST_MALLOC because they have been used as member variables with smart pointers.

Bug: 919389
Change-Id: Ib662c4015d4a593ad4554e880192eb2e0714ef02
Reviewed-on: https://chromium-review.googlesource.com/c/1487757Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Gyuyoung Kim <gyuyoung@igalia.com>
Cr-Commit-Position: refs/heads/master@{#635397}
parent 28932463
......@@ -10,6 +10,7 @@
#include "third_party/blink/renderer/modules/presentation/presentation_promise_property.h"
#include "third_party/blink/renderer/platform/heap/handle.h"
#include "third_party/blink/renderer/platform/weborigin/kurl.h"
#include "third_party/blink/renderer/platform/wtf/allocator.h"
#include "third_party/blink/renderer/platform/wtf/vector.h"
namespace blink {
......@@ -19,6 +20,8 @@ namespace blink {
// TODO(crbug.com/749327): Consider removing this class and have
// PresentationAvailabilityState use PresentationAvailabilityProperty directly.
class MODULES_EXPORT PresentationAvailabilityCallbacks {
USING_FAST_MALLOC(PresentationAvailabilityCallbacks);
public:
PresentationAvailabilityCallbacks(PresentationAvailabilityProperty*,
const WTF::Vector<KURL>&);
......
......@@ -14,6 +14,7 @@
#include "third_party/blink/renderer/modules/modules_export.h"
#include "third_party/blink/renderer/modules/presentation/presentation_availability_callbacks.h"
#include "third_party/blink/renderer/platform/weborigin/kurl.h"
#include "third_party/blink/renderer/platform/wtf/allocator.h"
#include "third_party/blink/renderer/platform/wtf/vector.h"
namespace blink {
......@@ -30,6 +31,8 @@ class PresentationAvailabilityObserver;
// this class by moving the multiple URL tracking logic to the former, and
// consolidating this class's APIs to take repeating callbacks.
class MODULES_EXPORT PresentationAvailabilityState {
USING_FAST_MALLOC(PresentationAvailabilityState);
public:
explicit PresentationAvailabilityState(mojom::blink::PresentationService*);
~PresentationAvailabilityState();
......
......@@ -8,6 +8,7 @@
#include "base/macros.h"
#include "third_party/blink/public/mojom/presentation/presentation.mojom-blink.h"
#include "third_party/blink/renderer/platform/heap/persistent.h"
#include "third_party/blink/renderer/platform/wtf/allocator.h"
namespace blink {
......@@ -22,6 +23,8 @@ class ScriptPromiseResolver;
// take an existing connection object with which the promise will be resolved
// on success.
class PresentationConnectionCallbacks final {
USING_FAST_MALLOC(PresentationConnectionCallbacks);
public:
PresentationConnectionCallbacks(ScriptPromiseResolver*, PresentationRequest*);
PresentationConnectionCallbacks(ScriptPromiseResolver*,
......
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