Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1442)

Unified Diff: content/browser/service_worker/service_worker_version.cc

Issue 1731073002: Relax timeout for starting a service worker from 10 sec to 1 minute. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/service_worker/service_worker_version.cc
diff --git a/content/browser/service_worker/service_worker_version.cc b/content/browser/service_worker/service_worker_version.cc
index 105f168f9f1058a731d3486a7fa4d549d4040a56..28fd383e35cf259818449eecde1684247219e116 100644
--- a/content/browser/service_worker/service_worker_version.cc
+++ b/content/browser/service_worker/service_worker_version.cc
@@ -205,7 +205,7 @@ bool IsInstalled(ServiceWorkerVersion::Status status) {
} // namespace
const int ServiceWorkerVersion::kTimeoutTimerDelaySeconds = 30;
-const int ServiceWorkerVersion::kStartInstalledWorkerTimeoutSeconds = 10;
+const int ServiceWorkerVersion::kStartInstalledWorkerTimeoutSeconds = 60;
const int ServiceWorkerVersion::kStartNewWorkerTimeoutMinutes = 5;
const int ServiceWorkerVersion::kRequestTimeoutMinutes = 5;
const int ServiceWorkerVersion::kStopWorkerTimeoutSeconds = 5;
@@ -808,11 +808,6 @@ void ServiceWorkerVersion::OnStarted() {
DCHECK_EQ(RUNNING, running_status());
RestartTick(&idle_time_);
- // Reset the interval to normal. If may have been shortened so starting an
- // existing worker can timeout quickly.
- SetTimeoutTimerInterval(
- base::TimeDelta::FromSeconds(kTimeoutTimerDelaySeconds));
-
// Fire all start callbacks.
scoped_refptr<ServiceWorkerVersion> protect(this);
RunCallbacks(this, &start_callbacks_, SERVICE_WORKER_OK);
@@ -1392,16 +1387,9 @@ void ServiceWorkerVersion::StartTimeoutTimer() {
// Ping will be activated in OnScriptLoaded.
ping_controller_->Deactivate();
- // Make the timer delay shorter for starting an existing
- // worker so stalled in starting workers can be timed out quickly.
- // The timer will be reset to normal in OnStarted or the next start
- // attempt.
- const int delay_in_seconds = IsInstalled(status_)
- ? kStartInstalledWorkerTimeoutSeconds
- : kTimeoutTimerDelaySeconds;
timeout_timer_.Start(FROM_HERE,
- base::TimeDelta::FromSeconds(delay_in_seconds), this,
- &ServiceWorkerVersion::OnTimeoutTimer);
+ base::TimeDelta::FromSeconds(kTimeoutTimerDelaySeconds),
+ this, &ServiceWorkerVersion::OnTimeoutTimer);
}
void ServiceWorkerVersion::StopTimeoutTimer() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698