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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 case ServiceWorkerVersion::ACTIVATING: | 190 case ServiceWorkerVersion::ACTIVATING: |
191 info->SetString("status", "ACTIVATING"); | 191 info->SetString("status", "ACTIVATING"); |
192 break; | 192 break; |
193 case ServiceWorkerVersion::ACTIVATED: | 193 case ServiceWorkerVersion::ACTIVATED: |
194 info->SetString("status", "ACTIVATED"); | 194 info->SetString("status", "ACTIVATED"); |
195 break; | 195 break; |
196 case ServiceWorkerVersion::REDUNDANT: | 196 case ServiceWorkerVersion::REDUNDANT: |
197 info->SetString("status", "REDUNDANT"); | 197 info->SetString("status", "REDUNDANT"); |
198 break; | 198 break; |
199 } | 199 } |
| 200 info->SetString("script_url", version.script_url.spec()); |
200 info->SetString("version_id", base::Int64ToString(version.version_id)); | 201 info->SetString("version_id", base::Int64ToString(version.version_id)); |
201 info->SetInteger("process_id", version.process_id); | 202 info->SetInteger("process_id", version.process_id); |
202 info->SetInteger("thread_id", version.thread_id); | 203 info->SetInteger("thread_id", version.thread_id); |
203 info->SetInteger("devtools_agent_route_id", version.devtools_agent_route_id); | 204 info->SetInteger("devtools_agent_route_id", version.devtools_agent_route_id); |
204 } | 205 } |
205 | 206 |
206 ListValue* GetRegistrationListValue( | 207 ListValue* GetRegistrationListValue( |
207 const std::vector<ServiceWorkerRegistrationInfo>& registrations) { | 208 const std::vector<ServiceWorkerRegistrationInfo>& registrations) { |
208 ListValue* result = new ListValue(); | 209 ListValue* result = new ListValue(); |
209 for (std::vector<ServiceWorkerRegistrationInfo>::const_iterator it = | 210 for (std::vector<ServiceWorkerRegistrationInfo>::const_iterator it = |
210 registrations.begin(); | 211 registrations.begin(); |
211 it != registrations.end(); | 212 it != registrations.end(); |
212 ++it) { | 213 ++it) { |
213 const ServiceWorkerRegistrationInfo& registration = *it; | 214 const ServiceWorkerRegistrationInfo& registration = *it; |
214 DictionaryValue* registration_info = new DictionaryValue(); | 215 DictionaryValue* registration_info = new DictionaryValue(); |
215 registration_info->SetString("scope", registration.pattern.spec()); | 216 registration_info->SetString("scope", registration.pattern.spec()); |
216 registration_info->SetString("script_url", registration.script_url.spec()); | |
217 registration_info->SetString( | 217 registration_info->SetString( |
218 "registration_id", base::Int64ToString(registration.registration_id)); | 218 "registration_id", base::Int64ToString(registration.registration_id)); |
219 | 219 |
220 if (!registration.active_version.is_null) { | 220 if (!registration.active_version.is_null) { |
221 DictionaryValue* active_info = new DictionaryValue(); | 221 DictionaryValue* active_info = new DictionaryValue(); |
222 UpdateVersionInfo(registration.active_version, active_info); | 222 UpdateVersionInfo(registration.active_version, active_info); |
223 registration_info->Set("active", active_info); | 223 registration_info->Set("active", active_info); |
224 } | 224 } |
225 | 225 |
226 if (!registration.waiting_version.is_null) { | 226 if (!registration.waiting_version.is_null) { |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
668 return; | 668 return; |
669 } | 669 } |
670 | 670 |
671 base::Callback<void(ServiceWorkerStatusCode)> callback = | 671 base::Callback<void(ServiceWorkerStatusCode)> callback = |
672 base::Bind(OperationCompleteCallback, AsWeakPtr(), callback_id); | 672 base::Bind(OperationCompleteCallback, AsWeakPtr(), callback_id); |
673 FindRegistrationForPattern( | 673 FindRegistrationForPattern( |
674 context, GURL(scope_string), base::Bind(StartActiveWorker, callback)); | 674 context, GURL(scope_string), base::Bind(StartActiveWorker, callback)); |
675 } | 675 } |
676 | 676 |
677 } // namespace content | 677 } // namespace content |
OLD | NEW |