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

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: 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..6a39e317a0f0c4e013e77ed929f04c07494d2ef9 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
+ */
+ _inspect: 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
+ */
+ inspect: function(payload, hints)
+ {
+ this._runtimeModel._inspect(payload, hints);
+ }
}
/**

Powered by Google App Engine
This is Rietveld 408576698