LayoutTest inspector/worker/debugger-pause.html sometimes times out
[WebKit-https.git] / Source / WebInspectorUI / UserInterface / Protocol / Target.js
index 5c544e1..92d13fc 100644 (file)
@@ -36,7 +36,7 @@ WI.Target = class Target extends WI.Object
         this._executionContext = null;
         this._mainResource = null;
         this._resourceCollection = new WI.ResourceCollection;
-        this._extraScriptCollection = new WI.Collection(WI.Collection.TypeVerifier.Script);
+        this._extraScriptCollection = new WI.ScriptCollection;
 
         this._connection.target = this;
     }
@@ -51,7 +51,11 @@ WI.Target = class Target extends WI.Object
     // Public
 
     get identifier() { return this._identifier; }
+    set identifier(identifier) { this._identifier = identifier; }
+
     get name() { return this._name; }
+    set name(name) { this._name = name; }
+
     get type() { return this._type; }
     get connection() { return this._connection; }
     get executionContext() { return this._executionContext; }
@@ -59,8 +63,21 @@ WI.Target = class Target extends WI.Object
     get resourceCollection() { return this._resourceCollection; }
     get extraScriptCollection() { return this._extraScriptCollection; }
 
-    get mainResource() { return this._mainResource; }
-    set mainResource(resource) { this._mainResource = resource; }
+    get displayName() { return this._name; }
+
+    get mainResource()
+    {
+        return this._mainResource;
+    }
+
+    set mainResource(resource)
+    {
+        console.assert(!this._mainResource);
+
+        this._mainResource = resource;
+
+        this.dispatchEventToListeners(WI.Target.Event.MainResourceAdded, {resource});
+    }
 
     addResource(resource)
     {
@@ -85,11 +102,14 @@ WI.Target = class Target extends WI.Object
 };
 
 WI.Target.Type = {
-    Main: Symbol("main"),
+    Page: Symbol("page"),
+    JSContext: Symbol("jscontext"),
+    ServiceWorker: Symbol("service-worker"),
     Worker: Symbol("worker"),
 };
 
 WI.Target.Event = {
+    MainResourceAdded: "target-main-resource-added",
     ResourceAdded: "target-resource-added",
     ScriptAdded: "target-script-added",
 };