Commit 87879945 authored by Leszek Swirski's avatar Leszek Swirski Committed by Commit Bot

[blink] Clear the ScriptResource watcher on IsLoaded

The loaded state could come from an external error, so the watcher may
not have picked it up yet. Just explicitly cancel the watcher rather
than trying to CHECK for it being closed in time.

Bug: 944390
Change-Id: I575b1b0b40c11a7db5f4d81d4b5ef358436e859c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1532011Reviewed-by: default avatarYutaka Hirano <yhirano@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#644211}
parent 38bea879
......@@ -460,7 +460,7 @@ void ScriptResource::SetClientIsWaitingForFinished() {
not_streaming_reason_ = ScriptStreamer::kStreamingDisabled;
// Trigger the finished notification if needed.
if (IsLoaded()) {
CHECK(!watcher_ || !watcher_->IsWatching());
watcher_.reset();
data_pipe_.reset();
AdvanceStreamingState(StreamingState::kFinishedNotificationSent);
TextResource::NotifyFinished();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment