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 <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 for (std::vector<ServiceWorkerRegistrationInfo>::const_iterator it = | 209 for (std::vector<ServiceWorkerRegistrationInfo>::const_iterator it = |
210 registrations.begin(); | 210 registrations.begin(); |
211 it != registrations.end(); | 211 it != registrations.end(); |
212 ++it) { | 212 ++it) { |
213 const ServiceWorkerRegistrationInfo& registration = *it; | 213 const ServiceWorkerRegistrationInfo& registration = *it; |
214 DictionaryValue* registration_info = new DictionaryValue(); | 214 DictionaryValue* registration_info = new DictionaryValue(); |
215 registration_info->SetString("scope", registration.pattern.spec()); | 215 registration_info->SetString("scope", registration.pattern.spec()); |
216 registration_info->SetString( | 216 registration_info->SetString( |
217 "registration_id", base::Int64ToString(registration.registration_id)); | 217 "registration_id", base::Int64ToString(registration.registration_id)); |
218 | 218 |
219 if (!registration.active_version.is_null) { | 219 if (registration.active_version.version_id != |
| 220 kInvalidServiceWorkerVersionId) { |
220 DictionaryValue* active_info = new DictionaryValue(); | 221 DictionaryValue* active_info = new DictionaryValue(); |
221 UpdateVersionInfo(registration.active_version, active_info); | 222 UpdateVersionInfo(registration.active_version, active_info); |
222 registration_info->Set("active", active_info); | 223 registration_info->Set("active", active_info); |
223 } | 224 } |
224 | 225 |
225 if (!registration.waiting_version.is_null) { | 226 if (registration.waiting_version.version_id != |
| 227 kInvalidServiceWorkerVersionId) { |
226 DictionaryValue* waiting_info = new DictionaryValue(); | 228 DictionaryValue* waiting_info = new DictionaryValue(); |
227 UpdateVersionInfo(registration.waiting_version, waiting_info); | 229 UpdateVersionInfo(registration.waiting_version, waiting_info); |
228 registration_info->Set("waiting", waiting_info); | 230 registration_info->Set("waiting", waiting_info); |
229 } | 231 } |
230 | 232 |
231 result->Append(registration_info); | 233 result->Append(registration_info); |
232 } | 234 } |
233 return result; | 235 return result; |
234 } | 236 } |
235 | 237 |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 return; | 668 return; |
667 } | 669 } |
668 | 670 |
669 base::Callback<void(ServiceWorkerStatusCode)> callback = | 671 base::Callback<void(ServiceWorkerStatusCode)> callback = |
670 base::Bind(OperationCompleteCallback, AsWeakPtr(), callback_id); | 672 base::Bind(OperationCompleteCallback, AsWeakPtr(), callback_id); |
671 FindRegistrationForPattern( | 673 FindRegistrationForPattern( |
672 context, GURL(scope_string), base::Bind(StartActiveWorker, callback)); | 674 context, GURL(scope_string), base::Bind(StartActiveWorker, callback)); |
673 } | 675 } |
674 | 676 |
675 } // namespace content | 677 } // namespace content |
OLD | NEW |