<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[194311] trunk/Source/WebInspectorUI</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/194311">194311</a></dd>
<dt>Author</dt> <dd>mattbaker@apple.com</dd>
<dt>Date</dt> <dd>2015-12-18 22:44:50 -0800 (Fri, 18 Dec 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: Make it possible to debug injected scripts when the Debug UI is enabled
https://bugs.webkit.org/show_bug.cgi?id=152445

Reviewed by Joseph Pecoraro.

* UserInterface/Base/Main.js:
Added function to check for debug UI.

* UserInterface/Base/Object.js:
Added notification for debug UI enabled state change.

* UserInterface/Base/Utilities.js:
(isWebInspectorInternalScript):
(isWebInspectorDebugScript):
Added functions to check for internal and debug inspector scripts.

* UserInterface/Controllers/DebuggerManager.js:
(WebInspector.DebuggerManager):
Maintain a list of inspector debug scripts, so that the manager can
add and remove them when the debug UI is enabled/disabled.
(WebInspector.DebuggerManager.prototype.get knownNonResourceScripts):
(WebInspector.DebuggerManager.prototype.reset):
Clear the list of inspector debug scripts.
(WebInspector.DebuggerManager.prototype.debuggerDidPause):
(WebInspector.DebuggerManager.prototype.scriptDidParse):
Skip internal inspector scripts. Debug inspector scripts are tracked,
and an added event is dispatched if the debug UI is enabled.
(WebInspector.DebuggerManager.prototype._debugUIEnabledDidChange):
Dispatch added/removed events for inspector debug scripts.

* UserInterface/Debug/Bootstrap.js:
(WebInspector.runBootstrapOperations):
Expose changes to the debug UI setting to the reset of the UI, by dispatching
a WebInspector.Notification.DebugUIEnabledDidChange event.

* UserInterface/Protocol/RemoteObject.js:
(WebInspector.RemoteObject.prototype.findFunctionSourceCodeLocation):
Only resolve inspector debug source locations when the debug UI is enabled.

* UserInterface/Test/Test.js:
Reimplemented debug UI check for tests. Always returns false.

* UserInterface/Views/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel.prototype._addScript):
Removed check for inspector debug scripts. DebuggerManager filters scripts as needed.
(WebInspector.DebuggerSidebarPanel.prototype._scriptRemoved):
Handle DebuggerManager ScriptRemoved events. Only applies to debug scripts.

