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

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

Issue 2437633003: [DevTools] Switch remote locations to Target domain. (Closed)
Patch Set: removed dispose 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
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/main/module.json ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/sdk/SubTargetsManager.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/SubTargetsManager.js b/third_party/WebKit/Source/devtools/front_end/sdk/SubTargetsManager.js
index 37ac6a22918e847c95b1f68423f901bcb2a949ae..7589cdcaf44295bf4a550cc6454ff4da5288c882 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/SubTargetsManager.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/SubTargetsManager.js
@@ -21,6 +21,12 @@ WebInspector.SubTargetsManager = function(target)
this._agent.setAutoAttach(true /* autoAttach */, true /* waitForDebuggerOnStart */);
this._agent.setAttachToFrames(Runtime.experiments.isEnabled("autoAttachToCrossProcessSubframes"));
+
+ if (Runtime.experiments.isEnabled("nodeDebugging") && !target.parentTarget()) {
+ var defaultLocations = [{host: "localhost", port: 9229}];
+ this._agent.setRemoteLocations(defaultLocations);
+ this._agent.setDiscoverTargets(true);
+ }
}
/** @enum {symbol} */
@@ -132,6 +138,8 @@ WebInspector.SubTargetsManager.prototype = {
return WebInspector.Target.Capability.Browser | WebInspector.Target.Capability.DOM |
WebInspector.Target.Capability.JS | WebInspector.Target.Capability.Log |
WebInspector.Target.Capability.Network | WebInspector.Target.Capability.Worker;
+ if (type === "node")
+ return WebInspector.Target.Capability.JS;
return 0;
},
@@ -145,7 +153,9 @@ WebInspector.SubTargetsManager.prototype = {
this._connections.set(targetInfo.id, connection);
var targetName = "";
- if (targetInfo.type !== "iframe") {
+ if (targetInfo.type === "node") {
+ targetName = targetInfo.title;
+ } else if (targetInfo.type !== "iframe") {
var parsedURL = targetInfo.url.asParsedURL();
targetName = parsedURL ? parsedURL.lastPathComponentWithFragment() : "#" + (++this._lastAnonymousTargetId);
}
@@ -187,6 +197,24 @@ WebInspector.SubTargetsManager.prototype = {
connection.dispatch(message);
},
+ /**
+ * @param {!WebInspector.TargetInfo} targetInfo
+ */
+ _targetCreated: function(targetInfo)
+ {
+ if (targetInfo.type !== "node")
+ return;
+ this._agent.attachToTarget(targetInfo.id);
+ },
+
+ /**
+ * @param {string} targetId
+ */
+ _targetDestroyed: function(targetId)
+ {
+ // All the work is done in _detachedFromTarget.
+ },
+
__proto__: WebInspector.SDKModel.prototype
}
@@ -207,7 +235,7 @@ WebInspector.SubTargetsDispatcher.prototype = {
*/
targetCreated: function(targetInfo)
{
- // Ignored.
+ this._manager._targetCreated(new WebInspector.TargetInfo(targetInfo));
},
/**
@@ -216,7 +244,7 @@ WebInspector.SubTargetsDispatcher.prototype = {
*/
targetDestroyed: function(targetId)
{
- // Ignored.
+ this._manager._targetDestroyed(targetId);
},
/**
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/main/module.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698