Title: [209686] trunk/Source/WebInspectorUI
Revision
209686
Author
[email protected]
Date
2016-12-11 15:37:11 -0800 (Sun, 11 Dec 2016)

Log Message

Web Inspector: Move MainTarget and WorkerTarget to their own files
https://bugs.webkit.org/show_bug.cgi?id=165701

Patch by Joseph Pecoraro <[email protected]> on 2016-12-11
Reviewed by Brian Burg.

* UserInterface/Controllers/DebuggerManager.js:
(WebInspector.DebuggerManager.prototype.scriptDidParse):
* UserInterface/Main.html:
* UserInterface/Protocol/MainTarget.js: Added.
(WebInspector.MainTarget):
(WebInspector.MainTarget.prototype.get displayName):
(WebInspector.MainTarget.prototype.get mainResource):
* UserInterface/Protocol/Target.js:
(WebInspector.Target):
(WebInspector.MainTarget): Deleted.
(WebInspector.MainTarget.prototype.get displayName): Deleted.
(WebInspector.MainTarget.prototype.get mainResource): Deleted.
(WebInspector.MainTarget.prototype.initialize): Deleted.
(WebInspector.WorkerTarget): Deleted.
(WebInspector.WorkerTarget.prototype.get displayName): Deleted.
(WebInspector.WorkerTarget.prototype.initialize): Deleted.
* UserInterface/Protocol/WorkerTarget.js: Added.
(WebInspector.WorkerTarget):
(WebInspector.WorkerTarget.prototype.get displayName):
* UserInterface/Test.html:

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (209685 => 209686)


--- trunk/Source/WebInspectorUI/ChangeLog	2016-12-11 22:08:05 UTC (rev 209685)
+++ trunk/Source/WebInspectorUI/ChangeLog	2016-12-11 23:37:11 UTC (rev 209686)
@@ -1,3 +1,31 @@
+2016-12-11  Joseph Pecoraro  <[email protected]>
+
+        Web Inspector: Move MainTarget and WorkerTarget to their own files
+        https://bugs.webkit.org/show_bug.cgi?id=165701
+
+        Reviewed by Brian Burg.
+
+        * UserInterface/Controllers/DebuggerManager.js:
+        (WebInspector.DebuggerManager.prototype.scriptDidParse):
+        * UserInterface/Main.html:
+        * UserInterface/Protocol/MainTarget.js: Added.
+        (WebInspector.MainTarget):
+        (WebInspector.MainTarget.prototype.get displayName):
+        (WebInspector.MainTarget.prototype.get mainResource):
+        * UserInterface/Protocol/Target.js:
+        (WebInspector.Target):
+        (WebInspector.MainTarget): Deleted.
+        (WebInspector.MainTarget.prototype.get displayName): Deleted.
+        (WebInspector.MainTarget.prototype.get mainResource): Deleted.
+        (WebInspector.MainTarget.prototype.initialize): Deleted.
+        (WebInspector.WorkerTarget): Deleted.
+        (WebInspector.WorkerTarget.prototype.get displayName): Deleted.
+        (WebInspector.WorkerTarget.prototype.initialize): Deleted.
+        * UserInterface/Protocol/WorkerTarget.js: Added.
+        (WebInspector.WorkerTarget):
+        (WebInspector.WorkerTarget.prototype.get displayName):
+        * UserInterface/Test.html:
+
 2016-12-09  Joseph Pecoraro  <[email protected]>
 
         Web Inspector: Frontend should not be resetting TypeProfiler state when switching between ContentViews

Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js (209685 => 209686)


