LayoutTest inspector/worker/debugger-pause.html sometimes times out
[WebKit-https.git] / Source / WebInspectorUI / UserInterface / Protocol / Target.js
index 2d4cf13..92d13fc 100644 (file)
@@ -56,9 +56,6 @@ WI.Target = class Target extends WI.Object
     get name() { return this._name; }
     set name(name) { this._name = name; }
 
-    get mainResource() { return this._mainResource; }
-    set mainResource(resource) { this._mainResource = resource; }
-
     get type() { return this._type; }
     get connection() { return this._connection; }
     get executionContext() { return this._executionContext; }
@@ -68,6 +65,20 @@ WI.Target = class Target extends WI.Object
 
     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)
     {
         this._resourceCollection.add(resource);
@@ -98,6 +109,7 @@ WI.Target.Type = {
 };
 
 WI.Target.Event = {
+    MainResourceAdded: "target-main-resource-added",
     ResourceAdded: "target-resource-added",
     ScriptAdded: "target-script-added",
 };