<!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>[213691] trunk</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/213691">213691</a></dd>
<dt>Author</dt> <dd>mattbaker@apple.com</dd>
<dt>Date</dt> <dd>2017-03-09 16:53:48 -0800 (Thu, 09 Mar 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: Add XHR breakpoints UI
https://bugs.webkit.org/show_bug.cgi?id=168763
&lt;rdar://problem/30952439&gt;

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

* inspector/protocol/DOMDebugger.json:
Added clarifying comments to command descriptions.

Source/WebCore:

Test: inspector/dom-debugger/xhr-breakpoints.html

* inspector/InspectorDOMDebuggerAgent.cpp:
(WebCore::InspectorDOMDebuggerAgent::discardBindings):
(WebCore::InspectorDOMDebuggerAgent::willSendXMLHttpRequest):
Don't break for XHRs when breakpoints are disabled.

Source/WebInspectorUI:

* Localizations/en.lproj/localizedStrings.js:
New UI strings.

* UserInterface/Controllers/DOMDebuggerManager.js:
Plumbing for XHR breakpoints. Like DOM breakpoints, they are tracked
per-page. Unlike DOM breakpoints, they have no separate &quot;resolved&quot;
state, and are simply added/removed as the main frame changes.

(WebInspector.DOMDebuggerManager):
(WebInspector.DOMDebuggerManager.prototype.get allRequestsBreakpoint):
(WebInspector.DOMDebuggerManager.prototype.get xhrBreakpoints):
(WebInspector.DOMDebuggerManager.prototype.isBreakpointRemovable):
(WebInspector.DOMDebuggerManager.prototype.removeDOMBreakpoint):
(WebInspector.DOMDebuggerManager.prototype.addXHRBreakpoint):
(WebInspector.DOMDebuggerManager.prototype.removeXHRBreakpoint):
(WebInspector.DOMDebuggerManager.prototype._speculativelyResolveBreakpoints):
(WebInspector.DOMDebuggerManager.prototype._detachXHRBreakpoint):
(WebInspector.DOMDebuggerManager.prototype._updateXHRBreakpoint.breakpointUpdated):
(WebInspector.DOMDebuggerManager.prototype._updateXHRBreakpoint):
(WebInspector.DOMDebuggerManager.prototype._resolveXHRBreakpoint):
(WebInspector.DOMDebuggerManager.prototype._saveXHRBreakpoints):
(WebInspector.DOMDebuggerManager.prototype._domBreakpointDisabledStateDidChange):
(WebInspector.DOMDebuggerManager.prototype._xhrBreakpointDisabledStateDidChange):
(WebInspector.DOMDebuggerManager.prototype._mainResourceDidChange):
(WebInspector.DOMDebuggerManager.prototype._saveBreakpoints): Deleted.
Renamed `saveDOMBreakpoints`.

* UserInterface/Controllers/DebuggerManager.js:
(WebInspector.DebuggerManager.prototype._pauseReasonFromPayload):
Plumbing for XHR breakpoint pause reason.

* UserInterface/Controllers/XHRBreakpointTreeController.js: Added.
Creates the &quot;All Requests&quot; breakpoint, handles DOMDebuggerManager messages,
and updates an associated tree outline as XHR breakpoints are added and removed.

(WebInspector.XHRBreakpointTreeController):
(WebInspector.XHRBreakpointTreeController.prototype.revealAndSelect):
(WebInspector.XHRBreakpointTreeController.prototype.disconnect):
(WebInspector.XHRBreakpointTreeController.prototype._xhrBreakpointAdded):
(WebInspector.XHRBreakpointTreeController.prototype._xhrBreakpointRemoved):
(WebInspector.XHRBreakpointTreeController.prototype._mainResourceDidChange):
(WebInspector.XHRBreakpointTreeController.prototype._reset):

* UserInterface/Main.html:
New files.

* UserInterface/Models/XHRBreakpoint.js: Added.
New model class. XHR breakpoints have an associated URL, which is matched
against the request URL when deciding whether to break. An empty URL matches
all XMLHttpRequests.

(WebInspector.XHRBreakpoint):
(WebInspector.XHRBreakpoint.prototype.get documentURL):
(WebInspector.XHRBreakpoint.prototype.get url):
(WebInspector.XHRBreakpoint.prototype.get disabled):
(WebInspector.XHRBreakpoint.prototype.set disabled):
(WebInspector.XHRBreakpoint.prototype.get serializableInfo):
(WebInspector.XHRBreakpoint.prototype.saveIdentityToCookie):

* UserInterface/Test.html:
New files.

* UserInterface/Views/ContentView.js:
(WebInspector.ContentView.createFromRepresentedObject):
Plumbing for new represented object type, to prevent runtime assertion.

* UserInterface/Views/DOMBreakpointTreeElement.js:
(WebInspector.DOMBreakpointTreeElement):
Reuse BreakpointTreeElement styles.

* UserInterface/Views/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel):
(WebInspector.DebuggerSidebarPanel.prototype.saveStateToCookie):
(WebInspector.DebuggerSidebarPanel.prototype.restoreStateFromCookie):
(WebInspector.DebuggerSidebarPanel.prototype._updatePauseReasonSection):
(WebInspector.DebuggerSidebarPanel.prototype._addXHRBreakpointButtonClicked):
(WebInspector.DebuggerSidebarPanel.prototype.willDismissPopover):

* UserInterface/Views/InputPopover.css: Added.
(.popover .input-popover-content):
(.popover .input-popover-content &gt; .editor):
(.popover .input-popover-content &gt; .editor &gt; .CodeMirror):
(.popover .input-popover-content &gt; .editor &gt; .CodeMirror-scroll):

* UserInterface/Views/InputPopover.js: Added.
New general purpose popover class. Style and structure lifted from
the Popover implementation used by the Probe Expressions UI. A follow-up
has been filed to switch that UI over to this new class:
https://bugs.webkit.org/show_bug.cgi?id=169428.

(WebInspector.InputPopover):
(WebInspector.InputPopover.prototype.get value):
(WebInspector.InputPopover.prototype.get result):
(WebInspector.InputPopover.prototype.show):
(WebInspector.InputPopover.prototype._presentOverTargetElement):

* UserInterface/Views/XHRBreakpointTreeElement.js: Added.
Tree element class for XHR breakpoints. Behaves identically to
script and DOM breakpoint tree elements.

(WebInspector.XHRBreakpointTreeElement):
Reuse BreakpointTreeElement styles.
(WebInspector.XHRBreakpointTreeElement.prototype.onattach):
(WebInspector.XHRBreakpointTreeElement.prototype.ondetach):
(WebInspector.XHRBreakpointTreeElement.prototype.ondelete):
(WebInspector.XHRBreakpointTreeElement.prototype.onenter):
(WebInspector.XHRBreakpointTreeElement.prototype.onspace):
(WebInspector.XHRBreakpointTreeElement.prototype.populateContextMenu):
(WebInspector.XHRBreakpointTreeElement.prototype._statusImageElementClicked):
(WebInspector.XHRBreakpointTreeElement.prototype._statusImageElementFocused):
(WebInspector.XHRBreakpointTreeElement.prototype._statusImageElementMouseDown):
(WebInspector.XHRBreakpointTreeElement.prototype._toggleBreakpoint):
(WebInspector.XHRBreakpointTreeElement.prototype._updateStatus):

LayoutTests:

Tests for pausing on XMLHttpRequests using XHR breakpoints.

