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

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

Issue 246183003: DevTools Support for ServiceWoker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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
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 update() { 8 function update() {
9 chrome.send('getAllRegistrations'); 9 chrome.send('getAllRegistrations');
10 } 10 }
11 11
12 function progressNodeFor(link) { 12 function progressNodeFor(link) {
13 return link.parentNode.querySelector('.operation-status'); 13 return link.parentNode.querySelector('.operation-status');
14 } 14 }
15 15
16 // All commands are sent with the partition_path and scope, and 16 // All commands are sent with the partition_path and scope, and
17 // are all completed with 'onOperationComplete'. 17 // are all completed with 'onOperationComplete'.
18 var COMMANDS = ['unregister', 'start', 'stop', 'sync']; 18 var COMMANDS = ['unregister', 'start', 'stop', 'sync', 'inspect'];
19 function commandHandler(command) { 19 function commandHandler(command) {
20 return function(event) { 20 return function(event) {
21 var link = event.target; 21 var link = event.target;
22 progressNodeFor(link).style.display = 'inline'; 22 progressNodeFor(link).style.display = 'inline';
23 chrome.send(command, [link.partition_path, 23 chrome.send(command, [link.partition_path,
24 link.scope]); 24 link.scope]);
25 return false; 25 return false;
26 }; 26 };
27 }; 27 };
28 28
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 onPartitionData: onPartitionData, 161 onPartitionData: onPartitionData,
162 onWorkerStarted: onWorkerStarted, 162 onWorkerStarted: onWorkerStarted,
163 onWorkerStopped: onWorkerStopped, 163 onWorkerStopped: onWorkerStopped,
164 onErrorReported: onErrorReported, 164 onErrorReported: onErrorReported,
165 onConsoleMessageReported: onConsoleMessageReported, 165 onConsoleMessageReported: onConsoleMessageReported,
166 onVersionStateChanged: onVersionStateChanged, 166 onVersionStateChanged: onVersionStateChanged,
167 }; 167 };
168 }); 168 });
169 169
170 document.addEventListener('DOMContentLoaded', serviceworker.update); 170 document.addEventListener('DOMContentLoaded', serviceworker.update);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698