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.cpp

Issue 2268153002: Make PendingScript MemoryCoordinatorClient. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Check only whether m_streamer exists or not. Created 4 years, 4 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
« no previous file with comments | « third_party/WebKit/Source/core/dom/PendingScript.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/PendingScript.cpp
diff --git a/third_party/WebKit/Source/core/dom/PendingScript.cpp b/third_party/WebKit/Source/core/dom/PendingScript.cpp
index 246e3260e2ac618e8c70291106713f6d9169b5f1..c253db696e9e197e65e2988c2f61b58b951c94f9 100644
--- a/third_party/WebKit/Source/core/dom/PendingScript.cpp
+++ b/third_party/WebKit/Source/core/dom/PendingScript.cpp
@@ -48,6 +48,7 @@ PendingScript::PendingScript(Element* element, ScriptResource* resource)
{
setScriptResource(resource);
ThreadState::current()->registerPreFinalizer(this);
+ MemoryCoordinator::instance().registerClient(this);
}
PendingScript::~PendingScript()
@@ -187,6 +188,7 @@ DEFINE_TRACE(PendingScript)
visitor->trace(m_streamer);
visitor->trace(m_client);
ResourceOwner<ScriptResource>::trace(visitor);
+ MemoryCoordinatorClient::trace(visitor);
}
ScriptSourceCode PendingScript::getSource(const KURL& documentURL, bool& errorOccurred) const
@@ -227,4 +229,11 @@ bool PendingScript::errorOccurred() const
return false;
}
+void PendingScript::prepareToSuspend()
+{
+ if (!m_streamer)
+ return;
+ m_streamer->cancel();
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/dom/PendingScript.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698