OLD | NEW |
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_internals_ui.h" | 5 #include "content/browser/service_worker/service_worker_internals_ui.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 // of the process handle and the render host still retains it. Therefore, we | 106 // of the process handle and the render host still retains it. Therefore, we |
107 // cannot create a base::Process object, which provides a proper way to get a | 107 // cannot create a base::Process object, which provides a proper way to get a |
108 // process id, from the handle. For a stopgap, we use this deprecated | 108 // process id, from the handle. For a stopgap, we use this deprecated |
109 // function that does not require the ownership (http://crbug.com/417532). | 109 // function that does not require the ownership (http://crbug.com/417532). |
110 return base::GetProcId(handle); | 110 return base::GetProcId(handle); |
111 } | 111 } |
112 | 112 |
113 void UpdateVersionInfo(const ServiceWorkerVersionInfo& version, | 113 void UpdateVersionInfo(const ServiceWorkerVersionInfo& version, |
114 DictionaryValue* info) { | 114 DictionaryValue* info) { |
115 switch (version.running_status) { | 115 switch (version.running_status) { |
116 case ServiceWorkerVersion::STOPPED: | 116 case ServiceWorkerVersion::RunningStatus::STOPPED: |
117 info->SetString("running_status", "STOPPED"); | 117 info->SetString("running_status", "STOPPED"); |
118 break; | 118 break; |
119 case ServiceWorkerVersion::STARTING: | 119 case ServiceWorkerVersion::RunningStatus::STARTING: |
120 info->SetString("running_status", "STARTING"); | 120 info->SetString("running_status", "STARTING"); |
121 break; | 121 break; |
122 case ServiceWorkerVersion::RUNNING: | 122 case ServiceWorkerVersion::RunningStatus::RUNNING: |
123 info->SetString("running_status", "RUNNING"); | 123 info->SetString("running_status", "RUNNING"); |
124 break; | 124 break; |
125 case ServiceWorkerVersion::STOPPING: | 125 case ServiceWorkerVersion::RunningStatus::STOPPING: |
126 info->SetString("running_status", "STOPPING"); | 126 info->SetString("running_status", "STOPPING"); |
127 break; | 127 break; |
128 } | 128 } |
129 | 129 |
130 switch (version.status) { | 130 switch (version.status) { |
131 case ServiceWorkerVersion::NEW: | 131 case ServiceWorkerVersion::NEW: |
132 info->SetString("status", "NEW"); | 132 info->SetString("status", "NEW"); |
133 break; | 133 break; |
134 case ServiceWorkerVersion::INSTALLING: | 134 case ServiceWorkerVersion::INSTALLING: |
135 info->SetString("status", "INSTALLING"); | 135 info->SetString("status", "INSTALLING"); |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
587 callback.Run(SERVICE_WORKER_ERROR_ABORT); | 587 callback.Run(SERVICE_WORKER_ERROR_ABORT); |
588 return; | 588 return; |
589 } | 589 } |
590 | 590 |
591 // ServiceWorkerContextWrapper::UnregisterServiceWorker doesn't work here | 591 // ServiceWorkerContextWrapper::UnregisterServiceWorker doesn't work here |
592 // because that reduces a status code to boolean. | 592 // because that reduces a status code to boolean. |
593 context->context()->UnregisterServiceWorker(scope, callback); | 593 context->context()->UnregisterServiceWorker(scope, callback); |
594 } | 594 } |
595 | 595 |
596 } // namespace content | 596 } // namespace content |
OLD | NEW |