* UserInterface/Views/ResourceSidebarPanel.js:
(WebInspector.ResourceSidebarPanel):
(WebInspector.ResourceSidebarPanel.prototype._scriptWasRemoved):
Handle DebuggerManager ScriptRemoved events. Only applies to debug scripts.
(WebInspector.ResourceSidebarPanel.prototype._scriptWasAdded):
Removed check for inspector debug scripts. DebuggerManager filters scripts as needed.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceBaseMainjs">trunk/Source/WebInspectorUI/UserInterface/Base/Main.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceBaseObjectjs">trunk/Source/WebInspectorUI/UserInterface/Base/Object.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceBaseUtilitiesjs">trunk/Source/WebInspectorUI/UserInterface/Base/Utilities.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersDebuggerManagerjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDebugBootstrapjs">trunk/Source/WebInspectorUI/UserInterface/Debug/Bootstrap.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProtocolRemoteObjectjs">trunk/Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTestTestjs">trunk/Source/WebInspectorUI/UserInterface/Test/Test.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDebuggerSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsResourceSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/Views/ResourceSidebarPanel.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (194310 => 194311)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2015-12-19 02:32:46 UTC (rev 194310)
+++ trunk/Source/WebInspectorUI/ChangeLog        2015-12-19 06:44:50 UTC (rev 194311)
</span><span class="lines">@@ -1,3 +1,60 @@
</span><ins>+2015-12-18  Matt Baker  &lt;mattbaker@apple.com&gt;
+
+        Web Inspector: Make it possible to debug injected scripts when the Debug UI is enabled
+        https://bugs.webkit.org/show_bug.cgi?id=152445
+
+        Reviewed by Joseph Pecoraro.
+
+        * UserInterface/Base/Main.js:
+        Added function to check for debug UI.
+
+        * UserInterface/Base/Object.js:
+        Added notification for debug UI enabled state change.
+
+        * UserInterface/Base/Utilities.js:
+        (isWebInspectorInternalScript):
+        (isWebInspectorDebugScript):
+        Added functions to check for internal and debug inspector scripts.
+
+        * UserInterface/Controllers/DebuggerManager.js:
+        (WebInspector.DebuggerManager):
+        Maintain a list of inspector debug scripts, so that the manager can
+        add and remove them when the debug UI is enabled/disabled.
+        (WebInspector.DebuggerManager.prototype.get knownNonResourceScripts):
+        (WebInspector.DebuggerManager.prototype.reset):
+        Clear the list of inspector debug scripts.
+        (WebInspector.DebuggerManager.prototype.debuggerDidPause):
+        (WebInspector.DebuggerManager.prototype.scriptDidParse):
+        Skip internal inspector scripts. Debug inspector scripts are tracked,
+        and an added event is dispatched if the debug UI is enabled.
+        (WebInspector.DebuggerManager.prototype._debugUIEnabledDidChange):
+        Dispatch added/removed events for inspector debug scripts.
+
+        * UserInterface/Debug/Bootstrap.js:
+        (WebInspector.runBootstrapOperations):
+        Expose changes to the debug UI setting to the reset of the UI, by dispatching
+        a WebInspector.Notification.DebugUIEnabledDidChange event.
+
+        * UserInterface/Protocol/RemoteObject.js:
+        (WebInspector.RemoteObject.prototype.findFunctionSourceCodeLocation):
+        Only resolve inspector debug source locations when the debug UI is enabled.
+
+        * UserInterface/Test/Test.js:
+        Reimplemented debug UI check for tests. Always returns false.
+
+        * UserInterface/Views/DebuggerSidebarPanel.js:
+        (WebInspector.DebuggerSidebarPanel.prototype._addScript):
+        Removed check for inspector debug scripts. DebuggerManager filters scripts as needed.
+        (WebInspector.DebuggerSidebarPanel.prototype._scriptRemoved):
+        Handle DebuggerManager ScriptRemoved events. Only applies to debug scripts.
+
+        * UserInterface/Views/ResourceSidebarPanel.js:
+        (WebInspector.ResourceSidebarPanel):
+        (WebInspector.ResourceSidebarPanel.prototype._scriptWasRemoved):
+        Handle DebuggerManager ScriptRemoved events. Only applies to debug scripts.
+        (WebInspector.ResourceSidebarPanel.prototype._scriptWasAdded):
+        Removed check for inspector debug scripts. DebuggerManager filters scripts as needed.
+
</ins><span class="cx"> 2015-12-17  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: Remove &quot;local&quot; scope type from the protocol
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceBaseMainjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Base/Main.js (194310 => 194311)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Base/Main.js        2015-12-19 02:32:46 UTC (rev 194310)
+++ trunk/Source/WebInspectorUI/UserInterface/Base/Main.js        2015-12-19 06:44:50 UTC (rev 194311)
</span><span class="lines">@@ -1369,8 +1369,7 @@
</span><span class="cx">     let proposedContextMenu;
</span><span class="cx"> 
</span><span class="cx">     // This is setting is only defined in engineering builds.
</span><del>-    let showDebugUI = WebInspector.showDebugUISetting &amp;&amp; WebInspector.showDebugUISetting.value;
-    if (showDebugUI) {
</del><ins>+    if (WebInspector.isDebugUIEnabled()) {
</ins><span class="cx">         proposedContextMenu = WebInspector.ContextMenu.createFromEvent(event);
</span><span class="cx">         proposedContextMenu.appendSeparator();
</span><span class="cx">         proposedContextMenu.appendItem(WebInspector.unlocalizedString(&quot;Reload Web Inspector&quot;), () =&gt; {
</span><span class="lines">@@ -1385,6 +1384,11 @@
</span><span class="cx">         proposedContextMenu.show();
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+WebInspector.isDebugUIEnabled = function()
+{
+    return WebInspector.showDebugUISetting &amp;&amp; WebInspector.showDebugUISetting.value;
+}
+
</ins><span class="cx"> WebInspector._undock = function(event)
</span><span class="cx"> {
</span><span class="cx">     InspectorFrontendHost.requestSetDockSide(&quot;undocked&quot;);
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceBaseObjectjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Base/Object.js (194310 => 194311)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Base/Object.js        2015-12-19 02:32:46 UTC (rev 194310)
+++ trunk/Source/WebInspectorUI/UserInterface/Base/Object.js        2015-12-19 06:44:50 UTC (rev 194311)
</span><span class="lines">@@ -209,4 +209,5 @@
</span><span class="cx">     PageArchiveEnded: &quot;page-archive-ended&quot;,
</span><span class="cx">     ExtraDomainsActivated: &quot;extra-domains-activated&quot;,
</span><span class="cx">     TabTypesChanged: &quot;tab-types-changed&quot;,
</span><ins>+    DebugUIEnabledDidChange: &quot;debug-ui-enabled-did-change&quot;,
</ins><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceBaseUtilitiesjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Base/Utilities.js (194310 => 194311)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Base/Utilities.js        2015-12-19 02:32:46 UTC (rev 194310)
+++ trunk/Source/WebInspectorUI/UserInterface/Base/Utilities.js        2015-12-19 06:44:50 UTC (rev 194311)
</span><span class="lines">@@ -1112,6 +1112,16 @@
</span><span class="cx">     return string + &quot;\n//# sourceURL=__WebInspectorInternal__\n&quot;;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+function isWebInspectorInternalScript(url)
+{
+    return url === &quot;__WebInspectorInternal__&quot;;
+}
+
+function isWebInspectorDebugScript(url)
+{
+    return url &amp;&amp; url.startsWith(&quot;__WebInspector&quot;);
+}
+
</ins><span class="cx"> function isFunctionStringNativeCode(str)
</span><span class="cx"> {
</span><span class="cx">     return str.endsWith(&quot;{\n    [native code]\n}&quot;);
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersDebuggerManagerjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js (194310 => 194311)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js        2015-12-19 02:32:46 UTC (rev 194310)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js        2015-12-19 06:44:50 UTC (rev 194311)
</span><span class="lines">@@ -32,6 +32,8 @@
</span><span class="cx">         if (window.DebuggerAgent)
</span><span class="cx">             DebuggerAgent.enable();
</span><span class="cx"> 
</span><ins>+        WebInspector.notifications.addEventListener(WebInspector.Notification.DebugUIEnabledDidChange, this._debugUIEnabledDidChange, this);
+
</ins><span class="cx">         WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.DisplayLocationDidChange, this._breakpointDisplayLocationDidChange, this);
</span><span class="cx">         WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.DisabledStateDidChange, this._breakpointDisabledStateDidChange, this);
</span><span class="cx">         WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.ConditionDidChange, this._breakpointEditablePropertyDidChange, this);
</span><span class="lines">@@ -62,6 +64,7 @@
</span><span class="cx">         this._pauseReason = null;
</span><span class="cx">         this._pauseData = null;
</span><span class="cx"> 
</span><ins>+        this._inspectorDebugScripts = [];
</ins><span class="cx">         this._scriptIdMap = new Map;
</span><span class="cx">         this._scriptURLMap = new Map;
</span><span class="cx"> 
</span><span class="lines">@@ -319,7 +322,7 @@
</span><span class="cx">         for (let script of this._scriptIdMap.values()) {
</span><span class="cx">             if (script.resource)
</span><span class="cx">                 continue;
</span><del>-            if (script.url &amp;&amp; script.url.startsWith(&quot;__WebInspector&quot;))
</del><ins>+            if (!WebInspector.isDebugUIEnabled() &amp;&amp; isWebInspectorDebugScript(script.url))
</ins><span class="cx">                 continue;
</span><span class="cx">             knownScripts.push(script);
</span><span class="cx">         }
</span><span class="lines">@@ -439,6 +442,7 @@
</span><span class="cx">         this._pauseReason = null;
</span><span class="cx">         this._pauseData = null;
</span><span class="cx"> 
</span><ins>+        this._inspectorDebugScripts = [];
</ins><span class="cx">         this._scriptIdMap.clear();
</span><span class="cx">         this._scriptURLMap.clear();
</span><span class="cx"> 
</span><span class="lines">@@ -486,8 +490,9 @@
</span><span class="cx">                 continue;
</span><span class="cx">             if (!sourceCodeLocation.sourceCode)
</span><span class="cx">                 continue;
</span><ins>+
</ins><span class="cx">             // Exclude the case where the call frame is in the inspector code.
</span><del>-            if (sourceCodeLocation.sourceCode.url &amp;&amp; sourceCodeLocation.sourceCode.url.startsWith(&quot;__WebInspector&quot;))
</del><ins>+            if (!WebInspector.isDebugUIEnabled() &amp;&amp; isWebInspectorDebugScript(sourceCodeLocation.sourceCode.url))
</ins><span class="cx">                 continue;
</span><span class="cx"> 
</span><span class="cx">             let scopeChain = this._scopeChainFromPayload(callFramePayload.scopeChain);
</span><span class="lines">@@ -530,6 +535,9 @@
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><ins>+        if (isWebInspectorInternalScript(url))
+            return;
+
</ins><span class="cx">         var script = new WebInspector.Script(scriptIdentifier, new WebInspector.TextRange(startLine, startColumn, endLine, endColumn), url, isContentScript, sourceMapURL);
</span><span class="cx"> 
</span><span class="cx">         this._scriptIdMap.set(scriptIdentifier, script);
</span><span class="lines">@@ -543,6 +551,12 @@
</span><span class="cx">             scripts.push(script);
</span><span class="cx">         }
</span><span class="cx"> 
</span><ins>+        if (isWebInspectorDebugScript(script.url)) {
+            this._inspectorDebugScripts.push(script);
+            if (!WebInspector.isDebugUIEnabled())
+                return;
+        }
+
</ins><span class="cx">         this.dispatchEventToListeners(WebInspector.DebuggerManager.Event.ScriptAdded, {script});
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -901,6 +915,13 @@
</span><span class="cx"> 
</span><span class="cx">         this._ignoreBreakpointDisplayLocationDidChangeEvent = false;
</span><span class="cx">     }
</span><ins>+
+    _debugUIEnabledDidChange()
+    {
+        let eventType = WebInspector.isDebugUIEnabled() ? WebInspector.DebuggerManager.Event.ScriptAdded : WebInspector.DebuggerManager.Event.ScriptRemoved;
+        for (let script of this._inspectorDebugScripts)
+            this.dispatchEventToListeners(eventType, {script});
+    }
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> WebInspector.DebuggerManager.Event = {
</span><span class="lines">@@ -913,6 +934,7 @@
</span><span class="cx">     CallFramesDidChange: &quot;debugger-manager-call-frames-did-change&quot;,
</span><span class="cx">     ActiveCallFrameDidChange: &quot;debugger-manager-active-call-frame-did-change&quot;,
</span><span class="cx">     ScriptAdded: &quot;debugger-manager-script-added&quot;,
</span><ins>+    ScriptRemoved: &quot;debugger-manager-script-removed&quot;,
</ins><span class="cx">     ScriptsCleared: &quot;debugger-manager-scripts-cleared&quot;,
</span><span class="cx">     BreakpointsEnabledDidChange: &quot;debugger-manager-breakpoints-enabled-did-change&quot;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDebugBootstrapjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Debug/Bootstrap.js (194310 => 194311)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Debug/Bootstrap.js        2015-12-19 02:32:46 UTC (rev 194310)
+++ trunk/Source/WebInspectorUI/UserInterface/Debug/Bootstrap.js        2015-12-19 06:44:50 UTC (rev 194311)
</span><span class="lines">@@ -52,6 +52,10 @@
</span><span class="cx">         debugInspectorToolbarButton.hidden = !WebInspector.showDebugUISetting.value;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    WebInspector.showDebugUISetting.addEventListener(WebInspector.Setting.Event.Changed, updateDebugUI);
</del><ins>+    WebInspector.showDebugUISetting.addEventListener(WebInspector.Setting.Event.Changed, () =&gt; {
+        updateDebugUI();
+        WebInspector.notifications.dispatchEventToListeners(WebInspector.Notification.DebugUIEnabledDidChange);
+    });
+
</ins><span class="cx">     updateDebugUI();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProtocolRemoteObjectjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js (194310 => 194311)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js        2015-12-19 02:32:46 UTC (rev 194310)
+++ trunk/Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js        2015-12-19 06:44:50 UTC (rev 194311)
</span><span class="lines">@@ -511,7 +511,7 @@
</span><span class="cx">             var location = response.location;
</span><span class="cx">             var sourceCode = WebInspector.debuggerManager.scriptForIdentifier(location.scriptId);
</span><span class="cx"> 
</span><del>-            if (!sourceCode || sourceCode.url.startsWith(&quot;__WebInspector&quot;)) {
</del><ins>+            if (!sourceCode || (!WebInspector.isDebugUIEnabled() &amp;&amp; isWebInspectorDebugScript(sourceCode.url))) {
</ins><span class="cx">                 result.resolve(WebInspector.RemoteObject.SourceCodeLocationPromise.NoSourceFound);
</span><span class="cx">                 return;
</span><span class="cx">             }
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTestTestjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Test/Test.js (194310 => 194311)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Test/Test.js        2015-12-19 02:32:46 UTC (rev 194310)
+++ trunk/Source/WebInspectorUI/UserInterface/Test/Test.js        2015-12-19 06:44:50 UTC (rev 194311)
</span><span class="lines">@@ -87,6 +87,8 @@
</span><span class="cx">     InspectorFrontendHost.loaded();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+WebInspector.isDebugUIEnabled = () =&gt; false;
+
</ins><span class="cx"> WebInspector.UIString = (string) =&gt; string;
</span><span class="cx"> 
</span><span class="cx"> // Add stubs that are called by the frontend API.
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDebuggerSidebarPaneljs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js (194310 => 194311)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js        2015-12-19 02:32:46 UTC (rev 194310)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js        2015-12-19 06:44:50 UTC (rev 194311)
</span><span class="lines">@@ -39,6 +39,7 @@
</span><span class="cx">         WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.BreakpointAdded, this._breakpointAdded, this);
</span><span class="cx">         WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.BreakpointRemoved, this._breakpointRemoved, this);
</span><span class="cx">         WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, this._scriptAdded, this);
</span><ins>+        WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptRemoved, this._scriptRemoved, this);
</ins><span class="cx">         WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptsCleared, this._scriptsCleared, this);
</span><span class="cx">         WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.Paused, this._debuggerDidPause, this);
</span><span class="cx">         WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.Resumed, this._debuggerDidResume, this);
</span><span class="lines">@@ -394,15 +395,10 @@
</span><span class="cx"> 
</span><span class="cx">     _addScript(script)
</span><span class="cx">     {
</span><del>-        // FIXME: Allow for scripts generated by eval statements to appear, but filter out JSC internals
-        // and other WebInspector internals lacking __WebInspector in the url attribute.
</del><ins>+        // COMPATIBILITY(iOS 9): Backends could send the frontend built-in code, filter out JSC internals.
</ins><span class="cx">         if (!script.url)
</span><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        // Exclude inspector scripts.
-        if (script.url &amp;&amp; script.url.startsWith(&quot;__WebInspector&quot;))
-            return;
-
</del><span class="cx">         // Don't add breakpoints if the script is represented by a Resource. They were
</span><span class="cx">         // already added by _resourceAdded.
</span><span class="cx">         if (script.resource)
</span><span class="lines">@@ -416,6 +412,16 @@
</span><span class="cx">             this.showDefaultContentViewForTreeElement(treeElement);
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    _scriptRemoved(event)
+    {
+        let script = event.data.script;
+        let scriptTreeElement = this._breakpointsContentTreeOutline.getCachedTreeElement(script);
+        if (!scriptTreeElement)
+            return;
+
+        scriptTreeElement.parent.removeChild(scriptTreeElement);
+    }
+
</ins><span class="cx">     _scriptsCleared(event)
</span><span class="cx">     {
</span><span class="cx">         for (var i = this._breakpointsContentTreeOutline.children.length - 1; i &gt;= 0; --i) {
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsResourceSidebarPaneljs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ResourceSidebarPanel.js (194310 => 194311)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ResourceSidebarPanel.js        2015-12-19 02:32:46 UTC (rev 194310)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ResourceSidebarPanel.js        2015-12-19 06:44:50 UTC (rev 194311)
</span><span class="lines">@@ -58,6 +58,7 @@
</span><span class="cx">         WebInspector.frameResourceManager.addEventListener(WebInspector.FrameResourceManager.Event.MainFrameDidChange, this._mainFrameDidChange, this);
</span><span class="cx"> 
</span><span class="cx">         WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, this._scriptWasAdded, this);
</span><ins>+        WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptRemoved, this._scriptWasRemoved, this);
</ins><span class="cx">         WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptsCleared, this._scriptsCleared, this);
</span><span class="cx"> 
</span><span class="cx">         WebInspector.notifications.addEventListener(WebInspector.Notification.ExtraDomainsActivated, this._extraDomainsActivated, this);
</span><span class="lines">@@ -270,10 +271,6 @@
</span><span class="cx">         if (!script.url)
</span><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        // Exclude inspector scripts.
-        if (script.url.startsWith(&quot;__WebInspector&quot;))
-            return;
-
</del><span class="cx">         // If the script URL matches a resource we can assume it is part of that resource and does not need added.
</span><span class="cx">         if (script.resource)
</span><span class="cx">             return;
</span><span class="lines">@@ -309,6 +306,16 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    _scriptWasRemoved(event)
+    {
+        let script = event.data.script;
+        let scriptTreeElement = this.contentTreeOutline.getCachedTreeElement(script);
+        if (!scriptTreeElement)
+            return;
+
+        scriptTreeElement.parent.removeChild(scriptTreeElement);
+    }
+
</ins><span class="cx">     _scriptsCleared(event)
</span><span class="cx">     {
</span><span class="cx">         const suppressOnDeselect = true;
</span></span></pre>
</div>
</div>

</body>
</html>