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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/audits2_worker/Audits2Service.js

Issue 2441933002: [DevTools] Refactor connection-related classes. (Closed)
Patch Set: test fixes Created 4 years, 1 month 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 (c) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 /** 5 /**
6 * @constructor 6 * @constructor
7 * @implements {Service} 7 * @implements {Service}
8 */ 8 */
9 function Audits2Service(notify) 9 function Audits2Service(notify)
10 { 10 {
(...skipping 16 matching lines...) Expand all
27 /** 27 /**
28 * @return {!Promise} 28 * @return {!Promise}
29 */ 29 */
30 stop: function() 30 stop: function()
31 { 31 {
32 console.error("************ WORKER STOP *****************"); 32 console.error("************ WORKER STOP *****************");
33 return Promise.resolve(); 33 return Promise.resolve();
34 }, 34 },
35 35
36 /** 36 /**
37 * @param {!Object=} params 37 * @param {{message: !Object|string}} params
pfeldman 2016/10/21 21:04:34 design: we should not use either or typing.
38 * @return {!Promise} 38 * @return {!Promise}
39 */ 39 */
40 dispatchProtocolMessage: function(params) 40 dispatchProtocolMessage: function(params)
41 { 41 {
42 console.error("message: " + JSON.stringify(params)); 42 var message = params.message;
43 if (typeof message !== "string")
44 message = JSON.stringify(message);
45 console.error("message: " + message.substring(0, 100));
43 return Promise.resolve(); 46 return Promise.resolve();
44 }, 47 },
45 48
46 /** 49 /**
47 * @override 50 * @override
48 * @return {!Promise} 51 * @return {!Promise}
49 */ 52 */
50 dispose: function() 53 dispose: function()
51 { 54 {
52 console.error("************ WORKER DISPOSE *****************"); 55 console.error("************ WORKER DISPOSE *****************");
53 return Promise.resolve(); 56 return Promise.resolve();
54 } 57 }
55 } 58 }
56 59
57 initializeWorkerService("Audits2Service", Audits2Service); 60 initializeWorkerService("Audits2Service", Audits2Service);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698