Commit 3e255aed authored by Leszek Swirski's avatar Leszek Swirski Committed by Commit Bot

[blink] Remove IsFinished check for TextForInspector

There are some edge cases where IsLoaded is true but IsFinishedInternal
is not (yet) true, so remove that check and expand the comment.

Bug: 865098
Bug: 899217
Bug: 909858
Change-Id: I886df54c9a373e7431938aadd4a6a1a4d256d7dc
Reviewed-on: https://chromium-review.googlesource.com/c/1369789Reviewed-by: default avatarHiroshige Hayashizaki <hiroshige@chromium.org>
Reviewed-by: default avatarKouhei Ueno <kouhei@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#615468}
parent 154ccf48
......@@ -156,7 +156,6 @@ String ScriptResource::TextForInspector() const {
// the assumptions are confirmed.
if (IsLoaded()) {
CHECK(IsFinishedInternal());
if (!source_text_.IsNull()) {
// 1. We have finished loading, and have already decoded the buffer into
// the source text and cleared the resource buffer to save space.
......@@ -164,15 +163,19 @@ String ScriptResource::TextForInspector() const {
}
// 2. We have finished loading with no data received, so no streaming ever
// happened or streaming was suppressed.
// happened or streaming was suppressed. Note that the finished
// notification may not have come through yet because of task posting, so
// NotifyFinished may not have been called yet. Regardless, there was no
// data, so the text should be empty.
//
// TODO(crbug/909858) Currently this CHECK can occasionally fail, but this
// doesn't seem to cause real issues immediately. For now, we suppress the
// crashes on release builds by making this a DCHECK and continue baking the
// script streamer control (crbug/865098) on beta, while investigating the
// failure reason on canary.
DCHECK(!streamer_ || streamer_->StreamingSuppressedReason() ==
ScriptStreamer::kScriptTooSmall);
DCHECK(!IsFinishedInternal() || !streamer_ ||
streamer_->StreamingSuppressedReason() ==
ScriptStreamer::kScriptTooSmall);
return "";
}
......
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