Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(281)

Unified Diff: third_party/WebKit/Source/core/dom/PendingScript.h

Issue 1569273004: Move ResourceOwner on to the oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/dom/PendingScript.h
diff --git a/third_party/WebKit/Source/core/dom/PendingScript.h b/third_party/WebKit/Source/core/dom/PendingScript.h
index 4f42d098a0083e47fbbd0c7c34036bb16972bdd3..58e5c98b715de58f6776ed360d184789d275e94e 100644
--- a/third_party/WebKit/Source/core/dom/PendingScript.h
+++ b/third_party/WebKit/Source/core/dom/PendingScript.h
@@ -27,6 +27,7 @@
#define PendingScript_h
#include "core/CoreExport.h"
+#include "core/dom/Element.h"
#include "core/fetch/ResourceOwner.h"
#include "core/fetch/ScriptResource.h"
#include "platform/heap/Handle.h"
@@ -36,7 +37,6 @@
namespace blink {
-class Element;
class ScriptSourceCode;
class ScriptStreamer;
@@ -45,8 +45,8 @@ class ScriptStreamer;
// A ResourcePtr alone does not prevent the underlying Resource
// from purging its data buffer. This class holds a dummy client open for its
// lifetime in order to guarantee that the data buffer will not be purged.
-class CORE_EXPORT PendingScript final : public ResourceOwner<ScriptResource> {
- DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
+class CORE_EXPORT PendingScript final : public NoBaseWillBeGarbageCollectedFinalized<PendingScript>, public ResourceOwner<ScriptResource> {
+ WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(PendingScript);
public:
enum Type {
ParsingBlocking,
@@ -54,10 +54,11 @@ public:
Async
};
- PendingScript();
- PendingScript(Element*, ScriptResource*);
- PendingScript(const PendingScript&);
- ~PendingScript();
+ static PassOwnPtrWillBeRawPtr<PendingScript> create(Element* element, ScriptResource* resource)
+ {
+ return adoptPtrWillBeNoop(new PendingScript(element, resource));
+ }
+ ~PendingScript() override;
PendingScript& operator=(const PendingScript&);
@@ -86,6 +87,8 @@ public:
bool isReady() const;
private:
+ PendingScript(Element*, ScriptResource*);
+
bool m_watchingForLoad;
RefPtrWillBeMember<Element> m_element;
TextPosition m_startingPosition; // Only used for inline script tags.

Powered by Google App Engine
This is Rietveld 408576698