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

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

Issue 2421913003: DevTools: allow reattaching main target live. (Closed)
Patch Set: link fixed Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
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..29e0293e20a5ede5d560b2dd617446c8fe806662 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,16 +29,28 @@ Audits2Service.prototype = {
*/
stop: function()
{
- console.error("WORKER STOP");
+ console.error("************ WORKER STOP *****************");
+ return Promise.resolve();
+ },
+
+ /**
+ * @param {!Object=} params
+ * @return {!Promise}
+ */
+ dispatchProtocolMessage: function(params)
+ {
+ console.error("message: " + JSON.stringify(params));
return Promise.resolve();
},
/**
* @override
+ * @return {!Promise}
*/
dispose: function()
{
- console.error("WORKER DISPOSE");
+ console.error("************ WORKER DISPOSE *****************");
+ return Promise.resolve();
}
}

Powered by Google App Engine
This is Rietveld 408576698