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

Unified Diff: third_party/WebKit/Source/devtools/front_end/main/Main.js

Issue 2149833002: DevTools: Add sendOverProtocol() method for protocol debugging (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sendOverProtocol has promise API. Created 4 years, 5 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/main/Main.js
diff --git a/third_party/WebKit/Source/devtools/front_end/main/Main.js b/third_party/WebKit/Source/devtools/front_end/main/Main.js
index 8c8748bfb858a998fbaaa0c822000a21fe0a9695..eaa5c05ceae1b06b0456bc8e3410d89e168613d5 100644
--- a/third_party/WebKit/Source/devtools/front_end/main/Main.js
+++ b/third_party/WebKit/Source/devtools/front_end/main/Main.js
@@ -973,6 +973,23 @@ WebInspector.Main.InspectedNodeRevealer.prototype = {
}
}
+/**
+ * @param {string} method
+ * @param {?Object} params
+ * @return {!Promise}
+ */
+WebInspector.sendOverProtocol = function(method, params)
+{
+ var connection = WebInspector.targetManager.mainTarget().connection();
+ return new Promise((resolve, reject) => {
+ connection.sendRawMessageForTesting(method, params, (err, result) => {
+ if (err)
+ return reject(err);
+ return resolve(result);
+ });
+ });
+}
+
/**
* @constructor
* @extends {WebInspector.VBox}

Powered by Google App Engine
This is Rietveld 408576698