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

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

Issue 1667843003: Make Resource RefCountedWillBeGarbageCollectedFinalized, attempt #2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase + address review comments Created 4 years, 10 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 1fdf269c29689b6ff6ec47b772b7ca705c72961b..f7d694a4db1c0a09fbac5bb8e5dc59aa376ee12c 100644
--- a/third_party/WebKit/Source/core/dom/PendingScript.h
+++ b/third_party/WebKit/Source/core/dom/PendingScript.h
@@ -42,11 +42,12 @@ class ScriptSourceCode;
// A container for an external script which may be loaded and executed.
//
-// A ResourcePtr alone does not prevent the underlying Resource
+// A RefPtr 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 NoBaseWillBeGarbageCollectedFinalized<PendingScript>, public ResourceOwner<ScriptResource> {
WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(PendingScript);
+ WILL_BE_USING_PRE_FINALIZER(PendingScript, dispose);
public:
static PassOwnPtrWillBeRawPtr<PendingScript> create(Element*, ScriptResource*);
~PendingScript() override;
@@ -57,7 +58,7 @@ public:
void setStartingPosition(const TextPosition& position) { m_startingPosition = position; }
void watchForLoad(ScriptResourceClient*);
- void stopWatchingForLoad(ScriptResourceClient*);
+ void stopWatchingForLoad();
Element* element() const { return m_element.get(); }
void setElement(Element*);
@@ -74,9 +75,12 @@ public:
ScriptSourceCode getSource(const KURL& documentURL, bool& errorOccurred) const;
void setStreamer(PassRefPtrWillBeRawPtr<ScriptStreamer>);
+ void streamingFinished();
bool isReady() const;
+ void dispose();
+
private:
PendingScript(Element*, ScriptResource*);
@@ -86,6 +90,7 @@ private:
bool m_integrityFailure;
RefPtrWillBeMember<ScriptStreamer> m_streamer;
+ ScriptResourceClient* m_client;
};
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/css/StyleRuleImport.cpp ('k') | third_party/WebKit/Source/core/dom/PendingScript.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698