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..374d30a6de8a3d095a63c5fd21d87cf4fe40235b 100644 |
--- a/third_party/WebKit/Source/core/dom/PendingScript.cpp |
+++ b/third_party/WebKit/Source/core/dom/PendingScript.cpp |
@@ -48,10 +48,12 @@ PendingScript::PendingScript(Element* element, ScriptResource* resource) |
{ |
setScriptResource(resource); |
ThreadState::current()->registerPreFinalizer(this); |
+ MemoryCoordinator::instance().registerClient(this); |
} |
PendingScript::~PendingScript() |
{ |
+ MemoryCoordinator::instance().unregisterClient(this); |
haraken
2016/08/24 06:11:12
You don't need to (shouldn't) call this. Oilpan's
tasak
2016/08/24 07:44:54
Done.
|
} |
void PendingScript::dispose() |
@@ -187,6 +189,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 +230,13 @@ bool PendingScript::errorOccurred() const |
return false; |
} |
+void PendingScript::prepareToSuspend() |
+{ |
+ if (resource() && resource()->isLoaded()) |
haraken
2016/08/24 06:11:12
Would you help me understand why we need this chec
tasak
2016/08/24 07:44:53
When I chatted with hiroshige@, he said that Scrip
marja
2016/08/24 09:02:55
If the resource is loaded we might still be parsin
tasak
2016/08/24 11:01:03
In the case, I would like to update ScriptResource
|
+ return; |
+ if (!m_streamer) |
+ return; |
+ m_streamer->cancel(); |
+} |
+ |
} // namespace blink |