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

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

Issue 985663002: Implement ServiceWorkerRegistration related DevTools events [2/2 chromium] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: override Created 5 years, 9 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 initialize() { 8 function initialize() {
9 update(); 9 update();
10 } 10 }
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 var links = container.querySelectorAll('button.' + COMMANDS[i]); 185 var links = container.querySelectorAll('button.' + COMMANDS[i]);
186 for (var j = 0; j < links.length; ++j) { 186 for (var j = 0; j < links.length; ++j) {
187 if (!links[j].hasClickEvent) { 187 if (!links[j].hasClickEvent) {
188 links[j].addEventListener('click', handler, false); 188 links[j].addEventListener('click', handler, false);
189 links[j].hasClickEvent = true; 189 links[j].hasClickEvent = true;
190 } 190 }
191 } 191 }
192 } 192 }
193 } 193 }
194 194
195 function onWorkerStarted(partition_id, version_id, process_id, thread_id) { 195 function onRunningStateChanged(partition_id, version_id) {
196 update(); 196 update();
197 } 197 }
198 198
199 function onWorkerStopped(partition_id, version_id, process_id, thread_id) {
200 update();
201 }
202
203 function onErrorReported(partition_id, 199 function onErrorReported(partition_id,
204 version_id, 200 version_id,
205 process_id, 201 process_id,
206 thread_id, 202 thread_id,
207 error_info) { 203 error_info) {
208 outputLogMessage(partition_id, 204 outputLogMessage(partition_id,
209 version_id, 205 version_id,
210 'Error: ' + JSON.stringify(error_info) + '\n'); 206 'Error: ' + JSON.stringify(error_info) + '\n');
211 } 207 }
212 208
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 logArea.value += message; 247 logArea.value += message;
252 } 248 }
253 } 249 }
254 } 250 }
255 251
256 return { 252 return {
257 initialize: initialize, 253 initialize: initialize,
258 onOptions: onOptions, 254 onOptions: onOptions,
259 onOperationComplete: onOperationComplete, 255 onOperationComplete: onOperationComplete,
260 onPartitionData: onPartitionData, 256 onPartitionData: onPartitionData,
261 onWorkerStarted: onWorkerStarted, 257 onRunningStateChanged: onRunningStateChanged,
262 onWorkerStopped: onWorkerStopped,
263 onErrorReported: onErrorReported, 258 onErrorReported: onErrorReported,
264 onConsoleMessageReported: onConsoleMessageReported, 259 onConsoleMessageReported: onConsoleMessageReported,
265 onVersionStateChanged: onVersionStateChanged, 260 onVersionStateChanged: onVersionStateChanged,
266 onRegistrationStored: onRegistrationStored, 261 onRegistrationStored: onRegistrationStored,
267 onRegistrationDeleted: onRegistrationDeleted, 262 onRegistrationDeleted: onRegistrationDeleted,
268 }; 263 };
269 }); 264 });
270 265
271 document.addEventListener('DOMContentLoaded', serviceworker.initialize); 266 document.addEventListener('DOMContentLoaded', serviceworker.initialize);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698