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

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

Issue 2840663004: PendingScript: Unify watching_for_load_ with client_. (Closed)
Patch Set: Created 3 years, 8 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 cb907e201d15a4e3f91027ce8752cb158718b415..c7ebdcdc7afbfe8650c3dd0add2b6757d5fc76e2 100644
--- a/third_party/WebKit/Source/core/dom/PendingScript.cpp
+++ b/third_party/WebKit/Source/core/dom/PendingScript.cpp
@@ -32,8 +32,7 @@ namespace blink {
PendingScript::PendingScript(ScriptElementBase* element,
const TextPosition& starting_position)
- : watching_for_load_(false),
- element_(element),
+ : element_(element),
starting_position_(starting_position),
parser_blocking_load_start_time_(0),
client_(nullptr) {}
@@ -56,12 +55,12 @@ void PendingScript::WatchForLoad(PendingScriptClient* client) {
CheckState();
DCHECK(!IsWatchingForLoad());
+ DCHECK(client);
// addClient() will call streamingFinished() 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. We also need to set
// m_watchingForLoad early, since addClient() can result in calling
// notifyFinished and further stopWatchingForLoad().
- watching_for_load_ = true;
client_ = client;
if (IsReady())
client_->PendingScriptFinished(this);
@@ -73,7 +72,6 @@ void PendingScript::StopWatchingForLoad() {
CheckState();
DCHECK(IsExternal());
client_ = nullptr;
- watching_for_load_ = false;
}
ScriptElementBase* PendingScript::GetElement() const {
« 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