Commit 90c521b1 authored by Gyuyoung Kim's avatar Gyuyoung Kim Committed by Commit Bot

BlinkMemoryMgt: Annotate storage classes 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/storage 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 StorageAreaMap and
StorageController classes, they make sense to use USING_FAST_MALLOC because
they have been created by smart pointers.

Bug: 919389
Change-Id: Ic440735af3bb0e2e87fce36b41564ade69a6ebfb
Reviewed-on: https://chromium-review.googlesource.com/c/1488398Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Gyuyoung Kim <gyuyoung@igalia.com>
Cr-Commit-Position: refs/heads/master@{#635439}
parent 0f2f1bf9
......@@ -6,6 +6,7 @@
#define THIRD_PARTY_BLINK_RENDERER_MODULES_STORAGE_STORAGE_AREA_MAP_H_
#include "third_party/blink/renderer/modules/modules_export.h"
#include "third_party/blink/renderer/platform/wtf/allocator.h"
#include "third_party/blink/renderer/platform/wtf/text/string_hash.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
......@@ -21,6 +22,8 @@ namespace blink {
// counted as two bytes, even if the actual in-memory representation of the
// string only uses one byte per character.
class MODULES_EXPORT StorageAreaMap {
USING_FAST_MALLOC(StorageAreaMap);
public:
explicit StorageAreaMap(size_t quota);
......
......@@ -14,6 +14,7 @@
#include "third_party/blink/renderer/modules/storage/storage_area.h"
#include "third_party/blink/renderer/platform/heap/heap_allocator.h"
#include "third_party/blink/renderer/platform/heap/persistent.h"
#include "third_party/blink/renderer/platform/wtf/allocator.h"
namespace base {
class SingleThreadTaskRunner;
......@@ -44,6 +45,8 @@ class WebStorageArea;
// AddLocalStorageInspectorStorageAgent,
// RemoveLocalStorageInspectorStorageAgent, DidDispatchLocalStorageEvent
class MODULES_EXPORT StorageController {
USING_FAST_MALLOC(StorageController);
public:
// Returns the one global StorageController instance.
static StorageController* GetInstance();
......
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