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

BlinkMemoryMgt: Annotate the 2 classes of xml and xmlhttprequest 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/xml
and //blink/renderer/core/xmlhttprequest 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 XMLParserContent class, it makes
sense to use USING_FAST_MALLOC because it has been used with scoped_refptr<>

In DeferredEvent class case, it makes sense to use DISALLOW_NEW because it has been used
by a member variable with a reference.

Bug: 919389
Change-Id: I18da5a1078b91caec8ad69c338ef874c9395f7e5
Reviewed-on: https://chromium-review.googlesource.com/c/1482280Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Gyuyoung Kim <gyuyoung@igalia.com>
Cr-Commit-Position: refs/heads/master@{#634651}
parent cb736f23
......@@ -36,6 +36,7 @@
#include "third_party/blink/renderer/platform/heap/handle.h"
#include "third_party/blink/renderer/platform/loader/fetch/resource_client.h"
#include "third_party/blink/renderer/platform/text/segmented_string.h"
#include "third_party/blink/renderer/platform/wtf/allocator.h"
#include "third_party/blink/renderer/platform/wtf/compiler.h"
#include "third_party/blink/renderer/platform/wtf/hash_map.h"
#include "third_party/blink/renderer/platform/wtf/ref_counted.h"
......@@ -52,6 +53,8 @@ class LocalFrameView;
class Text;
class XMLParserContext : public RefCounted<XMLParserContext> {
USING_FAST_MALLOC(XMLParserContext);
public:
static scoped_refptr<XMLParserContext>
CreateMemoryParser(xmlSAXHandlerPtr, void* user_data, const CString& chunk);
......
......@@ -30,6 +30,7 @@
#include "base/memory/scoped_refptr.h"
#include "third_party/blink/renderer/platform/heap/handle.h"
#include "third_party/blink/renderer/platform/timer.h"
#include "third_party/blink/renderer/platform/wtf/allocator.h"
#include "third_party/blink/renderer/platform/wtf/forward.h"
namespace blink {
......@@ -98,6 +99,8 @@ class XMLHttpRequestProgressEventThrottle final
// ProgressEvent dispatching. This class represents such a deferred
// "progress" ProgressEvent.
class DeferredEvent {
DISALLOW_NEW();
public:
DeferredEvent();
void Set(bool length_computable,
......
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