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

Unified Diff: third_party/WebKit/Source/devtools/front_end/resources/ServiceWorkersView.js

Issue 2851913002: [DevTools] Do not expose agents on Target
Patch Set: storage and tests.js Created 3 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/resources/ServiceWorkersView.js
diff --git a/third_party/WebKit/Source/devtools/front_end/resources/ServiceWorkersView.js b/third_party/WebKit/Source/devtools/front_end/resources/ServiceWorkersView.js
index 725c84c3786da45fa9d9536fd0912e03e6a12a53..9c47dff40ae8738ddd596d6d649354a339a20364 100644
--- a/third_party/WebKit/Source/devtools/front_end/resources/ServiceWorkersView.js
+++ b/third_party/WebKit/Source/devtools/front_end/resources/ServiceWorkersView.js
@@ -287,7 +287,7 @@ Resources.ServiceWorkersView.Section = class {
this._updateClientInfo(
clientLabelText, /** @type {!Protocol.Target.TargetInfo} */ (this._clientInfoCache.get(client)));
}
- this._manager.target().targetAgent().getTargetInfo(client, this._onClientInfo.bind(this, clientLabelText));
+ this._manager.controlledClientInfo(client).then(this._onClientInfo.bind(this, clientLabelText));
}
}
@@ -382,11 +382,10 @@ Resources.ServiceWorkersView.Section = class {
/**
* @param {!Element} element
- * @param {?Protocol.Error} error
* @param {?Protocol.Target.TargetInfo} targetInfo
*/
- _onClientInfo(element, error, targetInfo) {
- if (error || !targetInfo)
+ _onClientInfo(element, targetInfo) {
+ if (!targetInfo)
return;
this._clientInfoCache.set(targetInfo.targetId, targetInfo);
this._updateClientInfo(element, targetInfo);
@@ -405,14 +404,7 @@ Resources.ServiceWorkersView.Section = class {
element.createTextChild(targetInfo.url);
var focusLabel = element.createChild('label', 'link');
focusLabel.createTextChild('focus');
- focusLabel.addEventListener('click', this._activateTarget.bind(this, targetInfo.targetId), true);
- }
-
- /**
- * @param {string} targetId
- */
- _activateTarget(targetId) {
- this._manager.target().targetAgent().activateTarget(targetId);
+ focusLabel.addEventListener('click', () => this._manager.activateControlledClient(targetInfo.targetId), true);
}
_startButtonClicked() {

Powered by Google App Engine
This is Rietveld 408576698