Commit 8e745b96 authored by Yuzu Saijo's avatar Yuzu Saijo Committed by Commit Bot

[bfcache] Add CHECKs to debug crashes in SW and bfcache integration

This CL adds CHECKs to figure out where the crash is coming from around
bfcache and ServiceWorker integration.


Bug: 1021718
Change-Id: I8cf144618fa79591e9f9b2679b8535b50eeac2f8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1900796
Commit-Queue: Yuzu Saijo <yuzus@chromium.org>
Reviewed-by: default avatarMatt Falkenhagen <falken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#712951}
parent 8a814494
......@@ -711,9 +711,14 @@ void ServiceWorkerVersion::RunAfterStartWorker(
void ServiceWorkerVersion::AddControllee(
ServiceWorkerProviderHost* provider_host) {
DCHECK_CURRENTLY_ON(ServiceWorkerContext::GetCoreThreadId());
// TODO(crbug.com/1021718): Remove this CHECK once we figure out the cause of
// crash.
CHECK(provider_host);
const std::string& uuid = provider_host->client_uuid();
CHECK(!provider_host->client_uuid().empty());
DCHECK(!base::Contains(controllee_map_, uuid));
// TODO(crbug.com/1021718): Change to DCHECK once we figure out the cause of
// crash.
CHECK(!base::Contains(controllee_map_, uuid));
// TODO(crbug.com/951571): Change to DCHECK once we figured out the cause of
// invalid controller status.
CHECK(status_ == ACTIVATING || status_ == ACTIVATED);
......@@ -764,9 +769,11 @@ void ServiceWorkerVersion::MoveControlleeToBackForwardCacheMap(
void ServiceWorkerVersion::RestoreControlleeFromBackForwardCacheMap(
const std::string& client_uuid) {
DCHECK(IsBackForwardCacheEnabled());
DCHECK(!base::Contains(controllee_map_, client_uuid));
DCHECK(base::Contains(bfcached_controllee_map_, client_uuid));
// TODO(crbug.com/1021718): Change these to DCHECK once we figure out the
// cause of crash.
CHECK(IsBackForwardCacheEnabled());
CHECK(!base::Contains(controllee_map_, client_uuid));
CHECK(base::Contains(bfcached_controllee_map_, client_uuid));
AddControllee(bfcached_controllee_map_[client_uuid]);
bfcached_controllee_map_.erase(client_uuid);
}
......
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