Skip to content

Commit

Permalink
Ensure client_uuid() is moved to BFCacheMap only once
Browse files Browse the repository at this point in the history
I still assume that dedicated workers with blob URL top level scripts
are not treated correctly here, and their client ID might be registered
twice.  That is the reason why restore from BFCache has UUID when
it got resumed.

Let me add CHECK to clarify my guess is correct.

Bug: 330928087
Change-Id: I348a1eac8e282eab6238e797e05a57a7aecee03b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5534193
Reviewed-by: Minoru Chikamune <[email protected]>
Commit-Queue: Yoshisato Yanagisawa <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1301699}
  • Loading branch information
yoshisatoyanagisawa authored and Chromium LUCI CQ committed May 16, 2024
1 parent 83ff3a9 commit b79c4fb
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion content/browser/service_worker/service_worker_container_host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1496,8 +1496,18 @@ void ServiceWorkerClient::EvictFromBackForwardCache(
void ServiceWorkerClient::OnEnterBackForwardCache() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(IsBackForwardCacheEnabled());
if (controller_)
if (controller_) {
// TODO(crbug.com/330928087): remove check when this issue resolved.
SCOPED_CRASH_KEY_NUMBER("SWV_RCFBCM", "client_type",
static_cast<int32_t>(GetClientType()));
SCOPED_CRASH_KEY_BOOL("SWV_RCFBCM", "is_execution_ready",
is_execution_ready());
SCOPED_CRASH_KEY_BOOL("SWV_RCFBCM", "is_blob_url",
url() != GetUrlForScopeMatch());
SCOPED_CRASH_KEY_BOOL("SWV_RCFBCM", "is_inherited", is_inherited());
CHECK(!controller_->BFCacheContainsControllee(client_uuid()));
controller_->MoveControlleeToBackForwardCacheMap(client_uuid());
}
is_in_back_forward_cache_ = true;
}

Expand Down

0 comments on commit b79c4fb

Please sign in to comment.