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

Side by Side Diff: content/browser/service_worker/service_worker_handle.cc

Issue 685503004: ServiceWorker: Remove the obsolete "parsed" state [2/3] (Closed) Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_register_job.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/service_worker/service_worker_handle.h" 5 #include "content/browser/service_worker/service_worker_handle.h"
6 6
7 #include "content/browser/service_worker/service_worker_context_core.h" 7 #include "content/browser/service_worker/service_worker_context_core.h"
8 #include "content/browser/service_worker/service_worker_registration.h" 8 #include "content/browser/service_worker/service_worker_registration.h"
9 #include "content/common/service_worker/service_worker_messages.h" 9 #include "content/common/service_worker/service_worker_messages.h"
10 #include "ipc/ipc_sender.h" 10 #include "ipc/ipc_sender.h"
11 11
12 namespace content { 12 namespace content {
13 13
14 namespace { 14 namespace {
15 15
16 blink::WebServiceWorkerState 16 blink::WebServiceWorkerState
17 GetWebServiceWorkerState(ServiceWorkerVersion* version) { 17 GetWebServiceWorkerState(ServiceWorkerVersion* version) {
18 DCHECK(version); 18 DCHECK(version);
19 switch (version->status()) { 19 switch (version->status()) {
20 case ServiceWorkerVersion::NEW: 20 case ServiceWorkerVersion::NEW:
21 if (version->running_status() == ServiceWorkerVersion::RUNNING) 21 return blink::WebServiceWorkerStateUnknown;
22 return blink::WebServiceWorkerStateParsed;
23 else
24 return blink::WebServiceWorkerStateUnknown;
25 case ServiceWorkerVersion::INSTALLING: 22 case ServiceWorkerVersion::INSTALLING:
26 return blink::WebServiceWorkerStateInstalling; 23 return blink::WebServiceWorkerStateInstalling;
27 case ServiceWorkerVersion::INSTALLED: 24 case ServiceWorkerVersion::INSTALLED:
28 return blink::WebServiceWorkerStateInstalled; 25 return blink::WebServiceWorkerStateInstalled;
29 case ServiceWorkerVersion::ACTIVATING: 26 case ServiceWorkerVersion::ACTIVATING:
30 return blink::WebServiceWorkerStateActivating; 27 return blink::WebServiceWorkerStateActivating;
31 case ServiceWorkerVersion::ACTIVATED: 28 case ServiceWorkerVersion::ACTIVATED:
32 return blink::WebServiceWorkerStateActivated; 29 return blink::WebServiceWorkerStateActivated;
33 case ServiceWorkerVersion::REDUNDANT: 30 case ServiceWorkerVersion::REDUNDANT:
34 return blink::WebServiceWorkerStateRedundant; 31 return blink::WebServiceWorkerStateRedundant;
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 DCHECK_GT(ref_count_, 0); 116 DCHECK_GT(ref_count_, 0);
120 ++ref_count_; 117 ++ref_count_;
121 } 118 }
122 119
123 void ServiceWorkerHandle::DecrementRefCount() { 120 void ServiceWorkerHandle::DecrementRefCount() {
124 DCHECK_GE(ref_count_, 0); 121 DCHECK_GE(ref_count_, 0);
125 --ref_count_; 122 --ref_count_;
126 } 123 }
127 124
128 } // namespace content 125 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_register_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698