* inspector/dom-debugger/xhr-breakpoints-expected.txt: Added.
* inspector/dom-debugger/xhr-breakpoints.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorprotocolDOMDebuggerjson">trunk/Source/JavaScriptCore/inspector/protocol/DOMDebugger.json</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorDOMDebuggerAgentcpp">trunk/Source/WebCore/inspector/InspectorDOMDebuggerAgent.cpp</a></li>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUILocalizationsenlprojlocalizedStringsjs">trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersDOMDebuggerManagerjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/DOMDebuggerManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersDebuggerManagerjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceMainhtml">trunk/Source/WebInspectorUI/UserInterface/Main.html</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTesthtml">trunk/Source/WebInspectorUI/UserInterface/Test.html</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/ContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDOMBreakpointTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/DOMBreakpointTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDebuggerSidebarPanelcss">trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDebuggerSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsinspectordomdebuggerxhrbreakpointsexpectedtxt">trunk/LayoutTests/inspector/dom-debugger/xhr-breakpoints-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectordomdebuggerxhrbreakpointshtml">trunk/LayoutTests/inspector/dom-debugger/xhr-breakpoints.html</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersXHRBreakpointTreeControllerjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/XHRBreakpointTreeController.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsXHRBreakpointjs">trunk/Source/WebInspectorUI/UserInterface/Models/XHRBreakpoint.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsInputPopovercss">trunk/Source/WebInspectorUI/UserInterface/Views/InputPopover.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsInputPopoverjs">trunk/Source/WebInspectorUI/UserInterface/Views/InputPopover.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsXHRBreakpointTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/XHRBreakpointTreeElement.js</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDOMBreakpointTreeElementcss">trunk/Source/WebInspectorUI/UserInterface/Views/DOMBreakpointTreeElement.css</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (213690 => 213691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2017-03-10 00:53:09 UTC (rev 213690)
+++ trunk/LayoutTests/ChangeLog        2017-03-10 00:53:48 UTC (rev 213691)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2017-03-09  Matt Baker  &lt;mattbaker@apple.com&gt;
+
+        Web Inspector: Add XHR breakpoints UI
+        https://bugs.webkit.org/show_bug.cgi?id=168763
+        &lt;rdar://problem/30952439&gt;
+
+        Reviewed by Joseph Pecoraro.
+
+        Tests for pausing on XMLHttpRequests using XHR breakpoints.
+
+        * inspector/dom-debugger/xhr-breakpoints-expected.txt: Added.
+        * inspector/dom-debugger/xhr-breakpoints.html: Added.
+
</ins><span class="cx"> 2017-03-09  John Wilander  &lt;wilander@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Resource Load Statistics: Remove statistics data as part of full website data removal
</span></span></pre></div>
<a id="trunkLayoutTestsinspectordomdebuggerxhrbreakpointsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/dom-debugger/xhr-breakpoints-expected.txt (0 => 213691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/dom-debugger/xhr-breakpoints-expected.txt                                (rev 0)
+++ trunk/LayoutTests/inspector/dom-debugger/xhr-breakpoints-expected.txt        2017-03-10 00:53:48 UTC (rev 213691)
</span><span class="lines">@@ -0,0 +1,52 @@
</span><ins>+Tests for XHR breakpoints.
+
+
+== Running test suite: XHRBreakpoints
+-- Running test case: BreakOnAllXMLHttpRequests
+Set pause on all XMLHttpRequests.
+Sending XMLHttpRequest.
+PAUSED:
+PASS: Pause reason should be XHR.
+PASS: Pause data URL should be empty.
+CALL STACK:
+0: [F] loadResourceXHR
+1: [P] Global Code
+-- Running test teardown.
+
+-- Running test case: BreakOnXMLHttpRequestContainingURL
+PASS: Breakpoint should not be disabled initially.
+PASS: Added breakpoint for URL: data
+Sending XMLHttpRequest.
+PAUSED:
+PASS: Pause reason should be XHR.
+PASS: Pause data URL should match breakpoint URL.
+CALL STACK:
+0: [F] loadResourceXHR
+1: [P] Global Code
+-- Running test teardown.
+
+-- Running test case: ShouldNotPauseOnDisabledBreakpoint
+PASS: Breakpoint should not be disabled initially.
+Disabling breakpoint.
+PASS: Added breakpoint for URL: data
+Sending XMLHttpRequest.
+Wait for evaluate in page to return.
+PASS: Should not pause for disabled breakpoint.
+-- Running test teardown.
+
+-- Running test case: ShouldNotPauseOnXMLHttpRequestNotContainingURL
+PASS: Breakpoint should not be disabled initially.
+PASS: Added breakpoint for URL: nonexistant-url
+Sending XMLHttpRequest.
+Wait for evaluate in page to return.
+PASS: Should not pause for breakpoint with different URL.
+-- Running test teardown.
+
+-- Running test case: RemoveBreakpoint
+PASS: Breakpoint should not be disabled initially.
+PASS: Added breakpoint for URL: data
+Remove breakpoint.
+Wait for evaluate in page to return.
+PASS: Should not pause for removed breakpoint.
+-- Running test teardown.
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordomdebuggerxhrbreakpointshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/dom-debugger/xhr-breakpoints.html (0 => 213691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/dom-debugger/xhr-breakpoints.html                                (rev 0)
+++ trunk/LayoutTests/inspector/dom-debugger/xhr-breakpoints.html        2017-03-10 00:53:48 UTC (rev 213691)
</span><span class="lines">@@ -0,0 +1,189 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../http/tests/inspector/resources/inspector-test.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../debugger/resources/log-active-stack-trace.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../worker/resources/resource-utilities.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+function test()
+{
+    let suite = InspectorTest.createAsyncSuite(&quot;XHRBreakpoints&quot;);
+
+    function teardown(resolve) {
+        let breakpoints = WebInspector.domDebuggerManager.xhrBreakpoints;
+        for (let breakpoint of breakpoints)
+            WebInspector.domDebuggerManager.removeXHRBreakpoint(breakpoint);
+
+        WebInspector.domDebuggerManager.allRequestsBreakpoint.disabled = true;
+        resolve();
+    }
+
+    function awaitEvaluateInPage(expression) {
+        return new Promise((resolve, reject) =&gt; {
+            InspectorTest.log(&quot;Wait for evaluate in page to return.&quot;);
+            InspectorTest.evaluateInPage(expression, (error) =&gt; {
+                if (error)
+                    reject(error);
+
+                resolve();
+            });
+        });
+    }
+
+    function rejectOnPause() {
+        return new Promise((resolve, reject) =&gt; {
+            WebInspector.debuggerManager.awaitEvent(WebInspector.DebuggerManager.Event.Paused)
+            .then((event) =&gt; {
+                WebInspector.debuggerManager.resume();
+                InspectorTest.fail(&quot;Should not pause.&quot;);
+                reject();
+            });
+        });
+    }
+
+    function addBreakpointForURL(url, disabled) {
+        return new Promise((resolve, reject) =&gt; {
+            let mainFrame = WebInspector.frameResourceManager.mainFrame;
+            InspectorTest.assert(mainFrame, &quot;Missing main frame.&quot;);
+            if (!mainFrame)
+                reject();
+
+            let breakpoint = new WebInspector.XHRBreakpoint(mainFrame.url, url);
+            WebInspector.domDebuggerManager.awaitEvent(WebInspector.DOMDebuggerManager.Event.XHRBreakpointAdded)
+            .then(() =&gt; {
+                InspectorTest.expectFalse(breakpoint.disabled, &quot;Breakpoint should not be disabled initially.&quot;);
+
+                if (disabled) {
+                    InspectorTest.log(&quot;Disabling breakpoint.&quot;);
+                    breakpoint.disabled = true;
+                }
+
+                InspectorTest.pass(&quot;Added breakpoint for URL: &quot; + url);
+                resolve(breakpoint);
+            });
+
+            WebInspector.domDebuggerManager.addXHRBreakpoint(breakpoint);
+        });
+    }
+
+    suite.addTestCase({
+        name: &quot;BreakOnAllXMLHttpRequests&quot;,
+        description: &quot;Check that debugger pauses for all XMLHttpRequests.&quot;,
+        teardown,
+        test(resolve, reject) {
+            InspectorTest.log(&quot;Set pause on all XMLHttpRequests.&quot;);
+            WebInspector.domDebuggerManager.allRequestsBreakpoint.disabled = false;
+
+            InspectorTest.log(&quot;Sending XMLHttpRequest.&quot;);
+            InspectorTest.evaluateInPage(&quot;loadResourceXHR()&quot;);
+
+            WebInspector.debuggerManager.awaitEvent(WebInspector.DebuggerManager.Event.Paused)
+            .then(() =&gt; {
+                let targetData = WebInspector.debuggerManager.dataForTarget(WebInspector.debuggerManager.activeCallFrame.target);
+                InspectorTest.log(&quot;PAUSED:&quot;);
+                InspectorTest.expectEqual(targetData.pauseReason, WebInspector.DebuggerManager.PauseReason.XHR, &quot;Pause reason should be XHR.&quot;);
+                InspectorTest.expectFalse(targetData.pauseData.breakpointURL, &quot;Pause data URL should be empty.&quot;);
+
+                logActiveStackTrace();
+
+                return WebInspector.debuggerManager.resume();
+            })
+            .then(resolve, reject);
+        }
+    });
+
+    suite.addTestCase({
+        name: &quot;BreakOnXMLHttpRequestContainingURL&quot;,
+        description: &quot;Check that debugger pauses for XMLHttpRequests.&quot;,
+        teardown,
+        test(resolve, reject) {
+            let expectedBreakpointURL;
+            addBreakpointForURL(&quot;data&quot;)
+            .then((breakpoint) =&gt; {
+                expectedBreakpointURL = breakpoint.url;
+
+                InspectorTest.log(&quot;Sending XMLHttpRequest.&quot;);
+                InspectorTest.evaluateInPage(&quot;loadResourceXHR()&quot;);
+                return WebInspector.debuggerManager.awaitEvent(WebInspector.DebuggerManager.Event.Paused);
+            })
+            .then(() =&gt; {
+                let targetData = WebInspector.debuggerManager.dataForTarget(WebInspector.debuggerManager.activeCallFrame.target);
+                InspectorTest.log(&quot;PAUSED:&quot;);
+                InspectorTest.expectEqual(targetData.pauseReason, WebInspector.DebuggerManager.PauseReason.XHR, &quot;Pause reason should be XHR.&quot;);
+                InspectorTest.expectEqual(targetData.pauseData.breakpointURL, expectedBreakpointURL, &quot;Pause data URL should match breakpoint URL.&quot;);
+
+                logActiveStackTrace();
+
+                return WebInspector.debuggerManager.resume();
+            })
+            .then(resolve, reject);
+        }
+    });
+
+    suite.addTestCase({
+        name: &quot;ShouldNotPauseOnDisabledBreakpoint&quot;,
+        description: &quot;Check that debugger does not pause for disabled breakpoint.&quot;,
+        teardown,
+        test(resolve, reject) {
+            const disabled = true;
+            addBreakpointForURL(&quot;data&quot;, disabled)
+            .then((breakpoint) =&gt; {
+                InspectorTest.log(&quot;Sending XMLHttpRequest.&quot;);
+                return Promise.race([awaitEvaluateInPage(&quot;loadResourceXHR()&quot;), rejectOnPause()]);
+            })
+            .then(() =&gt; {
+                InspectorTest.pass(&quot;Should not pause for disabled breakpoint.&quot;);
+                resolve();
+            })
+            .catch(reject);
+        }
+    });
+
+    suite.addTestCase({
+        name: &quot;ShouldNotPauseOnXMLHttpRequestNotContainingURL&quot;,
+        description: &quot;Check that debugger does not pause for breakpoint with different URL.&quot;,
+        teardown,
+        test(resolve, reject) {
+            addBreakpointForURL(&quot;nonexistant-url&quot;)
+            .then((breakpoint) =&gt; {
+                InspectorTest.log(&quot;Sending XMLHttpRequest.&quot;);
+                return Promise.race([awaitEvaluateInPage(&quot;loadResourceXHR()&quot;), rejectOnPause()]);
+            })
+            .then(() =&gt; {
+                InspectorTest.pass(&quot;Should not pause for breakpoint with different URL.&quot;);
+                resolve();
+            })
+            .catch(reject);
+        }
+    });
+
+    suite.addTestCase({
+        name: &quot;RemoveBreakpoint&quot;,
+        description: &quot;Check that debugger does not pause for removed breakpoint.&quot;,
+        teardown,
+        test(resolve, reject) {
+            addBreakpointForURL(&quot;data&quot;)
+            .then((breakpoint) =&gt; {
+                let promise = WebInspector.domDebuggerManager.awaitEvent(WebInspector.DOMDebuggerManager.Event.XHRBreakpointRemoved);
+
+                InspectorTest.log(&quot;Remove breakpoint.&quot;);
+                WebInspector.domDebuggerManager.removeXHRBreakpoint(breakpoint);
+                return promise;
+            })
+            .then(() =&gt; Promise.race([awaitEvaluateInPage(&quot;loadResourceXHR()&quot;), rejectOnPause()]))
+            .then(() =&gt; {
+                InspectorTest.pass(&quot;Should not pause for removed breakpoint.&quot;);
+                resolve();
+            })
+            .catch(reject);
+        }
+    });
+
+    suite.runTestCasesAndFinish();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+&lt;p&gt;Tests for XHR breakpoints.&lt;/p&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (213690 => 213691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2017-03-10 00:53:09 UTC (rev 213690)
+++ trunk/Source/JavaScriptCore/ChangeLog        2017-03-10 00:53:48 UTC (rev 213691)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2017-03-09  Matt Baker  &lt;mattbaker@apple.com&gt;
+
+        Web Inspector: Add XHR breakpoints UI
+        https://bugs.webkit.org/show_bug.cgi?id=168763
+        &lt;rdar://problem/30952439&gt;
+
+        Reviewed by Joseph Pecoraro.
+
+        * inspector/protocol/DOMDebugger.json:
+        Added clarifying comments to command descriptions.
+
</ins><span class="cx"> 2017-03-09  Michael Saboff  &lt;msaboff@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Add plumbing to WebProcess to enable JavaScriptCore configuration and logging
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorprotocolDOMDebuggerjson"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/protocol/DOMDebugger.json (213690 => 213691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/protocol/DOMDebugger.json        2017-03-10 00:53:09 UTC (rev 213690)
+++ trunk/Source/JavaScriptCore/inspector/protocol/DOMDebugger.json        2017-03-10 00:53:48 UTC (rev 213691)
</span><span class="lines">@@ -58,7 +58,7 @@
</span><span class="cx">         {
</span><span class="cx">             &quot;name&quot;: &quot;setXHRBreakpoint&quot;,
</span><span class="cx">             &quot;parameters&quot;: [
</span><del>-                { &quot;name&quot;: &quot;url&quot;, &quot;type&quot;: &quot;string&quot;, &quot;description&quot;: &quot;Resource URL substring. All XHRs having this substring in the URL will get stopped upon.&quot; }
</del><ins>+                { &quot;name&quot;: &quot;url&quot;, &quot;type&quot;: &quot;string&quot;, &quot;description&quot;: &quot;Resource URL substring. All XHRs having this substring in the URL will get stopped upon. An empty string will pause on all XHRs.&quot; }
</ins><span class="cx">             ],
</span><span class="cx">             &quot;description&quot;: &quot;Sets breakpoint on XMLHttpRequest.&quot;
</span><span class="cx">         },
</span><span class="lines">@@ -65,7 +65,7 @@
</span><span class="cx">         {
</span><span class="cx">             &quot;name&quot;: &quot;removeXHRBreakpoint&quot;,
</span><span class="cx">             &quot;parameters&quot;: [
</span><del>-                { &quot;name&quot;: &quot;url&quot;, &quot;type&quot;: &quot;string&quot;, &quot;description&quot;: &quot;Resource URL substring.&quot; }
</del><ins>+                { &quot;name&quot;: &quot;url&quot;, &quot;type&quot;: &quot;string&quot;, &quot;description&quot;: &quot;Resource URL substring. An empty string will stop pausing on all XHRs.&quot; }
</ins><span class="cx">             ],
</span><span class="cx">             &quot;description&quot;: &quot;Removes breakpoint from XMLHttpRequest.&quot;
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (213690 => 213691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-03-10 00:53:09 UTC (rev 213690)
+++ trunk/Source/WebCore/ChangeLog        2017-03-10 00:53:48 UTC (rev 213691)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2017-03-09  Matt Baker  &lt;mattbaker@apple.com&gt;
+
+        Web Inspector: Add XHR breakpoints UI
+        https://bugs.webkit.org/show_bug.cgi?id=168763
+        &lt;rdar://problem/30952439&gt;
+
+        Reviewed by Joseph Pecoraro.
+
+        Test: inspector/dom-debugger/xhr-breakpoints.html
+
+        * inspector/InspectorDOMDebuggerAgent.cpp:
+        (WebCore::InspectorDOMDebuggerAgent::discardBindings):
+        (WebCore::InspectorDOMDebuggerAgent::willSendXMLHttpRequest):
+        Don't break for XHRs when breakpoints are disabled.
+
</ins><span class="cx"> 2017-03-09  Michael Saboff  &lt;msaboff@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Add plumbing to WebProcess to enable JavaScriptCore configuration and logging
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorDOMDebuggerAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorDOMDebuggerAgent.cpp (213690 => 213691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorDOMDebuggerAgent.cpp        2017-03-10 00:53:09 UTC (rev 213690)
+++ trunk/Source/WebCore/inspector/InspectorDOMDebuggerAgent.cpp        2017-03-10 00:53:48 UTC (rev 213691)
</span><span class="lines">@@ -114,6 +114,7 @@
</span><span class="cx"> void InspectorDOMDebuggerAgent::discardBindings()
</span><span class="cx"> {
</span><span class="cx">     m_domBreakpoints.clear();
</span><ins>+    m_xhrBreakpoints.clear();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InspectorDOMDebuggerAgent::setEventListenerBreakpoint(ErrorString&amp; error, const String&amp; eventName)
</span><span class="lines">@@ -393,6 +394,9 @@
</span><span class="cx"> 
</span><span class="cx"> void InspectorDOMDebuggerAgent::willSendXMLHttpRequest(const String&amp; url)
</span><span class="cx"> {
</span><ins>+    if (!m_debuggerAgent-&gt;breakpointsActive())
+        return;
+
</ins><span class="cx">     String breakpointURL;
</span><span class="cx">     if (m_pauseOnAllXHRsEnabled)
</span><span class="cx">         breakpointURL = emptyString();
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (213690 => 213691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2017-03-10 00:53:09 UTC (rev 213690)
+++ trunk/Source/WebInspectorUI/ChangeLog        2017-03-10 00:53:48 UTC (rev 213691)
</span><span class="lines">@@ -1,5 +1,127 @@
</span><span class="cx"> 2017-03-09  Matt Baker  &lt;mattbaker@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Web Inspector: Add XHR breakpoints UI
+        https://bugs.webkit.org/show_bug.cgi?id=168763
+        &lt;rdar://problem/30952439&gt;
+
+        Reviewed by Joseph Pecoraro.
+
+        * Localizations/en.lproj/localizedStrings.js:
+        New UI strings.
+
+        * UserInterface/Controllers/DOMDebuggerManager.js:
+        Plumbing for XHR breakpoints. Like DOM breakpoints, they are tracked
+        per-page. Unlike DOM breakpoints, they have no separate &quot;resolved&quot;
+        state, and are simply added/removed as the main frame changes.
+
+        (WebInspector.DOMDebuggerManager):
+        (WebInspector.DOMDebuggerManager.prototype.get allRequestsBreakpoint):
+        (WebInspector.DOMDebuggerManager.prototype.get xhrBreakpoints):
+        (WebInspector.DOMDebuggerManager.prototype.isBreakpointRemovable):
+        (WebInspector.DOMDebuggerManager.prototype.removeDOMBreakpoint):
+        (WebInspector.DOMDebuggerManager.prototype.addXHRBreakpoint):
+        (WebInspector.DOMDebuggerManager.prototype.removeXHRBreakpoint):
+        (WebInspector.DOMDebuggerManager.prototype._speculativelyResolveBreakpoints):
+        (WebInspector.DOMDebuggerManager.prototype._detachXHRBreakpoint):
+        (WebInspector.DOMDebuggerManager.prototype._updateXHRBreakpoint.breakpointUpdated):
+        (WebInspector.DOMDebuggerManager.prototype._updateXHRBreakpoint):
+        (WebInspector.DOMDebuggerManager.prototype._resolveXHRBreakpoint):
+        (WebInspector.DOMDebuggerManager.prototype._saveXHRBreakpoints):
+        (WebInspector.DOMDebuggerManager.prototype._domBreakpointDisabledStateDidChange):
+        (WebInspector.DOMDebuggerManager.prototype._xhrBreakpointDisabledStateDidChange):
+        (WebInspector.DOMDebuggerManager.prototype._mainResourceDidChange):
+        (WebInspector.DOMDebuggerManager.prototype._saveBreakpoints): Deleted.
+        Renamed `saveDOMBreakpoints`.
+
+        * UserInterface/Controllers/DebuggerManager.js:
+        (WebInspector.DebuggerManager.prototype._pauseReasonFromPayload):
+        Plumbing for XHR breakpoint pause reason.
+
+        * UserInterface/Controllers/XHRBreakpointTreeController.js: Added.
+        Creates the &quot;All Requests&quot; breakpoint, handles DOMDebuggerManager messages,
+        and updates an associated tree outline as XHR breakpoints are added and removed.
+
+        (WebInspector.XHRBreakpointTreeController):
+        (WebInspector.XHRBreakpointTreeController.prototype.revealAndSelect):
+        (WebInspector.XHRBreakpointTreeController.prototype.disconnect):
+        (WebInspector.XHRBreakpointTreeController.prototype._xhrBreakpointAdded):
+        (WebInspector.XHRBreakpointTreeController.prototype._xhrBreakpointRemoved):
+        (WebInspector.XHRBreakpointTreeController.prototype._mainResourceDidChange):
+        (WebInspector.XHRBreakpointTreeController.prototype._reset):
+
+        * UserInterface/Main.html:
+        New files.
+
+        * UserInterface/Models/XHRBreakpoint.js: Added.
+        New model class. XHR breakpoints have an associated URL, which is matched
+        against the request URL when deciding whether to break. An empty URL matches
+        all XMLHttpRequests.
+
+        (WebInspector.XHRBreakpoint):
+        (WebInspector.XHRBreakpoint.prototype.get documentURL):
+        (WebInspector.XHRBreakpoint.prototype.get url):
+        (WebInspector.XHRBreakpoint.prototype.get disabled):
+        (WebInspector.XHRBreakpoint.prototype.set disabled):
+        (WebInspector.XHRBreakpoint.prototype.get serializableInfo):
+        (WebInspector.XHRBreakpoint.prototype.saveIdentityToCookie):
+
+        * UserInterface/Test.html:
+        New files.
+
+        * UserInterface/Views/ContentView.js:
+        (WebInspector.ContentView.createFromRepresentedObject):
+        Plumbing for new represented object type, to prevent runtime assertion.
+
+        * UserInterface/Views/DOMBreakpointTreeElement.js:
+        (WebInspector.DOMBreakpointTreeElement):
+        Reuse BreakpointTreeElement styles.
+
+        * UserInterface/Views/DebuggerSidebarPanel.js:
+        (WebInspector.DebuggerSidebarPanel):
+        (WebInspector.DebuggerSidebarPanel.prototype.saveStateToCookie):
+        (WebInspector.DebuggerSidebarPanel.prototype.restoreStateFromCookie):
+        (WebInspector.DebuggerSidebarPanel.prototype._updatePauseReasonSection):
+        (WebInspector.DebuggerSidebarPanel.prototype._addXHRBreakpointButtonClicked):
+        (WebInspector.DebuggerSidebarPanel.prototype.willDismissPopover):
+
+        * UserInterface/Views/InputPopover.css: Added.
+        (.popover .input-popover-content):
+        (.popover .input-popover-content &gt; .editor):
+        (.popover .input-popover-content &gt; .editor &gt; .CodeMirror):
+        (.popover .input-popover-content &gt; .editor &gt; .CodeMirror-scroll):
+
+        * UserInterface/Views/InputPopover.js: Added.
+        New general purpose popover class. Style and structure lifted from
+        the Popover implementation used by the Probe Expressions UI. A follow-up
+        has been filed to switch that UI over to this new class:
+        https://bugs.webkit.org/show_bug.cgi?id=169428.
+
+        (WebInspector.InputPopover):
+        (WebInspector.InputPopover.prototype.get value):
+        (WebInspector.InputPopover.prototype.get result):
+        (WebInspector.InputPopover.prototype.show):
+        (WebInspector.InputPopover.prototype._presentOverTargetElement):
+
+        * UserInterface/Views/XHRBreakpointTreeElement.js: Added.
+        Tree element class for XHR breakpoints. Behaves identically to
+        script and DOM breakpoint tree elements.
+
+        (WebInspector.XHRBreakpointTreeElement):
+        Reuse BreakpointTreeElement styles.
+        (WebInspector.XHRBreakpointTreeElement.prototype.onattach):
+        (WebInspector.XHRBreakpointTreeElement.prototype.ondetach):
+        (WebInspector.XHRBreakpointTreeElement.prototype.ondelete):
+        (WebInspector.XHRBreakpointTreeElement.prototype.onenter):
+        (WebInspector.XHRBreakpointTreeElement.prototype.onspace):
+        (WebInspector.XHRBreakpointTreeElement.prototype.populateContextMenu):
+        (WebInspector.XHRBreakpointTreeElement.prototype._statusImageElementClicked):
+        (WebInspector.XHRBreakpointTreeElement.prototype._statusImageElementFocused):
+        (WebInspector.XHRBreakpointTreeElement.prototype._statusImageElementMouseDown):
+        (WebInspector.XHRBreakpointTreeElement.prototype._toggleBreakpoint):
+        (WebInspector.XHRBreakpointTreeElement.prototype._updateStatus):
+
+2017-03-09  Matt Baker  &lt;mattbaker@apple.com&gt;
+
</ins><span class="cx">         REGRESSION (r196271): Web Inspector: DOM element loses focus/active selection after committing an inline attribute editor in DOMTreeOutline
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=168119
</span><span class="cx">         &lt;rdar://problem/30466013&gt;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUILocalizationsenlprojlocalizedStringsjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (213690 => 213691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2017-03-10 00:53:09 UTC (rev 213690)
+++ trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2017-03-10 00:53:48 UTC (rev 213691)
</span><span class="lines">@@ -64,6 +64,7 @@
</span><span class="cx"> localizedStrings[&quot;Add New&quot;] = &quot;Add New&quot;;
</span><span class="cx"> localizedStrings[&quot;Add New Probe Expression&quot;] = &quot;Add New Probe Expression&quot;;
</span><span class="cx"> localizedStrings[&quot;Add New Watch Expression&quot;] = &quot;Add New Watch Expression&quot;;
</span><ins>+localizedStrings[&quot;Add XHR Breakpoint&quot;] = &quot;Add XHR Breakpoint&quot;;
</ins><span class="cx"> localizedStrings[&quot;Add a Class&quot;] = &quot;Add a Class&quot;;
</span><span class="cx"> localizedStrings[&quot;Add new breakpoint action after this action&quot;] = &quot;Add new breakpoint action after this action&quot;;
</span><span class="cx"> localizedStrings[&quot;Add new rule&quot;] = &quot;Add new rule&quot;;
</span><span class="lines">@@ -75,6 +76,7 @@
</span><span class="cx"> localizedStrings[&quot;All&quot;] = &quot;All&quot;;
</span><span class="cx"> localizedStrings[&quot;All Changes&quot;] = &quot;All Changes&quot;;
</span><span class="cx"> localizedStrings[&quot;All Exceptions&quot;] = &quot;All Exceptions&quot;;
</span><ins>+localizedStrings[&quot;All Requests&quot;] = &quot;All Requests&quot;;
</ins><span class="cx"> localizedStrings[&quot;All Resources&quot;] = &quot;All Resources&quot;;
</span><span class="cx"> localizedStrings[&quot;All Storage&quot;] = &quot;All Storage&quot;;
</span><span class="cx"> localizedStrings[&quot;Alternates&quot;] = &quot;Alternates&quot;;
</span><span class="lines">@@ -124,6 +126,7 @@
</span><span class="cx"> localizedStrings[&quot;Box Model&quot;] = &quot;Box Model&quot;;
</span><span class="cx"> localizedStrings[&quot;Box Shadow&quot;] = &quot;Box Shadow&quot;;
</span><span class="cx"> localizedStrings[&quot;Break on…&quot;] = &quot;Break on…&quot;;
</span><ins>+localizedStrings[&quot;Break when URL contains:&quot;] = &quot;Break when URL contains:&quot;;
</ins><span class="cx"> localizedStrings[&quot;Breakdown&quot;] = &quot;Breakdown&quot;;
</span><span class="cx"> localizedStrings[&quot;Breakdown of each memory category at the end of the selected time range&quot;] = &quot;Breakdown of each memory category at the end of the selected time range&quot;;
</span><span class="cx"> localizedStrings[&quot;Breakpoints&quot;] = &quot;Breakpoints&quot;;
</span><span class="lines">@@ -834,10 +837,12 @@
</span><span class="cx"> localizedStrings[&quot;Transition&quot;] = &quot;Transition&quot;;
</span><span class="cx"> localizedStrings[&quot;Triggered Breakpoint&quot;] = &quot;Triggered Breakpoint&quot;;
</span><span class="cx"> localizedStrings[&quot;Triggered DOM Breakpoint&quot;] = &quot;Triggered DOM Breakpoint&quot;;
</span><ins>+localizedStrings[&quot;Triggered XHR Breakpoint&quot;] = &quot;Triggered XHR Breakpoint&quot;;
</ins><span class="cx"> localizedStrings[&quot;True&quot;] = &quot;True&quot;;
</span><span class="cx"> localizedStrings[&quot;Type&quot;] = &quot;Type&quot;;
</span><span class="cx"> localizedStrings[&quot;Type Issue&quot;] = &quot;Type Issue&quot;;
</span><span class="cx"> localizedStrings[&quot;Type information for variable: %s&quot;] = &quot;Type information for variable: %s&quot;;
</span><ins>+localizedStrings[&quot;URL contains:&quot;] = &quot;URL contains:&quot;;
</ins><span class="cx"> localizedStrings[&quot;Unable to determine path to property from root&quot;] = &quot;Unable to determine path to property from root&quot;;
</span><span class="cx"> localizedStrings[&quot;Uncaught Exceptions&quot;] = &quot;Uncaught Exceptions&quot;;
</span><span class="cx"> localizedStrings[&quot;Unchanged&quot;] = &quot;Unchanged&quot;;
</span><span class="lines">@@ -881,6 +886,7 @@
</span><span class="cx"> localizedStrings[&quot;X1&quot;] = &quot;X1&quot;;
</span><span class="cx"> localizedStrings[&quot;X2&quot;] = &quot;X2&quot;;
</span><span class="cx"> localizedStrings[&quot;XHR&quot;] = &quot;XHR&quot;;
</span><ins>+localizedStrings[&quot;XHR Breakpoints&quot;] = &quot;XHR Breakpoints&quot;;
</ins><span class="cx"> localizedStrings[&quot;XHRs&quot;] = &quot;XHRs&quot;;
</span><span class="cx"> localizedStrings[&quot;Y&quot;] = &quot;Y&quot;;
</span><span class="cx"> localizedStrings[&quot;Y1&quot;] = &quot;Y1&quot;;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersDOMDebuggerManagerjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/DOMDebuggerManager.js (213690 => 213691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/DOMDebuggerManager.js        2017-03-10 00:53:09 UTC (rev 213690)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/DOMDebuggerManager.js        2017-03-10 00:53:48 UTC (rev 213691)
</span><span class="lines">@@ -33,7 +33,15 @@
</span><span class="cx">         this._domBreakpointURLMap = new Map;
</span><span class="cx">         this._domBreakpointFrameIdentifierMap = new Map;
</span><span class="cx"> 
</span><ins>+        this._xhrBreakpointsSetting = new WebInspector.Setting(&quot;xhr-breakpoints&quot;, []);
+        this._xhrBreakpointURLMap = new Map;
+        this._allRequestsBreakpointEnabledSetting = new WebInspector.Setting(&quot;break-on-all-requests&quot;, false);
+
+        const emptyURL = &quot;&quot;;
+        this._allRequestsBreakpoint = new WebInspector.XHRBreakpoint(null, emptyURL, !this._allRequestsBreakpointEnabledSetting.value);
+
</ins><span class="cx">         WebInspector.DOMBreakpoint.addEventListener(WebInspector.DOMBreakpoint.Event.DisabledStateDidChange, this._domBreakpointDisabledStateDidChange, this);
</span><ins>+        WebInspector.XHRBreakpoint.addEventListener(WebInspector.XHRBreakpoint.Event.DisabledStateDidChange, this._xhrBreakpointDisabledStateDidChange, this);
</ins><span class="cx"> 
</span><span class="cx">         WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.NodeRemoved, this._nodeRemoved, this);
</span><span class="cx">         WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.NodeInserted, this._nodeInserted, this);
</span><span class="lines">@@ -51,6 +59,11 @@
</span><span class="cx">                 this.addDOMBreakpoint(breakpoint);
</span><span class="cx">             }
</span><span class="cx"> 
</span><ins>+            for (let cookie of this._xhrBreakpointsSetting.value) {
+                let breakpoint = new WebInspector.XHRBreakpoint(cookie.documentURL, cookie.url, cookie.disabled);
+                this.addXHRBreakpoint(breakpoint);
+            }
+
</ins><span class="cx">             this._restoringBreakpoints = false;
</span><span class="cx">             this._speculativelyResolveBreakpoints();
</span><span class="cx">         }
</span><span class="lines">@@ -63,6 +76,8 @@
</span><span class="cx">         return !!window.DOMDebuggerAgent;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    get allRequestsBreakpoint() { return this._allRequestsBreakpoint; }
+
</ins><span class="cx">     get domBreakpoints()
</span><span class="cx">     {
</span><span class="cx">         let mainFrame = WebInspector.frameResourceManager.mainFrame;
</span><span class="lines">@@ -85,6 +100,24 @@
</span><span class="cx">         return resolvedBreakpoints;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    get xhrBreakpoints()
+    {
+        let mainFrame = WebInspector.frameResourceManager.mainFrame;
+        if (!mainFrame)
+            return [];
+
+        let breakpoints = this._xhrBreakpointURLMap.get(mainFrame.url)
+        if (!breakpoints)
+            return [];
+
+        return breakpoints.slice();
+    }
+
+    isBreakpointRemovable(breakpoint)
+    {
+        return breakpoint !== this._allRequestsBreakpoint;
+    }
+
</ins><span class="cx">     domBreakpointsForNode(node)
</span><span class="cx">     {
</span><span class="cx">         console.assert(node instanceof WebInspector.DOMNode);
</span><span class="lines">@@ -148,9 +181,47 @@
</span><span class="cx"> 
</span><span class="cx">         breakpoint.domNodeIdentifier = null;
</span><span class="cx"> 
</span><del>-        this._saveBreakpoints();
</del><ins>+        this._saveDOMBreakpoints();
</ins><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    addXHRBreakpoint(breakpoint)
+    {
+        console.assert(breakpoint instanceof WebInspector.XHRBreakpoint);
+        if (!breakpoint || !breakpoint.documentURL)
+            return;
+
+        let url = breakpoint.documentURL;
+        let breakpoints = this._xhrBreakpointURLMap.get(url);
+        if (!breakpoints) {
+            breakpoints = [breakpoint];
+            this._xhrBreakpointURLMap.set(url, breakpoints);
+        } else
+            breakpoints.push(breakpoint);
+
+        this._resolveXHRBreakpoint(breakpoint);
+        this._saveXHRBreakpoints();
+    }
+
+    removeXHRBreakpoint(breakpoint)
+    {
+        console.assert(breakpoint instanceof WebInspector.XHRBreakpoint);
+        if (!breakpoint)
+            return;
+
+        let url = breakpoint.documentURL;
+        let breakpoints = this._xhrBreakpointURLMap.get(url);
+        breakpoints.remove(breakpoint, true);
+
+        this._detachXHRBreakpoint(breakpoint);
+
+        if (!breakpoints.length)
+            this._xhrBreakpointURLMap.delete(url);
+
+        this.dispatchEventToListeners(WebInspector.DOMDebuggerManager.Event.DOMBreakpointRemoved, {breakpoint});
+
+        this._saveXHRBreakpoints();
+    }
+
</ins><span class="cx">     // Private
</span><span class="cx"> 
</span><span class="cx">     _detachDOMBreakpoint(breakpoint)
</span><span class="lines">@@ -203,20 +274,25 @@
</span><span class="cx">         if (!mainFrame)
</span><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        let breakpoints = this._domBreakpointURLMap.get(mainFrame.url);
-        if (!breakpoints)
-            return;
</del><ins>+        let domBreakpoints = this._domBreakpointURLMap.get(mainFrame.url);
+        if (domBreakpoints) {
+            for (let breakpoint of domBreakpoints) {
+                if (breakpoint.domNodeIdentifier)
+                    continue;
</ins><span class="cx"> 
</span><del>-        for (let breakpoint of breakpoints) {
-            if (breakpoint.domNodeIdentifier)
-                continue;
</del><ins>+                WebInspector.domTreeManager.pushNodeByPathToFrontend(breakpoint.path, (nodeIdentifier) =&gt; {
+                    if (!nodeIdentifier)
+                        return;
</ins><span class="cx"> 
</span><del>-            WebInspector.domTreeManager.pushNodeByPathToFrontend(breakpoint.path, (nodeIdentifier) =&gt; {
-                if (!nodeIdentifier)
-                    return;
</del><ins>+                    this._resolveDOMBreakpoint(breakpoint, nodeIdentifier);
+                });
+            }
+        }
</ins><span class="cx"> 
</span><del>-                this._resolveDOMBreakpoint(breakpoint, nodeIdentifier);
-            });
</del><ins>+        let xhrBreakpoints = this._xhrBreakpointURLMap.get(mainFrame.url);
+        if (xhrBreakpoints) {
+            for (let breakpoint of xhrBreakpoints)
+                this._resolveXHRBreakpoint(breakpoint);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -263,8 +339,48 @@
</span><span class="cx">             DOMDebuggerAgent.setDOMBreakpoint(nodeIdentifier, breakpoint.type, breakpointUpdated);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    _saveBreakpoints()
</del><ins>+    _detachXHRBreakpoint(breakpoint)
</ins><span class="cx">     {
</span><ins>+        if (breakpoint.disabled)
+            return;
+
+        DOMDebuggerAgent.removeXHRBreakpoint(breakpoint.url, (error) =&gt; {
+            if (error)
+                console.error(error);
+
+            this.dispatchEventToListeners(WebInspector.DOMDebuggerManager.Event.XHRBreakpointRemoved, {breakpoint});
+        });
+    }
+
+    _updateXHRBreakpoint(breakpoint, callback)
+    {
+        function breakpointUpdated(error)
+        {
+            if (error)
+                console.error(error);
+
+            if (callback &amp;&amp; typeof callback === &quot;function&quot;)
+                callback(error);
+        }
+
+        if (breakpoint.disabled)
+            DOMDebuggerAgent.removeXHRBreakpoint(breakpoint.url, breakpointUpdated);
+        else
+            DOMDebuggerAgent.setXHRBreakpoint(breakpoint.url, breakpointUpdated);
+    }
+
+    _resolveXHRBreakpoint(breakpoint)
+    {
+        if (breakpoint.disabled)
+            return;
+
+        this._updateXHRBreakpoint(breakpoint, () =&gt; {
+            this.dispatchEventToListeners(WebInspector.DOMDebuggerManager.Event.XHRBreakpointAdded, {breakpoint});
+        });
+    }
+
+    _saveDOMBreakpoints()
+    {
</ins><span class="cx">         if (this._restoringBreakpoints)
</span><span class="cx">             return;
</span><span class="cx"> 
</span><span class="lines">@@ -275,13 +391,36 @@
</span><span class="cx">         this._domBreakpointsSetting.value = breakpointsToSave.map((breakpoint) =&gt; breakpoint.serializableInfo);
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    _saveXHRBreakpoints()
+    {
+        if (this._restoringBreakpoints)
+            return;
+
+        let breakpointsToSave = [];
+        for (let breakpoints of this._xhrBreakpointURLMap.values())
+            breakpointsToSave = breakpointsToSave.concat(breakpoints);
+
+        this._xhrBreakpointsSetting.value = breakpointsToSave.map((breakpoint) =&gt; breakpoint.serializableInfo);
+    }
+
</ins><span class="cx">     _domBreakpointDisabledStateDidChange(event)
</span><span class="cx">     {
</span><span class="cx">         let breakpoint = event.target;
</span><span class="cx">         this._updateDOMBreakpoint(breakpoint);
</span><del>-        this._saveBreakpoints();
</del><ins>+        this._saveDOMBreakpoints();
</ins><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    _xhrBreakpointDisabledStateDidChange(event)
+    {
+        let breakpoint = event.target;
+
+        if (breakpoint === this._allRequestsBreakpoint)
+            this._allRequestsBreakpointEnabledSetting.value = !breakpoint.disabled;
+
+        this._updateXHRBreakpoint(breakpoint);
+        this._saveXHRBreakpoints();
+    }
+
</ins><span class="cx">     _childFrameWasRemoved(event)
</span><span class="cx">     {
</span><span class="cx">         let frame = event.data.childFrame;
</span><span class="lines">@@ -301,6 +440,12 @@
</span><span class="cx">                 breakpoints.forEach((breakpoint) =&gt; { breakpoint.domNodeIdentifier = null; });
</span><span class="cx"> 
</span><span class="cx">             this._domBreakpointFrameIdentifierMap.clear();
</span><ins>+
+            let xhrBreakpoints = this._xhrBreakpointURLMap.get(frame.url);
+            if (xhrBreakpoints) {
+                for (let breakpoint of xhrBreakpoints)
+                    this._detachXHRBreakpoint(breakpoint);
+            }
</ins><span class="cx">         } else
</span><span class="cx">             this._detachBreakpointsForFrame(frame);
</span><span class="cx"> 
</span><span class="lines">@@ -356,4 +501,6 @@
</span><span class="cx"> WebInspector.DOMDebuggerManager.Event = {
</span><span class="cx">     DOMBreakpointAdded: &quot;dom-debugger-manager-dom-breakpoint-added&quot;,
</span><span class="cx">     DOMBreakpointRemoved: &quot;dom-debugger-manager-dom-breakpoint-removed&quot;,
</span><ins>+    XHRBreakpointAdded: &quot;dom-debugger-manager-xhr-breakpoint-added&quot;,
+    XHRBreakpointRemoved: &quot;dom-debugger-manager-xhr-breakpoint-removed&quot;,
</ins><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersDebuggerManagerjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js (213690 => 213691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js        2017-03-10 00:53:09 UTC (rev 213690)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js        2017-03-10 00:53:48 UTC (rev 213691)
</span><span class="lines">@@ -815,6 +815,8 @@
</span><span class="cx">             return WebInspector.DebuggerManager.PauseReason.Exception;
</span><span class="cx">         case DebuggerAgent.PausedReason.PauseOnNextStatement:
</span><span class="cx">             return WebInspector.DebuggerManager.PauseReason.PauseOnNextStatement;
</span><ins>+        case DebuggerAgent.PausedReason.XHR:
+            return WebInspector.DebuggerManager.PauseReason.XHR;
</ins><span class="cx">         default:
</span><span class="cx">             return WebInspector.DebuggerManager.PauseReason.Other;
</span><span class="cx">         }
</span><span class="lines">@@ -1228,5 +1230,6 @@
</span><span class="cx">     DOM: &quot;DOM&quot;,
</span><span class="cx">     Exception: &quot;exception&quot;,
</span><span class="cx">     PauseOnNextStatement: &quot;pause-on-next-statement&quot;,
</span><ins>+    XHR: &quot;xhr&quot;,
</ins><span class="cx">     Other: &quot;other&quot;,
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersXHRBreakpointTreeControllerjs"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Controllers/XHRBreakpointTreeController.js (0 => 213691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/XHRBreakpointTreeController.js                                (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/XHRBreakpointTreeController.js        2017-03-10 00:53:48 UTC (rev 213691)
</span><span class="lines">@@ -0,0 +1,92 @@
</span><ins>+/*
+ * Copyright (C) 2017 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.XHRBreakpointTreeController = class XHRBreakpointsTreeController extends WebInspector.Object
+{
+    constructor(treeOutline)
+    {
+        super();
+
+        this._treeOutline = treeOutline;
+
+        WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this);
+
+        WebInspector.domDebuggerManager.addEventListener(WebInspector.DOMDebuggerManager.Event.XHRBreakpointAdded, this._xhrBreakpointAdded, this);
+        WebInspector.domDebuggerManager.addEventListener(WebInspector.DOMDebuggerManager.Event.XHRBreakpointRemoved, this._xhrBreakpointRemoved, this);
+
+        this._allReqestsBreakpointTreeElement = new WebInspector.XHRBreakpointTreeElement(WebInspector.domDebuggerManager.allRequestsBreakpoint, WebInspector.DebuggerSidebarPanel.AssertionIconStyleClassName, WebInspector.UIString(&quot;All Requests&quot;));
+
+        this._treeOutline.appendChild(this._allReqestsBreakpointTreeElement);
+    }
+
+    // Public
+
+    revealAndSelect(breakpoint)
+    {
+        let treeElement = this._treeOutline.findTreeElement(breakpoint);
+        if (!treeElement)
+            return;
+
+        treeElement.revealAndSelect();
+    }
+
+    disconnect()
+    {
+        WebInspector.Frame.removeEventListener(null, null, this);
+        WebInspector.domDebuggerManager.removeEventListener(null, null, this);
+    }
+
+    // Private
+
+    _xhrBreakpointAdded(event)
+    {
+        let breakpoint = event.data.breakpoint;
+        let treeElement = this._treeOutline.findTreeElement(breakpoint);
+        console.assert(!treeElement);
+        if (treeElement)
+            return;
+
+        this._treeOutline.appendChild(new WebInspector.XHRBreakpointTreeElement(breakpoint));
+    }
+
+    _xhrBreakpointRemoved(event)
+    {
+        let breakpoint = event.data.breakpoint;
+        let treeElement = this._treeOutline.findTreeElement(breakpoint);
+        if (!treeElement)
+            return;
+
+        this._treeOutline.removeChild(treeElement);
+    }
+
+    _mainResourceDidChange(event)
+    {
+        if (!event.target.isMainFrame())
+            return;
+
+        while (this._treeOutline.children.length &gt; 1)
+            this._treeOutline.removeChild(this._treeOutline.children.lastValue);
+    }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceMainhtml"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Main.html (213690 => 213691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Main.html        2017-03-10 00:53:09 UTC (rev 213690)
+++ trunk/Source/WebInspectorUI/UserInterface/Main.html        2017-03-10 00:53:48 UTC (rev 213691)
</span><span class="lines">@@ -64,7 +64,6 @@
</span><span class="cx">     &lt;link rel=&quot;stylesheet&quot; href=&quot;Views/ControlToolbarItem.css&quot;&gt;
</span><span class="cx">     &lt;link rel=&quot;stylesheet&quot; href=&quot;Views/CookieIcon.css&quot;&gt;
</span><span class="cx">     &lt;link rel=&quot;stylesheet&quot; href=&quot;Views/CookieStorageContentView.css&quot;&gt;
</span><del>-    &lt;link rel=&quot;stylesheet&quot; href=&quot;Views/DOMBreakpointTreeElement.css&quot;&gt;
</del><span class="cx">     &lt;link rel=&quot;stylesheet&quot; href=&quot;Views/DOMStorageContentView.css&quot;&gt;
</span><span class="cx">     &lt;link rel=&quot;stylesheet&quot; href=&quot;Views/DOMStorageIcons.css&quot;&gt;
</span><span class="cx">     &lt;link rel=&quot;stylesheet&quot; href=&quot;Views/DOMTreeContentView.css&quot;&gt;
</span><span class="lines">@@ -103,6 +102,7 @@
</span><span class="cx">     &lt;link rel=&quot;stylesheet&quot; href=&quot;Views/IndeterminateProgressSpinner.css&quot;&gt;
</span><span class="cx">     &lt;link rel=&quot;stylesheet&quot; href=&quot;Views/IndexedDatabaseObjectStoreContentView.css&quot;&gt;
</span><span class="cx">     &lt;link rel=&quot;stylesheet&quot; href=&quot;Views/InlineSwatch.css&quot;&gt;
</span><ins>+    &lt;link rel=&quot;stylesheet&quot; href=&quot;Views/InputPopover.css&quot;&gt;
</ins><span class="cx">     &lt;link rel=&quot;stylesheet&quot; href=&quot;Views/IssueTreeElement.css&quot;&gt;
</span><span class="cx">     &lt;link rel=&quot;stylesheet&quot; href=&quot;Views/LayerTreeDetailsSidebarPanel.css&quot;&gt;
</span><span class="cx">     &lt;link rel=&quot;stylesheet&quot; href=&quot;Views/LayoutTimelineOverviewGraph.css&quot;&gt;
</span><span class="lines">@@ -402,6 +402,7 @@
</span><span class="cx">     &lt;script src=&quot;Models/TypeSet.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Models/WebSocketResource.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Models/WrappedPromise.js&quot;&gt;&lt;/script&gt;
</span><ins>+    &lt;script src=&quot;Models/XHRBreakpoint.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> 
</span><span class="cx">     &lt;script src=&quot;Proxies/FormatterWorkerProxy.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Proxies/HeapSnapshotDiffProxy.js&quot;&gt;&lt;/script&gt;
</span><span class="lines">@@ -421,6 +422,7 @@
</span><span class="cx">     &lt;script src=&quot;Views/Dialog.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Views/HierarchicalPathComponent.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Views/NavigationItem.js&quot;&gt;&lt;/script&gt;
</span><ins>+    &lt;script src=&quot;Views/Popover.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx">     &lt;script src=&quot;Views/SidebarPanel.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Views/StyleDetailsPanel.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Views/TabBar.js&quot;&gt;&lt;/script&gt;
</span><span class="lines">@@ -582,6 +584,7 @@
</span><span class="cx">     &lt;script src=&quot;Views/IndexedDatabaseObjectStoreTreeElement.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Views/IndexedDatabaseTreeElement.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Views/InlineSwatch.js&quot;&gt;&lt;/script&gt;
</span><ins>+    &lt;script src=&quot;Views/InputPopover.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx">     &lt;script src=&quot;Views/IssueTreeElement.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Views/LayerTreeDataGridNode.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Views/LayerTreeDetailsSidebarPanel.js&quot;&gt;&lt;/script&gt;
</span><span class="lines">@@ -610,7 +613,6 @@
</span><span class="cx">     &lt;script src=&quot;Views/ObjectTreeView.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Views/OpenResourceDialog.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Views/OverviewTimelineView.js&quot;&gt;&lt;/script&gt;
</span><del>-    &lt;script src=&quot;Views/Popover.js&quot;&gt;&lt;/script&gt;
</del><span class="cx">     &lt;script src=&quot;Views/ProbeDetailsSidebarPanel.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Views/ProbeSetDataGrid.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Views/ProbeSetDataGridNode.js&quot;&gt;&lt;/script&gt;
</span><span class="lines">@@ -681,6 +683,7 @@
</span><span class="cx">     &lt;script src=&quot;Views/TypeTreeView.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Views/WebSocketContentView.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Views/WorkerTreeElement.js&quot;&gt;&lt;/script&gt;
</span><ins>+    &lt;script src=&quot;Views/XHRBreakpointTreeElement.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> 
</span><span class="cx">     &lt;script src=&quot;Views/VisualStyleDetailsPanel.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Views/VisualStylePropertyEditor.js&quot;&gt;&lt;/script&gt;
</span><span class="lines">@@ -750,6 +753,7 @@
</span><span class="cx">     &lt;script src=&quot;Controllers/TypeTokenAnnotator.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Controllers/VisualStyleCompletionsController.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Controllers/WorkerManager.js&quot;&gt;&lt;/script&gt;
</span><ins>+    &lt;script src=&quot;Controllers/XHRBreakpointTreeController.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> 
</span><span class="cx">     &lt;script src=&quot;Workers/Formatter/FormatterContentBuilder.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsXHRBreakpointjs"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Models/XHRBreakpoint.js (0 => 213691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/XHRBreakpoint.js                                (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/XHRBreakpoint.js        2017-03-10 00:53:48 UTC (rev 213691)
</span><span class="lines">@@ -0,0 +1,79 @@
</span><ins>+/*
+ * Copyright (C) 2017 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.XHRBreakpoint = class XHRBreakpoint extends WebInspector.Object
+{
+    constructor(documentURL, url, disabled)
+    {
+        super();
+
+        this._documentURL = documentURL;
+        this._url = url;
+        this._disabled = disabled || false;
+    }
+
+    // Public
+
+    get documentURL() { return this._documentURL; }
+    get url() { return this._url; }
+
+    get disabled()
+    {
+        return this._disabled;
+    }
+
+    set disabled(disabled)
+    {
+        if (this._disabled === disabled)
+            return;
+
+        this._disabled = disabled;
+
+        this.dispatchEventToListeners(WebInspector.XHRBreakpoint.Event.DisabledStateDidChange);
+    }
+
+    get serializableInfo()
+    {
+        let info = {documentURL: this._documentURL, url: this._url};
+        if (this._disabled)
+            info.disabled = true;
+
+        return info;
+    }
+
+    saveIdentityToCookie(cookie)
+    {
+        cookie[WebInspector.XHRBreakpoint.DocumentURLCookieKey] = this._documentURL;
+        cookie[WebInspector.XHRBreakpoint.URLCookieKey] = this._url;
+    }
+};
+
+WebInspector.XHRBreakpoint.DocumentURLCookieKey = &quot;xhr-breakpoint-document-url&quot;;
+WebInspector.XHRBreakpoint.URLCookieKey = &quot;xhr-breakpoint-url&quot;;
+
+WebInspector.XHRBreakpoint.Event = {
+    DisabledStateDidChange: &quot;xhr-breakpoint-disabled-state-did-change&quot;,
+    ResolvedStateDidChange: &quot;xhr-breakpoint-resolved-state-did-change&quot;,
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTesthtml"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Test.html (213690 => 213691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Test.html        2017-03-10 00:53:09 UTC (rev 213690)
+++ trunk/Source/WebInspectorUI/UserInterface/Test.html        2017-03-10 00:53:48 UTC (rev 213691)
</span><span class="lines">@@ -174,6 +174,7 @@
</span><span class="cx">     &lt;script src=&quot;Models/TimelineRecording.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Models/WebSocketResource.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Models/WrappedPromise.js&quot;&gt;&lt;/script&gt;
</span><ins>+    &lt;script src=&quot;Models/XHRBreakpoint.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> 
</span><span class="cx">     &lt;script src=&quot;Proxies/FormatterWorkerProxy.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Proxies/HeapSnapshotDiffProxy.js&quot;&gt;&lt;/script&gt;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsContentViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ContentView.js (213690 => 213691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ContentView.js        2017-03-10 00:53:09 UTC (rev 213690)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ContentView.js        2017-03-10 00:53:48 UTC (rev 213691)
</span><span class="lines">@@ -126,6 +126,9 @@
</span><span class="cx">                 return WebInspector.ContentView.createFromRepresentedObject(representedObject.domNode, extraArguments);
</span><span class="cx">         }
</span><span class="cx"> 
</span><ins>+        if (representedObject instanceof WebInspector.XHRBreakpoint)
+            return WebInspector.ContentView.createFromRepresentedObject(WebInspector.frameResourceManager.mainFrame.domTree, extraArguments);
+
</ins><span class="cx">         if (representedObject instanceof WebInspector.SourceCodeSearchMatchObject) {
</span><span class="cx">             var resultView;
</span><span class="cx">             if (representedObject.sourceCode instanceof WebInspector.Resource)
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDOMBreakpointTreeElementcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/Views/DOMBreakpointTreeElement.css (213690 => 213691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMBreakpointTreeElement.css        2017-03-10 00:53:09 UTC (rev 213690)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMBreakpointTreeElement.css        2017-03-10 00:53:48 UTC (rev 213691)
</span><span class="lines">@@ -1,43 +0,0 @@
</span><del>-/*
- * Copyright (C) 2017 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.
- */
-
-.item.dom-breakpoint .icon {
-    content: url(../Images/ResultLine.svg);
-}
-
-.item.dom-breakpoint.breakpoint-paused-icon .icon {
-    content: url(../Images/PausedBreakpoint.svg);
-}
-
-.item.dom-breakpoint .status img {
-    content: url(../Images/BreakpointButton.svg);
-    width: 21px;
-    height: 12px;
-    margin-top: 3px;
-}
-
-.item.dom-breakpoint .status &gt; img.disabled {
-    opacity: 0.35;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDOMBreakpointTreeElementjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DOMBreakpointTreeElement.js (213690 => 213691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMBreakpointTreeElement.js        2017-03-10 00:53:09 UTC (rev 213690)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMBreakpointTreeElement.js        2017-03-10 00:53:48 UTC (rev 213691)
</span><span class="lines">@@ -35,10 +35,10 @@
</span><span class="cx">         if (!title)
</span><span class="cx">             title = WebInspector.DOMBreakpointTreeElement.displayNameForType(breakpoint.type);
</span><span class="cx"> 
</span><del>-        super([&quot;dom-breakpoint&quot;, className], title, null, breakpoint);
</del><ins>+        super([&quot;breakpoint&quot;, className], title, null, breakpoint);
</ins><span class="cx"> 
</span><span class="cx">         this._statusImageElement = document.createElement(&quot;img&quot;);
</span><del>-        this._statusImageElement.classList.add(&quot;status-image&quot;);
</del><ins>+        this._statusImageElement.classList.add(&quot;status-image&quot;, &quot;resolved&quot;);
</ins><span class="cx">         this.status = this._statusImageElement;
</span><span class="cx"> 
</span><span class="cx">         breakpoint.addEventListener(WebInspector.DOMBreakpoint.Event.DisabledStateDidChange, this._updateStatus, this);
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDebuggerSidebarPanelcss"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.css (213690 => 213691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.css        2017-03-10 00:53:09 UTC (rev 213690)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.css        2017-03-10 00:53:48 UTC (rev 213691)
</span><span class="lines">@@ -103,3 +103,22 @@
</span><span class="cx"> .sidebar &gt; .panel.navigation.debugger .details-section.dom-breakpoints .item.dom-node .icon {
</span><span class="cx">     content: url(../Images/DOMElement.svg);
</span><span class="cx"> }
</span><ins>+
+.sidebar &gt; .panel.navigation.debugger .details-section.xhr-breakpoints .item.breakpoint .subtitle:before {
+    content: &quot;&quot;;
+}
+
+.sidebar &gt; .panel.navigation.debugger .details-section.xhr-breakpoints .item.breakpoint .subtitle {
+    padding-left: 5px;
+    font-family: Menlo, monospace;
+
+    --subtitle-padding-start: 6px;
+}
+
+body[dir=ltr] .sidebar &gt; .panel.navigation.debugger .details-section.xhr-breakpoints .item.breakpoint .subtitle {
+    padding-left: var(--subtitle-padding-start);
+}
+
+body[dir=rtl] .sidebar &gt; .panel.navigation.debugger .details-section.xhr-breakpoints .item.breakpoint .subtitle {
+    padding-right: var(--subtitle-padding-start);
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDebuggerSidebarPaneljs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js (213690 => 213691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js        2017-03-10 00:53:09 UTC (rev 213690)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js        2017-03-10 00:53:48 UTC (rev 213691)
</span><span class="lines">@@ -179,6 +179,24 @@
</span><span class="cx">             let domBreakpointsGroup = new WebInspector.DetailsSectionGroup([this._domBreakpointsRow]);
</span><span class="cx">             let domBreakpointsSection = new WebInspector.DetailsSection(&quot;dom-breakpoints&quot;, WebInspector.UIString(&quot;DOM Breakpoints&quot;), [domBreakpointsGroup]);
</span><span class="cx">             this.contentView.element.appendChild(domBreakpointsSection.element);
</span><ins>+
+            this._xhrBreakpointsContentTreeOutline = this.createContentTreeOutline(true);
+            this._xhrBreakpointTreeController = new WebInspector.XHRBreakpointTreeController(this._xhrBreakpointsContentTreeOutline);
+
+            this._xhrBreakpointsRow = new WebInspector.DetailsSectionRow;
+            this._xhrBreakpointsRow.element.appendChild(this._xhrBreakpointsContentTreeOutline.element);
+
+            let navigationBar = new WebInspector.NavigationBar;
+            let navigationBarWrapper = document.createElement(&quot;div&quot;);
+            navigationBarWrapper.appendChild(navigationBar.element);
+
+            let addXHRBreakpointButton = new WebInspector.ButtonNavigationItem(&quot;add-xhr-breakpoint&quot;, WebInspector.UIString(&quot;Add XHR Breakpoint&quot;), &quot;Images/Plus13.svg&quot;, 13, 13);
+            addXHRBreakpointButton.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._addXHRBreakpointButtonClicked, this);
+            navigationBar.addNavigationItem(addXHRBreakpointButton);
+
+            let xhrBreakpointsGroup = new WebInspector.DetailsSectionGroup([this._xhrBreakpointsRow]);
+            let xhrBreakpointsSection = new WebInspector.DetailsSection(&quot;xhr-breakpoints&quot;, WebInspector.UIString(&quot;XHR Breakpoints&quot;), [xhrBreakpointsGroup], navigationBarWrapper);
+            this.contentView.element.appendChild(xhrBreakpointsSection.element);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         this._scriptsContentTreeOutline = this.createContentTreeOutline();
</span><span class="lines">@@ -329,6 +347,11 @@
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><ins>+        if (representedObject === WebInspector.domDebuggerManager.allRequestsBreakpoint) {
+            cookie[WebInspector.DebuggerSidebarPanel.SelectedAllRequestsCookieKey] = true;
+            return;
+        }
+
</ins><span class="cx">         super.saveStateToCookie(cookie);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -343,6 +366,8 @@
</span><span class="cx">             this._allUncaughtExceptionsBreakpointTreeElement.revealAndSelect();
</span><span class="cx">         else if (cookie[WebInspector.DebuggerSidebarPanel.SelectedAssertionsCookieKey])
</span><span class="cx">             this._assertionsBreakpointTreeElement.revealAndSelect();
</span><ins>+        else if (cookie[WebInspector.DebuggerSidebarPanel.SelectedAllRequestsCookieKey])
+            this._xhrBreakpointTreeController.revealAndSelect(WebInspector.domDebuggerManager.allRequestsBreakpoint);
</ins><span class="cx">         else
</span><span class="cx">             super.restoreStateFromCookie(cookie, relaxedMatchDelay);
</span><span class="cx">     }
</span><span class="lines">@@ -975,6 +1000,36 @@
</span><span class="cx">             this._pauseReasonGroup.rows = [this._pauseReasonTextRow];
</span><span class="cx">             return true;
</span><span class="cx"> 
</span><ins>+        case WebInspector.DebuggerManager.PauseReason.XHR:
+            console.assert(WebInspector.domDebuggerManager.supported);
+            console.assert(pauseData, &quot;Expected XHR breakpoint data, but found none.&quot;);
+            if (pauseData &amp;&amp; pauseData.breakpointURL) {
+                let xhrBreakpoints = WebInspector.domDebuggerManager.xhrBreakpoints;
+                let xhrBreakpoint;
+                for (let breakpoint of xhrBreakpoints) {
+                    if (breakpoint.url === pauseData.breakpointURL) {
+                        xhrBreakpoint = breakpoint;
+                        break;
+                    }
+                }
+
+                if (!xhrBreakpoint)
+                    return;
+
+                this._pauseReasonTreeOutline = this.createContentTreeOutline(true, true);
+
+                let xhrBreakpointTreeElement = new WebInspector.XHRBreakpointTreeElement(xhrBreakpoint, WebInspector.DebuggerSidebarPanel.PausedBreakpointIconStyleClassName, WebInspector.UIString(&quot;Triggered XHR Breakpoint&quot;));
+                let xhrBreakpointRow = new WebInspector.DetailsSectionRow;
+                this._pauseReasonTreeOutline.appendChild(xhrBreakpointTreeElement);
+                xhrBreakpointRow.element.appendChild(this._pauseReasonTreeOutline.element);
+
+                this._pauseReasonTextRow.text = pauseData.url;
+                this._pauseReasonGroup.rows = [xhrBreakpointRow, this._pauseReasonTextRow];
+
+                return true;
+            }
+            break;
+
</ins><span class="cx">         case WebInspector.DebuggerManager.PauseReason.Other:
</span><span class="cx">             console.error(&quot;Paused for unknown reason. We should always have a reason.&quot;);
</span><span class="cx">             break;
</span><span class="lines">@@ -1067,6 +1122,27 @@
</span><span class="cx">         this._domBreakpointsRow.hideEmptyMessage();
</span><span class="cx">         this._domBreakpointsRow.element.append(this._domBreakpointsContentTreeOutline.element);
</span><span class="cx">     }
</span><ins>+
+    _addXHRBreakpointButtonClicked(event)
+    {
+        let popover = new WebInspector.InputPopover(WebInspector.UIString(&quot;Break when URL contains:&quot;), this);
+        popover.show(event.target.element, [WebInspector.RectEdge.MAX_Y, WebInspector.RectEdge.MIN_Y, WebInspector.RectEdge.MAX_X]);
+    }
+
+    // Popover delegate
+
+    willDismissPopover(popover)
+    {
+        if (popover.result !== WebInspector.InputPopover.Result.Committed)
+            return;
+
+        let url = popover.value;
+        if (!url)
+            return;
+
+        let documentURL = WebInspector.frameResourceManager.mainFrame.url;
+        WebInspector.domDebuggerManager.addXHRBreakpoint(new WebInspector.XHRBreakpoint(documentURL, url));
+    }
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> WebInspector.DebuggerSidebarPanel.DebuggerPausedStyleClassName = &quot;paused&quot;;
</span><span class="lines">@@ -1077,3 +1153,4 @@
</span><span class="cx"> WebInspector.DebuggerSidebarPanel.SelectedAllExceptionsCookieKey = &quot;debugger-sidebar-panel-all-exceptions-breakpoint&quot;;
</span><span class="cx"> WebInspector.DebuggerSidebarPanel.SelectedAllUncaughtExceptionsCookieKey = &quot;debugger-sidebar-panel-all-uncaught-exceptions-breakpoint&quot;;
</span><span class="cx"> WebInspector.DebuggerSidebarPanel.SelectedAssertionsCookieKey = &quot;debugger-sidebar-panel-assertions-breakpoint&quot;;
</span><ins>+WebInspector.DebuggerSidebarPanel.SelectedAllRequestsCookieKey = &quot;debugger-sidebar-panel-all-requests-breakpoint&quot;;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsInputPopovercssfromrev213690trunkSourceWebInspectorUIUserInterfaceViewsDOMBreakpointTreeElementcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/InputPopover.css (from rev 213690, trunk/Source/WebInspectorUI/UserInterface/Views/DOMBreakpointTreeElement.css) (0 => 213691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/InputPopover.css                                (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/InputPopover.css        2017-03-10 00:53:48 UTC (rev 213691)
</span><span class="lines">@@ -0,0 +1,48 @@
</span><ins>+/*
+ * Copyright (C) 2017 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.
+ */
+
+.popover .input-popover-content {
+    padding: 5px;
+    margin: 2px;
+}
+
+.popover .input-popover-content &gt; .editor {
+    width: 200px;
+    margin-top: 5px;
+    padding: 4px 0 2px 0;
+    -webkit-appearance: textfield;
+    border: 1px solid hsl(0, 0%, 78%);
+    background: white;
+}
+
+.popover .input-popover-content &gt; .editor &gt; .CodeMirror {
+    width: calc(100% - 2px);
+    height: auto;
+}
+
+.popover .input-popover-content &gt; .editor &gt; .CodeMirror-scroll {
+    width: calc(100% - 2px);
+    overflow: hidden;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsInputPopoverjs"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Views/InputPopover.js (0 => 213691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/InputPopover.js                                (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/InputPopover.js        2017-03-10 00:53:48 UTC (rev 213691)
</span><span class="lines">@@ -0,0 +1,97 @@
</span><ins>+/*
+ * Copyright (C) 2017 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.InputPopover = class InputPopover extends WebInspector.Popover
+{
+    constructor(message, delegate)
+    {
+        super(delegate);
+
+        this._message = message;
+        this._value = null;
+        this._result = WebInspector.InputPopover.Result.None;
+
+        this._targetElement = null;
+        this._preferredEdges = null;
+
+        this.windowResizeHandler = this._presentOverTargetElement.bind(this);
+    }
+
+    get value() { return this._value; }
+    get result() { return this._result; }
+
+    show(targetElement, preferredEdges)
+    {
+        this._targetElement = targetElement;
+        this._preferredEdges = preferredEdges;
+
+        let contentElement = document.createElement(&quot;div&quot;);
+        contentElement.classList.add(&quot;input-popover-content&quot;);
+
+        if (this._message) {
+            let label = document.createElement(&quot;div&quot;);
+            label.classList.add(&quot;label&quot;);
+            label.textContent = this._message;
+            contentElement.appendChild(label);
+        }
+
+        this._inputElement = document.createElement(&quot;input&quot;);
+        this._inputElement.type = &quot;text&quot;;
+
+        this._inputElement.addEventListener(&quot;keydown&quot;, (event) =&gt; {
+            if (!isEnterKey(event))
+                return;
+
+            this._result = WebInspector.InputPopover.Result.Committed;
+            this._value = event.target.value;
+
+            this.dismiss();
+        });
+
+        contentElement.appendChild(this._inputElement);
+        this.content = contentElement;
+
+        this._presentOverTargetElement();
+    }
+
+    // Private
+
+    _presentOverTargetElement()
+    {
+        if (!this._targetElement)
+            return;
+
+        let targetFrame = WebInspector.Rect.rectFromClientRect(this._targetElement.getBoundingClientRect());
+        this.present(targetFrame, this._preferredEdges);
+
+        this._inputElement.select();
+    }
+};
+
+WebInspector.InputPopover.Result = {
+    None: Symbol(&quot;result-none&quot;),
+    Cancelled: Symbol(&quot;result-cancelled&quot;),
+    Committed: Symbol(&quot;result-committed&quot;),
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsXHRBreakpointTreeElementjsfromrev213690trunkSourceWebInspectorUIUserInterfaceViewsDOMBreakpointTreeElementjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/XHRBreakpointTreeElement.js (from rev 213690, trunk/Source/WebInspectorUI/UserInterface/Views/DOMBreakpointTreeElement.js) (0 => 213691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/XHRBreakpointTreeElement.js                                (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/XHRBreakpointTreeElement.js        2017-03-10 00:53:48 UTC (rev 213691)
</span><span class="lines">@@ -0,0 +1,138 @@
</span><ins>+/*
+ * Copyright (C) 2017 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.XHRBreakpointTreeElement = class XHRBreakpointTreeElement extends WebInspector.GeneralTreeElement
+{
+    constructor(breakpoint, className, title)
+    {
+        console.assert(breakpoint instanceof WebInspector.XHRBreakpoint);
+
+        if (!className)
+            className = WebInspector.BreakpointTreeElement.GenericLineIconStyleClassName;
+
+        let subtitle;
+        if (!title) {
+            title = WebInspector.UIString(&quot;URL contains:&quot;);
+            subtitle = breakpoint.url;
+        }
+
+        super([&quot;breakpoint&quot;, className], title, subtitle, breakpoint);
+
+        this._statusImageElement = document.createElement(&quot;img&quot;);
+        this._statusImageElement.classList.add(&quot;status-image&quot;, &quot;resolved&quot;);
+        this.status = this._statusImageElement;
+
+        breakpoint.addEventListener(WebInspector.XHRBreakpoint.Event.DisabledStateDidChange, this._updateStatus, this);
+
+        this._updateStatus();
+    }
+
+    // Protected
+
+    onattach()
+    {
+        super.onattach();
+
+        this._boundStatusImageElementClicked = this._statusImageElementClicked.bind(this);
+        this._boundStatusImageElementFocused = this._statusImageElementFocused.bind(this);
+        this._boundStatusImageElementMouseDown = this._statusImageElementMouseDown.bind(this);
+
+        this._statusImageElement.addEventListener(&quot;click&quot;, this._boundStatusImageElementClicked);
+        this._statusImageElement.addEventListener(&quot;focus&quot;, this._boundStatusImageElementFocused);
+        this._statusImageElement.addEventListener(&quot;mousedown&quot;, this._boundStatusImageElementMouseDown);
+    }
+
+    ondetach()
+    {
+        this._statusImageElement.removeEventListener(&quot;click&quot;, this._boundStatusImageElementClicked);
+        this._statusImageElement.removeEventListener(&quot;focus&quot;, this._boundStatusImageElementFocused);
+        this._statusImageElement.removeEventListener(&quot;mousedown&quot;, this._boundStatusImageElementMouseDown);
+
+        this._boundStatusImageElementClicked = null;
+        this._boundStatusImageElementFocused = null;
+        this._boundStatusImageElementMouseDown = null;
+    }
+
+    ondelete()
+    {
+        WebInspector.domDebuggerManager.removeXHRBreakpoint(this.representedObject);
+        return true;
+    }
+
+    onenter()
+    {
+        this._toggleBreakpoint();
+        return true;
+    }
+
+    onspace()
+    {
+        this._toggleBreakpoint();
+        return true;
+    }
+
+    populateContextMenu(contextMenu, event)
+    {
+        let breakpoint = this.representedObject;
+        let label = breakpoint.disabled ? WebInspector.UIString(&quot;Enable Breakpoint&quot;) : WebInspector.UIString(&quot;Disable Breakpoint&quot;);
+        contextMenu.appendItem(label, this._toggleBreakpoint.bind(this));
+
+        if (WebInspector.domDebuggerManager.isBreakpointRemovable(breakpoint)) {
+            contextMenu.appendSeparator();
+            contextMenu.appendItem(WebInspector.UIString(&quot;Delete Breakpoint&quot;), function() {
+                WebInspector.domDebuggerManager.removeXHRBreakpoint(breakpoint);
+            });
+        }
+    }
+
+    // Private
+
+    _statusImageElementClicked(event)
+    {
+        this._toggleBreakpoint();
+    }
+
+    _statusImageElementFocused(event)
+    {
+        // Prevent tree outline focus.
+        event.stopPropagation();
+    }
+
+    _statusImageElementMouseDown(event)
+    {
+        // Prevent tree element selection.
+        event.stopPropagation();
+    }
+
+    _toggleBreakpoint()
+    {
+        this.representedObject.disabled = !this.representedObject.disabled;
+    }
+
+    _updateStatus()
+    {
+        this._statusImageElement.classList.toggle(&quot;disabled&quot;, this.representedObject.disabled);
+    }
+};
</ins></span></pre>
</div>
</div>

</body>
</html>