Web Inspector: Consider Automation script names as internal and hide them
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 Mar 2016 21:44:19 +0000 (21:44 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 Mar 2016 21:44:19 +0000 (21:44 +0000)
https://bugs.webkit.org/show_bug.cgi?id=155753
rdar://problem/25293310

Reviewed by Joseph Pecoraro.

* UserInterface/Base/Utilities.js:
(isWebKitInternalScript): Renamed from isWebInspectorDebugScript.
Check for "__Web" prefix and "__" suffix.

* UserInterface/Controllers/DebuggerManager.js:
(WebInspector.DebuggerManager):
(WebInspector.DebuggerManager.prototype.get knownNonResourceScripts):
(WebInspector.DebuggerManager.prototype.reset):
(WebInspector.DebuggerManager.prototype.debuggerDidPause):
(WebInspector.DebuggerManager.prototype.scriptDidParse):
(WebInspector.DebuggerManager.prototype._debugUIEnabledDidChange):
Renamed _inspectorDebugScripts to _internalWebKitScripts. And renamed
isWebInspectorDebugScript to isWebKitInternalScript.

* UserInterface/Protocol/RemoteObject.js:
(WebInspector.RemoteObject.prototype.findFunctionSourceCodeLocation):
Renamed isWebInspectorDebugScript to isWebKitInternalScript.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198555 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Base/Utilities.js
Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js
Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js

index 126454f..9797581 100644 (file)
@@ -1,3 +1,30 @@
+2016-03-22  Timothy Hatcher  <timothy@apple.com>
+
+        Web Inspector: Consider Automation script names as internal and hide them
+
+        https://bugs.webkit.org/show_bug.cgi?id=155753
+        rdar://problem/25293310
+
+        Reviewed by Joseph Pecoraro.
+
+        * UserInterface/Base/Utilities.js:
+        (isWebKitInternalScript): Renamed from isWebInspectorDebugScript.
+        Check for "__Web" prefix and "__" suffix.
+
+        * UserInterface/Controllers/DebuggerManager.js:
+        (WebInspector.DebuggerManager):
+        (WebInspector.DebuggerManager.prototype.get knownNonResourceScripts):
+        (WebInspector.DebuggerManager.prototype.reset):
+        (WebInspector.DebuggerManager.prototype.debuggerDidPause):
+        (WebInspector.DebuggerManager.prototype.scriptDidParse):
+        (WebInspector.DebuggerManager.prototype._debugUIEnabledDidChange):
+        Renamed _inspectorDebugScripts to _internalWebKitScripts. And renamed
+        isWebInspectorDebugScript to isWebKitInternalScript.
+
+        * UserInterface/Protocol/RemoteObject.js:
+        (WebInspector.RemoteObject.prototype.findFunctionSourceCodeLocation):
+        Renamed isWebInspectorDebugScript to isWebKitInternalScript.
+
 2016-03-22  Joseph Pecoraro  <pecoraro@apple.com>
 
         Web Inspector: REGRESSION: Shift + Click on record button should create a new recording
index 20bdbbd..3356038 100644 (file)
@@ -1186,9 +1186,9 @@ function isWebInspectorInternalScript(url)
     return url === "__WebInspectorInternal__";
 }
 
-function isWebInspectorDebugScript(url)
+function isWebKitInternalScript(url)
 {
-    return url && url.startsWith("__WebInspector");
+    return url && url.startsWith("__Web") && url.endsWith("__");
 }
 
 function isFunctionStringNativeCode(str)
index 34444ff..dcf068c 100644 (file)
@@ -64,7 +64,7 @@ WebInspector.DebuggerManager = class DebuggerManager extends WebInspector.Object
         this._pauseReason = null;
         this._pauseData = null;
 
-        this._inspectorDebugScripts = [];
+        this._internalWebKitScripts = [];
         this._scriptIdMap = new Map;
         this._scriptURLMap = new Map;
 
@@ -327,7 +327,7 @@ WebInspector.DebuggerManager = class DebuggerManager extends WebInspector.Object
         for (let script of this._scriptIdMap.values()) {
             if (script.resource)
                 continue;
-            if (!WebInspector.isDebugUIEnabled() && isWebInspectorDebugScript(script.url))
+            if (!WebInspector.isDebugUIEnabled() && isWebKitInternalScript(script.url))
                 continue;
             knownScripts.push(script);
         }
@@ -447,7 +447,7 @@ WebInspector.DebuggerManager = class DebuggerManager extends WebInspector.Object
         this._pauseReason = null;
         this._pauseData = null;
 
-        this._inspectorDebugScripts = [];
+        this._internalWebKitScripts = [];
         this._scriptIdMap.clear();
         this._scriptURLMap.clear();
 
@@ -497,7 +497,7 @@ WebInspector.DebuggerManager = class DebuggerManager extends WebInspector.Object
                 continue;
 
             // Exclude the case where the call frame is in the inspector code.
-            if (!WebInspector.isDebugUIEnabled() && isWebInspectorDebugScript(sourceCodeLocation.sourceCode.url))
+            if (!WebInspector.isDebugUIEnabled() && isWebKitInternalScript(sourceCodeLocation.sourceCode.url))
                 continue;
 
             let scopeChain = this._scopeChainFromPayload(callFramePayload.scopeChain);
@@ -556,8 +556,8 @@ WebInspector.DebuggerManager = class DebuggerManager extends WebInspector.Object
             scripts.push(script);
         }
 
-        if (isWebInspectorDebugScript(script.url)) {
-            this._inspectorDebugScripts.push(script);
+        if (isWebKitInternalScript(script.url)) {
+            this._internalWebKitScripts.push(script);
             if (!WebInspector.isDebugUIEnabled())
                 return;
         }
@@ -925,7 +925,7 @@ WebInspector.DebuggerManager = class DebuggerManager extends WebInspector.Object
     _debugUIEnabledDidChange()
     {
         let eventType = WebInspector.isDebugUIEnabled() ? WebInspector.DebuggerManager.Event.ScriptAdded : WebInspector.DebuggerManager.Event.ScriptRemoved;
-        for (let script of this._inspectorDebugScripts)
+        for (let script of this._internalWebKitScripts)
             this.dispatchEventToListeners(eventType, {script});
     }
 };
index 905b96f..18a5fe8 100644 (file)
@@ -513,7 +513,7 @@ WebInspector.RemoteObject = class RemoteObject
             var location = response.location;
             var sourceCode = WebInspector.debuggerManager.scriptForIdentifier(location.scriptId);
 
-            if (!sourceCode || (!WebInspector.isDebugUIEnabled() && isWebInspectorDebugScript(sourceCode.url))) {
+            if (!sourceCode || (!WebInspector.isDebugUIEnabled() && isWebKitInternalScript(sourceCode.url))) {
                 result.resolve(WebInspector.RemoteObject.SourceCodeLocationPromise.NoSourceFound);
                 return;
             }