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

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

Issue 288683002: Update chrome://serviceworker-internals when ServiceWorker is unregistered. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_context_core.h » ('j') | 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 update() { 8 function update() {
9 chrome.send('getAllRegistrations'); 9 chrome.send('getAllRegistrations');
10 } 10 }
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 message) { 126 message) {
127 outputLogMessage(partition_id, 127 outputLogMessage(partition_id,
128 version_id, 128 version_id,
129 'Console: ' + JSON.stringify(message) + '\n'); 129 'Console: ' + JSON.stringify(message) + '\n');
130 } 130 }
131 131
132 function onVersionStateChanged(partition_id, version_id) { 132 function onVersionStateChanged(partition_id, version_id) {
133 update(); 133 update();
134 } 134 }
135 135
136 function onRegistrationStored(scope) {
137 update();
138 }
139
140 function onRegistrationDeleted(scope) {
141 update();
142 }
143
136 function outputLogMessage(partition_id, version_id, message) { 144 function outputLogMessage(partition_id, version_id, message) {
137 if (!(partition_id in allLogMessages)) { 145 if (!(partition_id in allLogMessages)) {
138 allLogMessages[partition_id] = {}; 146 allLogMessages[partition_id] = {};
139 } 147 }
140 var logMessages = allLogMessages[partition_id]; 148 var logMessages = allLogMessages[partition_id];
141 if (version_id in logMessages) { 149 if (version_id in logMessages) {
142 logMessages[version_id] += message; 150 logMessages[version_id] += message;
143 } else { 151 } else {
144 logMessages[version_id] = message; 152 logMessages[version_id] = message;
145 } 153 }
(...skipping 11 matching lines...) Expand all
157 165
158 return { 166 return {
159 update: update, 167 update: update,
160 onOperationComplete: onOperationComplete, 168 onOperationComplete: onOperationComplete,
161 onPartitionData: onPartitionData, 169 onPartitionData: onPartitionData,
162 onWorkerStarted: onWorkerStarted, 170 onWorkerStarted: onWorkerStarted,
163 onWorkerStopped: onWorkerStopped, 171 onWorkerStopped: onWorkerStopped,
164 onErrorReported: onErrorReported, 172 onErrorReported: onErrorReported,
165 onConsoleMessageReported: onConsoleMessageReported, 173 onConsoleMessageReported: onConsoleMessageReported,
166 onVersionStateChanged: onVersionStateChanged, 174 onVersionStateChanged: onVersionStateChanged,
175 onRegistrationStored: onRegistrationStored,
176 onRegistrationDeleted: onRegistrationDeleted,
167 }; 177 };
168 }); 178 });
169 179
170 document.addEventListener('DOMContentLoaded', serviceworker.update); 180 document.addEventListener('DOMContentLoaded', serviceworker.update);
OLDNEW
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_context_core.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698