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

Side by Side Diff: content/browser/resources/service_worker/serviceworker_internals.js

Issue 305353002: Clean-up serviceworker-internals page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Incorporated falken's comments. Created 6 years, 6 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
« no previous file with comments | « content/browser/resources/service_worker/serviceworker_internals.html ('k') | no next file » | 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 cr.define('serviceworker', function() { 5 cr.define('serviceworker', function() {
6 'use strict'; 6 'use strict';
7 7
8 function initialize() { 8 function initialize() {
9 if (window.location.hash == "#iframe") { 9 if (window.location.hash == "#iframe") {
10 // This page is loaded from chrome://inspect. 10 // This page is loaded from chrome://inspect.
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 } 178 }
179 var unregistered_registrations = []; 179 var unregistered_registrations = [];
180 var unregistered_versions = []; 180 var unregistered_versions = [];
181 getUnregisteredWorkers(stored_registrations, 181 getUnregisteredWorkers(stored_registrations,
182 live_registrations, 182 live_registrations,
183 live_versions, 183 live_versions,
184 unregistered_registrations, 184 unregistered_registrations,
185 unregistered_versions); 185 unregistered_versions);
186 var template; 186 var template;
187 var container = $('serviceworker-list'); 187 var container = $('serviceworker-list');
188 // Existing templates are keyed by partition_path. This allows 188 // Existing templates are keyed by partition_id. This allows
189 // the UI to be updated in-place rather than refreshing the 189 // the UI to be updated in-place rather than refreshing the
190 // whole page. 190 // whole page.
191 for (var i = 0; i < container.childNodes.length; ++i) { 191 for (var i = 0; i < container.childNodes.length; ++i) {
192 if (container.childNodes[i].partition_path == partition_path) { 192 if (container.childNodes[i].partition_id == partition_id) {
193 template = container.childNodes[i]; 193 template = container.childNodes[i];
194 } 194 }
195 } 195 }
196 // This is probably the first time we're loading. 196 // This is probably the first time we're loading.
197 if (!template) { 197 if (!template) {
198 template = jstGetTemplate('serviceworker-list-template'); 198 template = jstGetTemplate('serviceworker-list-template');
199 container.appendChild(template); 199 container.appendChild(template);
200 } 200 }
201 var fillLogFunc = fillLogForVersion.bind(this, partition_id); 201 var fillLogFunc = fillLogForVersion.bind(this, partition_id);
202 stored_registrations.forEach(function(registration) { 202 stored_registrations.forEach(function(registration) {
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 onWorkerStopped: onWorkerStopped, 295 onWorkerStopped: onWorkerStopped,
296 onErrorReported: onErrorReported, 296 onErrorReported: onErrorReported,
297 onConsoleMessageReported: onConsoleMessageReported, 297 onConsoleMessageReported: onConsoleMessageReported,
298 onVersionStateChanged: onVersionStateChanged, 298 onVersionStateChanged: onVersionStateChanged,
299 onRegistrationStored: onRegistrationStored, 299 onRegistrationStored: onRegistrationStored,
300 onRegistrationDeleted: onRegistrationDeleted, 300 onRegistrationDeleted: onRegistrationDeleted,
301 }; 301 };
302 }); 302 });
303 303
304 document.addEventListener('DOMContentLoaded', serviceworker.initialize); 304 document.addEventListener('DOMContentLoaded', serviceworker.initialize);
OLDNEW
« no previous file with comments | « content/browser/resources/service_worker/serviceworker_internals.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698