--- trunk/Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js	2016-12-11 22:08:05 UTC (rev 209685)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js	2016-12-11 23:37:11 UTC (rev 209686)
@@ -699,7 +699,7 @@
         if (target !== WebInspector.mainTarget && !target.mainResource) {
             // FIXME: <https://webkit.org/b/164427> Web Inspector: WorkerTarget's mainResource should be a Resource not a Script
             // We make the main resource of a WorkerTarget the Script instead of the Resource
-            // because the frontend may not be informed of the Resource. We should gaurantee
+            // because the frontend may not be informed of the Resource. We should guarantee
             // the frontend is informed of the Resource.
             if (script.url ="" target.name) {
                 target.mainResource = script;

Modified: trunk/Source/WebInspectorUI/UserInterface/Main.html (209685 => 209686)


--- trunk/Source/WebInspectorUI/UserInterface/Main.html	2016-12-11 22:08:05 UTC (rev 209685)
+++ trunk/Source/WebInspectorUI/UserInterface/Main.html	2016-12-11 23:37:11 UTC (rev 209686)
@@ -255,9 +255,18 @@
     <script src=""
     <script src=""
 
+    <script src=""
+    <script src=""
+    <script src=""
+    <script src=""
+    <script src=""
+    <script src=""
+
+    <script src=""
+    <script src=""
+
     <script src=""
     <script src=""
-    <script src=""
     <script src=""
     <script src=""
     <script src=""
@@ -264,19 +273,14 @@
     <script src=""
     <script src=""
     <script src=""
-    <script src=""
     <script src=""
     <script src=""
-    <script src=""
     <script src=""
-    <script src=""
     <script src=""
     <script src=""
-    <script src=""
     <script src=""
     <script src=""
     <script src=""
-    <script src=""
     <script src=""
     <script src=""
 

Added: trunk/Source/WebInspectorUI/UserInterface/Protocol/MainTarget.js (0 => 209686)


--- trunk/Source/WebInspectorUI/UserInterface/Protocol/MainTarget.js	                        (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Protocol/MainTarget.js	2016-12-11 23:37:11 UTC (rev 209686)
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+WebInspector.MainTarget = class MainTarget extends WebInspector.Target
+{
+    constructor(connection)
+    {
+        super("main", "", WebInspector.Target.Type.Main, InspectorBackend.mainConnection);
+
+        let displayName = WebInspector.debuggableType === WebInspector.DebuggableType.Web ? WebInspector.UIString("Main Frame") : this.displayName;
+        this._executionContext = new WebInspector.ExecutionContext(this, WebInspector.RuntimeManager.TopLevelContextExecutionIdentifier, displayName, true, null);
+    }
+
+    // Protected (Target)
+
+    get displayName()
+    {
+        switch (WebInspector.debuggableType) {
+        case WebInspector.DebuggableType.Web:
+            return WebInspector.UIString("Page");
+        case WebInspector.DebuggableType._javascript_:
+            return WebInspector.UIString("_javascript_ Context");
+        default:
+            console.error("Unexpected debuggable type: ", WebInspector.debuggableType);
+            return WebInspector.UIString("Main");
+        }
+    }
+
+    get mainResource()
+    {
+        let mainFrame = WebInspector.frameResourceManager.mainFrame;
+        return mainFrame ? mainFrame.mainResource : null;
+    }
+}

Modified: trunk/Source/WebInspectorUI/UserInterface/Protocol/Target.js (209685 => 209686)


--- trunk/Source/WebInspectorUI/UserInterface/Protocol/Target.js	2016-12-11 22:08:05 UTC (rev 209685)
+++ trunk/Source/WebInspectorUI/UserInterface/Protocol/Target.js	2016-12-11 23:37:11 UTC (rev 209686)
@@ -39,8 +39,6 @@
         this._extraScriptCollection = new WebInspector.Collection(WebInspector.Collection.TypeVerifier.Script);
 
         this._connection.target = this;
-
-        this.initialize();
     }
 
     // Agents
@@ -94,73 +92,3 @@
     ResourceAdded: "target-resource-added",
     ScriptAdded: "target-script-added",
 };
-
-WebInspector.MainTarget = class MainTarget extends WebInspector.Target
-{
-    constructor(connection)
-    {
-        super("main", "", WebInspector.Target.Type.Main, InspectorBackend.mainConnection);
-    }
-
-    // Protected (Target)
-
-    get displayName()
-    {
-        switch (WebInspector.debuggableType) {
-        case WebInspector.DebuggableType.Web:
-            return WebInspector.UIString("Page");
-        case WebInspector.DebuggableType._javascript_:
-            return WebInspector.UIString("_javascript_ Context");
-        default:
-            console.error("Unexpected debuggable type: ", WebInspector.debuggableType);
-            return WebInspector.UIString("Main");
-        }
-    }
-
-    get mainResource()
-    {
-        let mainFrame = WebInspector.frameResourceManager.mainFrame;
-        return mainFrame ? mainFrame.mainResource : null;
-    }
-
-    initialize()
-    {
-        let displayName = WebInspector.debuggableType === WebInspector.DebuggableType.Web ? WebInspector.UIString("Main Frame") : this.displayName;
-        this._executionContext = new WebInspector.ExecutionContext(this, WebInspector.RuntimeManager.TopLevelContextExecutionIdentifier, displayName, true, null);
-    }
-}
-
-WebInspector.WorkerTarget = class WorkerTarget extends WebInspector.Target
-{
-    constructor(workerId, name, connection)
-    {
-        super(workerId, name, WebInspector.Target.Type.Worker, connection);
-    }
-
-    // Protected (Target)
-
-    get displayName()
-    {
-        return WebInspector.displayNameForURL(this._name);
-    }
-
-    initialize()
-    {
-        WebInspector.frameResourceManager.adoptOrphanedResourcesForTarget(this);
-
-        if (this.RuntimeAgent) {
-            this._executionContext = new WebInspector.ExecutionContext(this, WebInspector.RuntimeManager.TopLevelContextExecutionIdentifier, this.displayName, false, null);
-            this.RuntimeAgent.enable();
-            if (WebInspector.showJavaScriptTypeInformationSetting && WebInspector.showJavaScriptTypeInformationSetting.value)
-                this.RuntimeAgent.enableTypeProfiler();
-            if (WebInspector.enableControlFlowProfilerSetting && WebInspector.enableControlFlowProfilerSetting.value)
-                this.RuntimeAgent.enableControlFlowProfiler();
-        }
-
-        if (this.DebuggerAgent)
-            WebInspector.debuggerManager.initializeTarget(this);
-
-        if (this.ConsoleAgent)
-            this.ConsoleAgent.enable();
-    }
-}

Added: trunk/Source/WebInspectorUI/UserInterface/Protocol/WorkerTarget.js (0 => 209686)


--- trunk/Source/WebInspectorUI/UserInterface/Protocol/WorkerTarget.js	                        (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Protocol/WorkerTarget.js	2016-12-11 23:37:11 UTC (rev 209686)
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+WebInspector.WorkerTarget = class WorkerTarget extends WebInspector.Target
+{
+    constructor(workerId, name, connection)
+    {
+        super(workerId, name, WebInspector.Target.Type.Worker, connection);
+
+        WebInspector.frameResourceManager.adoptOrphanedResourcesForTarget(this);
+
+        if (this.RuntimeAgent) {
+            this._executionContext = new WebInspector.ExecutionContext(this, WebInspector.RuntimeManager.TopLevelContextExecutionIdentifier, this.displayName, false, null);
+            this.RuntimeAgent.enable();
+            if (WebInspector.showJavaScriptTypeInformationSetting && WebInspector.showJavaScriptTypeInformationSetting.value)
+                this.RuntimeAgent.enableTypeProfiler();
+            if (WebInspector.enableControlFlowProfilerSetting && WebInspector.enableControlFlowProfilerSetting.value)
+                this.RuntimeAgent.enableControlFlowProfiler();
+        }
+
+        if (this.DebuggerAgent)
+            WebInspector.debuggerManager.initializeTarget(this);
+
+        if (this.ConsoleAgent)
+            this.ConsoleAgent.enable();
+    }
+
+    // Protected (Target)
+
+    get displayName()
+    {
+        return WebInspector.displayNameForURL(this._name);
+    }
+}

Modified: trunk/Source/WebInspectorUI/UserInterface/Test.html (209685 => 209686)


--- trunk/Source/WebInspectorUI/UserInterface/Test.html	2016-12-11 22:08:05 UTC (rev 209685)
+++ trunk/Source/WebInspectorUI/UserInterface/Test.html	2016-12-11 23:37:11 UTC (rev 209686)
@@ -66,6 +66,9 @@
     <script src=""
     <script src=""
 
+    <script src=""
+    <script src=""
+
     <script src=""
     <script src=""
     <script src=""
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to