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

Unified Diff: Source/core/dom/PendingScript.cpp

Issue 669503003: Revert of Refactor Script(Loader|Runner): don't access Resources all over the place... (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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 | « Source/bindings/core/v8/ScriptStreamer.h ('k') | Source/core/dom/ScriptLoader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/PendingScript.cpp
diff --git a/Source/core/dom/PendingScript.cpp b/Source/core/dom/PendingScript.cpp
index a3601a960d17c1cecec68ce2bb2e77bf44715148..143e6680b7c9f92eb4a9087fd54e9b2a75240e34 100644
--- a/Source/core/dom/PendingScript.cpp
+++ b/Source/core/dom/PendingScript.cpp
@@ -40,12 +40,13 @@
void PendingScript::watchForLoad(ScriptResourceClient* client)
{
ASSERT(!m_watchingForLoad);
- // addClient() will call notifyFinished() if the load is complete. Callers
- // who do not expect to be re-entered from this call should not call
- // watchForLoad for a PendingScript which isReady.
+ ASSERT(!isReady());
if (m_streamer) {
m_streamer->addClient(client);
} else {
+ // addClient() will call notifyFinished() if the load is
+ // complete. Callers do not expect to be re-entered from this call, so
+ // they should not become a client of an already-loaded Resource.
resource()->addClient(client);
}
m_watchingForLoad = true;
« no previous file with comments | « Source/bindings/core/v8/ScriptStreamer.h ('k') | Source/core/dom/ScriptLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698