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 |