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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js

Issue 1866213002: [DevTools] Move inspect from Inspector to Runtime. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@inspector-connection
Patch Set: inspectRequested Created 4 years, 8 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/sdk/RuntimeModel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js
index 93efddd46adb4ad6ec3666f3924c59884793568a..5d3a91ffa1f4e8b5725254d33ae5c9780b19bc2a 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js
@@ -218,6 +218,40 @@ WebInspector.RuntimeModel.prototype = {
}
},
+ /**
+ * @param {!RuntimeAgent.RemoteObject} payload
+ * @param {!Object=} hints
+ */
+ _inspectRequested: function(payload, hints)
+ {
+ var object = this.createRemoteObject(payload);
+
+ if (object.isNode()) {
+ WebInspector.Revealer.revealPromise(object).then(object.release.bind(object));
+ return;
+ }
+
+ if (object.type === "function") {
+ WebInspector.RemoteFunction.objectAsFunction(object).targetFunctionDetails().then(didGetDetails);
+ return;
+ }
+
+ /**
+ * @param {?WebInspector.DebuggerModel.FunctionDetails} response
+ */
+ function didGetDetails(response)
+ {
+ object.release();
+ if (!response || !response.location)
+ return;
+ WebInspector.Revealer.reveal(response.location);
+ }
+
+ if (hints.copyToClipboard)
+ InspectorFrontendHost.copyText(object.value);
+ object.release();
+ },
+
__proto__: WebInspector.SDKModel.prototype
}
@@ -256,8 +290,17 @@ WebInspector.RuntimeDispatcher.prototype = {
executionContextsCleared: function()
{
this._runtimeModel._executionContextsCleared();
- }
+ },
+ /**
+ * @override
+ * @param {!RuntimeAgent.RemoteObject} payload
+ * @param {!Object=} hints
+ */
+ inspectRequested: function(payload, hints)
+ {
+ this._runtimeModel._inspectRequested(payload, hints);
+ }
}
/**
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/main/Main.js ('k') | third_party/WebKit/Source/devtools/protocol.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698