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

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

Issue 2956423003: [DevTools] Provide Target.targetInfoChanged notification (Closed)
Patch Set: Created 3 years, 6 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/core/inspector/browser_protocol.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/TargetManager.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/TargetManager.js b/third_party/WebKit/Source/devtools/front_end/sdk/TargetManager.js
index 2275b7510298cf99521c8868deb7d08444726a3f..f8c7e9e1d88e554c078c55edeb2efbfc0d0d1519 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/TargetManager.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/TargetManager.js
@@ -490,9 +490,29 @@ SDK.ChildTargetManager = class {
if (targetInfo.type !== 'node')
return;
if (Runtime.queryParam('nodeFrontend')) {
- this._targetAgent.attachToTarget(targetInfo.targetId);
- } else {
- this._targetManager._nodeTargetIds.add(targetInfo.targetId);
+ if (!targetInfo.attached)
caseq 2017/06/29 20:36:17 This is still prone to races. So perhaps try attac
dgozman 2017/06/29 21:31:23 Acknowledged.
+ this._targetAgent.attachToTarget(targetInfo.targetId);
+ return;
+ }
+ if (targetInfo.attached)
+ return;
+ this._targetManager._nodeTargetIds.add(targetInfo.targetId);
+ this._targetManager.dispatchEventToListeners(SDK.TargetManager.Events.AvailableNodeTargetsChanged);
+ }
+
+ /**
+ * @override
+ * @param {!Protocol.Target.TargetInfo} targetInfo
+ */
+ targetInfoChanged(targetInfo) {
+ if (targetInfo.type !== 'node' || Runtime.queryParam('nodeFrontend'))
+ return;
+ var availableIds = this._targetManager._nodeTargetIds;
+ if (!availableIds.has(targetInfo.targetId) && !targetInfo.attached) {
+ availableIds.add(targetInfo.targetId);
+ this._targetManager.dispatchEventToListeners(SDK.TargetManager.Events.AvailableNodeTargetsChanged);
+ } else if (availableIds.has(targetInfo.targetId) && targetInfo.attached) {
+ availableIds.delete(targetInfo.targetId);
this._targetManager.dispatchEventToListeners(SDK.TargetManager.Events.AvailableNodeTargetsChanged);
}
}
« no previous file with comments | « third_party/WebKit/Source/core/inspector/browser_protocol.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698