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

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

Issue 2109813003: [DevTools] No NetworkManager and NetworkLog for v8only mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Pass NetworkManager as a ctor parameter, to ensure proper initialization order. Created 4 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
Index: third_party/WebKit/Source/devtools/front_end/sdk/NetworkManager.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/NetworkManager.js b/third_party/WebKit/Source/devtools/front_end/sdk/NetworkManager.js
index ab95c758b722495ebcd2024430d717ca8197d62f..4d361237f77f50e1e21fbd638af5044141296ffc 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/NetworkManager.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/NetworkManager.js
@@ -60,6 +60,11 @@ WebInspector.NetworkManager = function(target)
this._bypassServiceWorkerSetting.addChangeListener(this._bypassServiceWorkerChanged, this);
WebInspector.moduleSetting("cacheDisabled").addChangeListener(this._cacheDisabledSettingChanged, this);
+
+ console.assert(!target[WebInspector.NetworkManager._symbol]);
+ target[WebInspector.NetworkManager._symbol] = this;
+ console.assert(this.dispose);
dgozman 2016/06/29 18:37:58 Why this check? We have dispose declared in this f
eostroukhov-old 2016/06/29 22:54:20 Oops :) Debugging artifact.
+ target.disposables.push(this);
}
WebInspector.NetworkManager.EventTypes = {
@@ -81,6 +86,17 @@ WebInspector.NetworkManager._MIMETypes = {
"text/vtt": {"texttrack": true},
}
+WebInspector.NetworkManager._symbol = Symbol("NetworkManager");
+
+/**
+ * @param {!WebInspector.Target} target
+ * @return {?WebInspector.NetworkManager}
+ */
+WebInspector.NetworkManager.fromTarget = function(target) {
dgozman 2016/06/29 18:37:58 style: { on next line Doesn't eslint in presubmit
eostroukhov-old 2016/06/29 22:54:20 Done. I have not seen any linter warnings...
+ console.assert(target);
+ return target[WebInspector.NetworkManager._symbol] || null;
+}
+
/** @typedef {{download: number, upload: number, latency: number, title: string}} */
WebInspector.NetworkManager.Conditions;
/** @type {!WebInspector.NetworkManager.Conditions} */

Powered by Google App Engine
This is Rietveld 408576698