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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/worker_service/ServiceDispatcher.js

Issue 2901133002: DevTools: Disable Audits2 buttons when service worker is active (Closed)
Patch Set: add stack logging Created 3 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
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/audits2/audits2Dialog.css ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 * @interface 5 * @interface
6 */ 6 */
7 function Service() { 7 function Service() {
8 } 8 }
9 9
10 Service.prototype = { 10 Service.prototype = {
(...skipping 28 matching lines...) Expand all
39 */ 39 */
40 _dispatchMessageWrapped(data) { 40 _dispatchMessageWrapped(data) {
41 try { 41 try {
42 var message = JSON.parse(data); 42 var message = JSON.parse(data);
43 if (!(message instanceof Object)) { 43 if (!(message instanceof Object)) {
44 this._sendErrorResponse(message['id'], 'Malformed message'); 44 this._sendErrorResponse(message['id'], 'Malformed message');
45 return; 45 return;
46 } 46 }
47 this._dispatchMessage(message); 47 this._dispatchMessage(message);
48 } catch (e) { 48 } catch (e) {
49 this._sendErrorResponse(message['id'], e.toString()); 49 this._sendErrorResponse(message['id'], e.toString() + ' ' + e.stack);
50 } 50 }
51 } 51 }
52 52
53 /** 53 /**
54 * @param {!Object} message 54 * @param {!Object} message
55 */ 55 */
56 _dispatchMessage(message) { 56 _dispatchMessage(message) {
57 var domainAndMethod = message['method'].split('.'); 57 var domainAndMethod = message['method'].split('.');
58 var serviceName = domainAndMethod[0]; 58 var serviceName = domainAndMethod[0];
59 var method = domainAndMethod[1]; 59 var method = domainAndMethod[1];
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 function onNewPort(port) { 191 function onNewPort(port) {
192 var dispatcher = new ServiceDispatcher(new WorkerServicePort(port)); 192 var dispatcher = new ServiceDispatcher(new WorkerServicePort(port));
193 dispatchers.push(dispatcher); 193 dispatchers.push(dispatcher);
194 } 194 }
195 Runtime.setSharedWorkerNewPortCallback(onNewPort); 195 Runtime.setSharedWorkerNewPortCallback(onNewPort);
196 } else { 196 } else {
197 var worker = /** @type {!Object} */ (self); 197 var worker = /** @type {!Object} */ (self);
198 var servicePort = new WorkerServicePort(/** @type {!Worker} */ (worker)); 198 var servicePort = new WorkerServicePort(/** @type {!Worker} */ (worker));
199 dispatchers.push(new ServiceDispatcher(servicePort)); 199 dispatchers.push(new ServiceDispatcher(servicePort));
200 } 200 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/audits2/audits2Dialog.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698