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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sdk/NetworkRequest.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/sdk/NetworkRequest.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/NetworkRequest.js b/third_party/WebKit/Source/devtools/front_end/sdk/NetworkRequest.js
index 4750c082d79e8b4143a10d2c75621c5c25344752..4ce82347fb85d643e3a29f6477fe079a77a154aa 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/NetworkRequest.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/NetworkRequest.js
@@ -34,6 +34,7 @@
SDK.NetworkRequest = class extends Common.Object {
/**
* @param {!SDK.NetworkManager} networkManager
+ * @param {!Protocol.NetworkAgent} networkAgent
caseq 2017/04/29 02:12:53 Do we really need both manager and agent here? It
* @param {!Protocol.Network.RequestId} requestId
* @param {string} url
* @param {string} documentURL
@@ -41,10 +42,11 @@ SDK.NetworkRequest = class extends Common.Object {
* @param {!Protocol.Network.LoaderId} loaderId
* @param {?Protocol.Network.Initiator} initiator
*/
- constructor(networkManager, requestId, url, documentURL, frameId, loaderId, initiator) {
+ constructor(networkManager, networkAgent, requestId, url, documentURL, frameId, loaderId, initiator) {
super();
this._networkManager = networkManager;
+ this._networkAgent = networkAgent;
this._requestId = requestId;
this.setUrl(url);
this._documentURL = documentURL;
@@ -1034,7 +1036,7 @@ SDK.NetworkRequest = class extends Common.Object {
this._pendingContentCallbacks.length = 0;
delete this._contentRequested;
}
- this._networkManager.target().networkAgent().getResponseBody(this._requestId, onResourceContent.bind(this));
+ this._networkAgent.getResponseBody(this._requestId, onResourceContent.bind(this));
}
/**
@@ -1109,7 +1111,7 @@ SDK.NetworkRequest = class extends Common.Object {
}
replayXHR() {
- this._networkManager.target().networkAgent().replayXHR(this._requestId);
+ this._networkAgent.replayXHR(this._requestId);
}
/**

Powered by Google App Engine
This is Rietveld 408576698