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

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: 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..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
« 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