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

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

Issue 2109813003: [DevTools] No NetworkManager and NetworkLog for v8only mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing code review comments Created 4 years, 5 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/Target.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/Target.js b/third_party/WebKit/Source/devtools/front_end/sdk/Target.js
index f79d7fb37c061e8f5b376b01133469b184d6918c..ebaf360642910fa249815ba62469fdc3f72b917c 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/Target.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/Target.js
@@ -34,7 +34,8 @@ WebInspector.Target = function(targetManager, name, type, connection, parentTarg
WebInspector.Target.Type = {
Page: 1,
DedicatedWorker: 2,
- ServiceWorker: 4
+ ServiceWorker: 4,
+ JSInspector: 8
}
WebInspector.Target._nextId = 1;
@@ -106,7 +107,7 @@ WebInspector.Target.prototype = {
*/
isWorker: function()
{
- return this.isDedicatedWorker() || this.isServiceWorker();
+ return this.isDedicatedWorker() || this.isServiceWorker() || this.isJSInspector();
},
/**
@@ -128,12 +129,28 @@ WebInspector.Target.prototype = {
/**
* @return {boolean}
*/
+ isJSInspector: function()
+ {
+ return this._type === WebInspector.Target.Type.JSInspector;
+ },
+
+ /**
+ * @return {boolean}
+ */
hasJSContext: function()
{
return !this.isServiceWorker();
},
/**
+ * @return {boolean}
+ */
+ supportsWorkers: function()
+ {
+ return this.isPage() || this.isServiceWorker();
+ },
+
+ /**
* @return {?WebInspector.Target}
*/
parentTarget: function()
@@ -150,9 +167,6 @@ WebInspector.Target.prototype = {
_dispose: function()
{
this._targetManager.dispatchEventToListeners(WebInspector.TargetManager.Events.TargetDisposed, this);
- this.networkManager.dispose();
- this.cpuProfilerModel.dispose();
- WebInspector.ServiceWorkerCacheModel.fromTarget(this).dispose();
if (this.workerManager)
this.workerManager.dispose();
},
@@ -218,6 +232,7 @@ WebInspector.SDKModel = function(modelClass, target)
{
WebInspector.SDKObject.call(this, target);
target._modelByConstructor.set(modelClass, this);
+ WebInspector.targetManager.addEventListener(WebInspector.TargetManager.Events.TargetDisposed, this._targetDisposed, this);
}
WebInspector.SDKModel.prototype = {
@@ -237,5 +252,19 @@ WebInspector.SDKModel.prototype = {
return Promise.resolve();
},
+ dispose: function() { },
+
+ /**
+ * @param {!WebInspector.Event} event
+ */
+ _targetDisposed: function(event)
+ {
+ var target = /** @type {!WebInspector.Target} */ (event.data);
+ if (target !== this._target)
+ return;
+ this.dispose();
+ WebInspector.targetManager.removeEventListener(WebInspector.TargetManager.Events.TargetDisposed, this._targetDisposed, this);
+ },
+
__proto__: WebInspector.SDKObject.prototype
}

Powered by Google App Engine
This is Rietveld 408576698