Chromium Code Reviews| Index: third_party/WebKit/Source/devtools/front_end/audits2_worker/Audits2Service.js |
| diff --git a/third_party/WebKit/Source/devtools/front_end/audits2_worker/Audits2Service.js b/third_party/WebKit/Source/devtools/front_end/audits2_worker/Audits2Service.js |
| index 957d7a1b7b884320606fb0e746c270cab84c8ec9..c415c46203d91812a065e9da3f3a4e3fb7a45414 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/audits2_worker/Audits2Service.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/audits2_worker/Audits2Service.js |
| @@ -6,8 +6,9 @@ |
| * @constructor |
| * @implements {Service} |
| */ |
| -function Audits2Service() |
| +function Audits2Service(notify) |
| { |
| + this._notify = notify; |
| } |
| Audits2Service.prototype = { |
| @@ -16,7 +17,10 @@ Audits2Service.prototype = { |
| */ |
| start: function() |
| { |
| - console.error("WORKER START"); |
| + console.error("************ WORKER START *****************"); |
| + this._notify("sendProtocolMessage", {message: JSON.stringify({id: 1, method: "Page.enable"})}); |
| + this._notify("sendProtocolMessage", {message: JSON.stringify({id: 2, method: "Runtime.enable"})}); |
| + this._notify("sendProtocolMessage", {message: JSON.stringify({id: 3, method: "Page.reload"})}); |
| return Promise.resolve(); |
| }, |
| @@ -25,7 +29,18 @@ Audits2Service.prototype = { |
| */ |
| stop: function() |
| { |
| - console.error("WORKER STOP"); |
| + console.error("************ WORKER STOP *****************"); |
| + this._notify("sendProtocolMessage", {message: JSON.stringify({id: 5, method: "Page.disable"})}); |
| + this._notify("sendProtocolMessage", {message: JSON.stringify({id: 6, method: "Runtime.disable"})}); |
| + return Promise.resolve(); |
| + }, |
| + |
| + /** |
| + * @param {!Object=} params |
|
dgozman
2016/10/17 17:21:16
@return
|
| + */ |
| + dispatchProtocolMessage: function(params) |
| + { |
| + console.error("message: " + JSON.stringify(params)); |
| return Promise.resolve(); |
| }, |
| @@ -34,7 +49,8 @@ Audits2Service.prototype = { |
| */ |
| dispose: function() |
| { |
| - console.error("WORKER DISPOSE"); |
| + console.error("************ WORKER DISPOSE *****************"); |
| + return Promise.resolve(); |
| } |
| } |