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

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

Issue 501453002: Decouple script_url from ServiceWorkerRegistration (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync after major collision Created 6 years, 3 months 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 | Annotate | Revision Log
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_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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698