Commit 633f2dd3 authored by Kenichi Ishibashi's avatar Kenichi Ishibashi Committed by Commit Bot

service worker: Remove instrumentation for redundant controllers

This CL reverts two commits that were added to investigate redundant
controllers which should not exist.
- crrev.com/c/2114478
- crrev.com/c/2126407

We may re-add these instrumentation later.

Bug: 1015692
Change-Id: I0bf98e78898b2c636d4d0ffc7beabda8e9da8ddc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2131427Reviewed-by: default avatarMakoto Shimazu <shimazu@chromium.org>
Commit-Queue: Kenichi Ishibashi <bashi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#755298}
parent b010b7f5
......@@ -659,9 +659,6 @@ void ServiceWorkerRegisterJob::OnStoreRegistrationComplete(
// TODO(falken): Move this further down. The spec says to set status to
// 'redundant' after promoting the new version to .waiting attribute and
// 'installed' status.
// TODO(crbug.com/951571): Remove this once we identified the cause of
// crash.
CHECK(!registration()->waiting_version()->HasControllee());
registration()->waiting_version()->SetStatus(
ServiceWorkerVersion::REDUNDANT);
}
......
......@@ -8,7 +8,6 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/debug/alias.h"
#include "base/threading/thread_task_runner_handle.h"
#include "content/browser/service_worker/embedded_worker_status.h"
#include "content/browser/service_worker/service_worker_container_host.h"
......@@ -40,48 +39,6 @@ ServiceWorkerVersionInfo GetVersionInfo(ServiceWorkerVersion* version) {
return version->GetInfo();
}
// TODO(crbug.com/1015692): Remove this and CrashDueToControllee() once we
// identified the cause of crash.
struct ControlleeInfo {
std::string client_uuid;
ServiceWorkerVersion* controller;
ServiceWorkerRegistration* controller_registration;
bool is_context_secure_for_service_worker;
explicit ControlleeInfo(const ServiceWorkerContainerHost& container_host)
: client_uuid(container_host.client_uuid()),
controller(container_host.controller()),
controller_registration(container_host.controller_registration()),
is_context_secure_for_service_worker(
container_host.IsContextSecureForServiceWorker()) {}
};
void CrashDueToControllee(
ServiceWorkerRegistration* registration,
scoped_refptr<ServiceWorkerVersion> exiting_version,
scoped_refptr<ServiceWorkerVersion> activating_version) {
std::vector<ControlleeInfo> controllees_in_exiting;
for (const auto& it : exiting_version->controllee_map()) {
ControlleeInfo info(*it.second);
controllees_in_exiting.push_back(info);
}
std::vector<ControlleeInfo> controllees_in_activating;
for (const auto& it : activating_version->controllee_map()) {
ControlleeInfo info(*it.second);
controllees_in_activating.push_back(info);
}
bool exiting_version_skip_waiting = exiting_version->skip_waiting();
bool activating_version_skip_waiting = activating_version->skip_waiting();
base::debug::Alias(&registration);
base::debug::Alias(&controllees_in_exiting);
base::debug::Alias(&controllees_in_activating);
base::debug::Alias(&exiting_version_skip_waiting);
base::debug::Alias(&activating_version_skip_waiting);
CHECK(false);
}
} // namespace
ServiceWorkerRegistration::ServiceWorkerRegistration(
......@@ -548,11 +505,6 @@ void ServiceWorkerRegistration::ActivateWaitingVersion(bool delay) {
observer.OnSkippedWaiting(this);
}
// TODO(crbug.com/1015692): Remove this once we identified the cause of crash.
if (exiting_version && exiting_version->HasControllee()) {
CrashDueToControllee(this, exiting_version, activating_version);
}
// "10. Queue a task to fire an event named activate..."
// The browser could be shutting down. To avoid spurious start worker
// failures, wait a bit before continuing.
......
......@@ -376,9 +376,6 @@ void ServiceWorkerVersion::SetStatus(Status status) {
} else if (status == REDUNDANT) {
embedded_worker_->OnWorkerVersionDoomed();
// TODO(crbug.com/1021718): Remove this check after we identified the cause.
CHECK(bfcached_controllee_map_.empty());
// TODO(crbug.com/951571): Remove this once we figured out the cause of
// invalid controller status.
redundant_state_callstack_ = base::debug::StackTrace();
......@@ -766,10 +763,6 @@ void ServiceWorkerVersion::AddControllee(
// TODO(yuzus, crbug.com/951571): Remove these CHECKs once we figure out the
// cause of crash.
if (status_ == REDUNDANT) {
DEBUG_ALIAS_FOR_CSTR(redundant_callstack_str,
redundant_state_callstack_.ToString().c_str(), 1024);
}
CHECK_NE(status_, NEW);
CHECK_NE(status_, INSTALLING);
CHECK_NE(status_, INSTALLED);
......@@ -958,9 +951,7 @@ void ServiceWorkerVersion::Doom() {
container_host->NotifyControllerLost();
}
// Any controllee this version had should have removed itself.
// TODO(crbug.com/951571): Change to DCHECK once we identified the cause of
// crash.
CHECK(!HasControllee());
DCHECK(!HasControllee());
SetStatus(REDUNDANT);
if (running_status() == EmbeddedWorkerStatus::STARTING ||
......
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