| 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 c6883614eb35c96c47b14928a821698507f432b4..c7c40556b0d9f20d45043857c3926b05a294325e 100644
|
| --- a/content/browser/service_worker/service_worker_version.cc
|
| +++ b/content/browser/service_worker/service_worker_version.cc
|
| @@ -305,6 +305,7 @@ ServiceWorkerVersion::ServiceWorkerVersion(
|
| registration_id_(registration->id()),
|
| script_url_(script_url),
|
| scope_(registration->pattern()),
|
| + fetch_handler_existence_(FetchHandlerExistence::UNKNOWN),
|
| context_(context),
|
| script_cache_map_(this, context),
|
| ping_controller_(new PingController(this)),
|
| @@ -349,6 +350,12 @@ void ServiceWorkerVersion::SetStatus(Status status) {
|
| TRACE_EVENT2("ServiceWorker", "ServiceWorkerVersion::SetStatus", "Script URL",
|
| script_url_.spec(), "New Status", VersionStatusToString(status));
|
|
|
| + // |fetch_handler_existence_| must be set before setting the status to
|
| + // INSTALLED,
|
| + // ACTIVATING or ACTIVATED.
|
| + DCHECK(fetch_handler_existence_ != FetchHandlerExistence::UNKNOWN ||
|
| + !(status == INSTALLED || status == ACTIVATING || status == ACTIVATED));
|
| +
|
| status_ = status;
|
| if (skip_waiting_ && status_ == ACTIVATED) {
|
| for (int request_id : pending_skip_waiting_requests_)
|
|
|