<!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>[193246] branches/safari-601-branch/Source</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/193246">193246</a></dd>
<dt>Author</dt> <dd>timothy@apple.com</dd>
<dt>Date</dt> <dd>2015-12-03 11:01:42 -0800 (Thu, 03 Dec 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/190542">r190542</a>. rdar://problem/23221163</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari601branchSourceJavaScriptCoreChangeLog">branches/safari-601-branch/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#branchessafari601branchSourceJavaScriptCoredebuggerBreakpointh">branches/safari-601-branch/Source/JavaScriptCore/debugger/Breakpoint.h</a></li>
<li><a href="#branchessafari601branchSourceJavaScriptCoredebuggerDebuggercpp">branches/safari-601-branch/Source/JavaScriptCore/debugger/Debugger.cpp</a></li>
<li><a href="#branchessafari601branchSourceJavaScriptCoreinspectorScriptBreakpointh">branches/safari-601-branch/Source/JavaScriptCore/inspector/ScriptBreakpoint.h</a></li>
<li><a href="#branchessafari601branchSourceJavaScriptCoreinspectorScriptDebugServercpp">branches/safari-601-branch/Source/JavaScriptCore/inspector/ScriptDebugServer.cpp</a></li>
<li><a href="#branchessafari601branchSourceJavaScriptCoreinspectoragentsInspectorDebuggerAgentcpp">branches/safari-601-branch/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp</a></li>
<li><a href="#branchessafari601branchSourceJavaScriptCoreinspectorprotocolDebuggerjson">branches/safari-601-branch/Source/JavaScriptCore/inspector/protocol/Debugger.json</a></li>
<li><a href="#branchessafari601branchSourceWebInspectorUIChangeLog">branches/safari-601-branch/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#branchessafari601branchSourceWebInspectorUILocalizationsenlprojlocalizedStringsjs">branches/safari-601-branch/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js</a></li>
<li><a href="#branchessafari601branchSourceWebInspectorUIUserInterfaceControllersBreakpointPopoverControllerjs">branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Controllers/BreakpointPopoverController.js</a></li>
<li><a href="#branchessafari601branchSourceWebInspectorUIUserInterfaceControllersDebuggerManagerjs">branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js</a></li>
<li><a href="#branchessafari601branchSourceWebInspectorUIUserInterfaceModelsBreakpointjs">branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Models/Breakpoint.js</a></li>
<li><a href="#branchessafari601branchSourceWebInspectorUIUserInterfaceViewsBreakpointPopoverControllercss">branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/BreakpointPopoverController.css</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari601branchSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/JavaScriptCore/ChangeLog (193245 => 193246)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/JavaScriptCore/ChangeLog        2015-12-03 19:01:31 UTC (rev 193245)
+++ branches/safari-601-branch/Source/JavaScriptCore/ChangeLog        2015-12-03 19:01:42 UTC (rev 193246)
</span><span class="lines">@@ -1,5 +1,44 @@
</span><span class="cx"> 2015-12-02  Timothy Hatcher  &lt;timothy@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r190542. rdar://problem/23221163
+
+    2015-10-02  Matt Baker  &lt;mattbaker@apple.com&gt;
+
+            Web Inspector: Add breakpoint option to ignore n times before stopping
+            https://bugs.webkit.org/show_bug.cgi?id=147664
+
+            Reviewed by Timothy Hatcher.
+
+            * debugger/Breakpoint.h:
+            (JSC::Breakpoint::Breakpoint):
+            Added ignoreCount and hitCount fields. Cleaned up initializers.
+
+            * debugger/Debugger.cpp:
+            (JSC::Debugger::hasBreakpoint):
+            If a breakpoint matches the current text position, increment breakpoint hit count and
+            compare with ignore count before testing the breakpoint condition.
+
+            * inspector/ScriptBreakpoint.h:
+            (Inspector::ScriptBreakpoint::ScriptBreakpoint):
+            Added ignoreCount field. Cleaned up initializers.
+
+            * inspector/ScriptDebugServer.cpp:
+            (Inspector::ScriptDebugServer::setBreakpoint):
+            Added ignoreCount field.
+
+            * inspector/agents/InspectorDebuggerAgent.cpp:
+            (Inspector::buildObjectForBreakpointCookie):
+            (Inspector::InspectorDebuggerAgent::setBreakpointByUrl):
+            (Inspector::InspectorDebuggerAgent::setBreakpoint):
+            (Inspector::InspectorDebuggerAgent::continueToLocation):
+            (Inspector::InspectorDebuggerAgent::didParseSource):
+            Plumbing for ignoreCount property.
+
+            * inspector/protocol/Debugger.json:
+            Added optional ignoreCount property to BreakpointOptions object.
+
+2015-12-02  Timothy Hatcher  &lt;timothy@apple.com&gt;
+
</ins><span class="cx">         Merge r190146. rdar://problem/23221163
</span><span class="cx"> 
</span><span class="cx">     2015-09-22  Saam barati  &lt;sbarati@apple.com&gt;
</span></span></pre></div>
<a id="branchessafari601branchSourceJavaScriptCoredebuggerBreakpointh"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/JavaScriptCore/debugger/Breakpoint.h (193245 => 193246)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/JavaScriptCore/debugger/Breakpoint.h        2015-12-03 19:01:31 UTC (rev 193245)
+++ branches/safari-601-branch/Source/JavaScriptCore/debugger/Breakpoint.h        2015-12-03 19:01:42 UTC (rev 193246)
</span><span class="lines">@@ -35,21 +35,16 @@
</span><span class="cx"> 
</span><span class="cx"> struct Breakpoint : public DoublyLinkedListNode&lt;Breakpoint&gt; {
</span><span class="cx">     Breakpoint()
</span><del>-        : id(noBreakpointID)
-        , sourceID(noSourceID)
-        , line(0)
-        , column(0)
-        , autoContinue(false)
</del><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    Breakpoint(SourceID sourceID, unsigned line, unsigned column, const String&amp; condition, bool autoContinue)
-        : id(noBreakpointID)
-        , sourceID(sourceID)
</del><ins>+    Breakpoint(SourceID sourceID, unsigned line, unsigned column, const String&amp; condition, bool autoContinue, unsigned ignoreCount)
+        : sourceID(sourceID)
</ins><span class="cx">         , line(line)
</span><span class="cx">         , column(column)
</span><span class="cx">         , condition(condition)
</span><span class="cx">         , autoContinue(autoContinue)
</span><ins>+        , ignoreCount(ignoreCount)
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -60,15 +55,19 @@
</span><span class="cx">         , column(other.column)
</span><span class="cx">         , condition(other.condition)
</span><span class="cx">         , autoContinue(other.autoContinue)
</span><ins>+        , ignoreCount(other.ignoreCount)
+        , hitCount(other.hitCount)
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    BreakpointID id;
-    SourceID sourceID;
-    unsigned line;
-    unsigned column;
</del><ins>+    BreakpointID id { noBreakpointID };
+    SourceID sourceID { noSourceID };
+    unsigned line { 0 };
+    unsigned column { 0 };
</ins><span class="cx">     String condition;
</span><del>-    bool autoContinue;
</del><ins>+    bool autoContinue { false };
+    unsigned ignoreCount { 0 };
+    unsigned hitCount { 0 };
</ins><span class="cx"> 
</span><span class="cx">     static const unsigned unspecifiedColumn = UINT_MAX;
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari601branchSourceJavaScriptCoredebuggerDebuggercpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/JavaScriptCore/debugger/Debugger.cpp (193245 => 193246)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/JavaScriptCore/debugger/Debugger.cpp        2015-12-03 19:01:31 UTC (rev 193245)
+++ branches/safari-601-branch/Source/JavaScriptCore/debugger/Debugger.cpp        2015-12-03 19:01:42 UTC (rev 193246)
</span><span class="lines">@@ -480,6 +480,10 @@
</span><span class="cx">     if (hitBreakpoint)
</span><span class="cx">         *hitBreakpoint = *breakpoint;
</span><span class="cx"> 
</span><ins>+    breakpoint-&gt;hitCount++;
+    if (breakpoint-&gt;ignoreCount &gt;= breakpoint-&gt;hitCount)
+        return false;
+
</ins><span class="cx">     if (breakpoint-&gt;condition.isEmpty())
</span><span class="cx">         return true;
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari601branchSourceJavaScriptCoreinspectorScriptBreakpointh"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/JavaScriptCore/inspector/ScriptBreakpoint.h (193245 => 193246)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/JavaScriptCore/inspector/ScriptBreakpoint.h        2015-12-03 19:01:31 UTC (rev 193245)
+++ branches/safari-601-branch/Source/JavaScriptCore/inspector/ScriptBreakpoint.h        2015-12-03 19:01:42 UTC (rev 193246)
</span><span class="lines">@@ -62,28 +62,31 @@
</span><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    ScriptBreakpoint(int lineNumber, int columnNumber, const String&amp; condition, bool autoContinue)
</del><ins>+    ScriptBreakpoint(int lineNumber, int columnNumber, const String&amp; condition, bool autoContinue, unsigned ignoreCount)
</ins><span class="cx">         : lineNumber(lineNumber)
</span><span class="cx">         , columnNumber(columnNumber)
</span><span class="cx">         , condition(condition)
</span><span class="cx">         , autoContinue(autoContinue)
</span><ins>+        , ignoreCount(ignoreCount)
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    ScriptBreakpoint(int lineNumber, int columnNumber, const String&amp; condition, BreakpointActions&amp; actions, bool autoContinue)
</del><ins>+    ScriptBreakpoint(int lineNumber, int columnNumber, const String&amp; condition, BreakpointActions&amp; actions, bool autoContinue, unsigned ignoreCount)
</ins><span class="cx">         : lineNumber(lineNumber)
</span><span class="cx">         , columnNumber(columnNumber)
</span><span class="cx">         , condition(condition)
</span><span class="cx">         , actions(actions)
</span><span class="cx">         , autoContinue(autoContinue)
</span><ins>+        , ignoreCount(ignoreCount)
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    int lineNumber;
-    int columnNumber;
</del><ins>+    int lineNumber { 0 };
+    int columnNumber { 0 };
</ins><span class="cx">     String condition;
</span><span class="cx">     BreakpointActions actions;
</span><del>-    bool autoContinue;
</del><ins>+    bool autoContinue { false };
+    unsigned ignoreCount { 0 };
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace Inspector
</span></span></pre></div>
<a id="branchessafari601branchSourceJavaScriptCoreinspectorScriptDebugServercpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/JavaScriptCore/inspector/ScriptDebugServer.cpp (193245 => 193246)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/JavaScriptCore/inspector/ScriptDebugServer.cpp        2015-12-03 19:01:31 UTC (rev 193245)
+++ branches/safari-601-branch/Source/JavaScriptCore/inspector/ScriptDebugServer.cpp        2015-12-03 19:01:42 UTC (rev 193246)
</span><span class="lines">@@ -61,7 +61,7 @@
</span><span class="cx">     if (!sourceID)
</span><span class="cx">         return JSC::noBreakpointID;
</span><span class="cx"> 
</span><del>-    JSC::Breakpoint breakpoint(sourceID, scriptBreakpoint.lineNumber, scriptBreakpoint.columnNumber, scriptBreakpoint.condition, scriptBreakpoint.autoContinue);
</del><ins>+    JSC::Breakpoint breakpoint(sourceID, scriptBreakpoint.lineNumber, scriptBreakpoint.columnNumber, scriptBreakpoint.condition, scriptBreakpoint.autoContinue, scriptBreakpoint.ignoreCount);
</ins><span class="cx">     JSC::BreakpointID id = Debugger::setBreakpoint(breakpoint, *actualLineNumber, *actualColumnNumber);
</span><span class="cx">     if (id != JSC::noBreakpointID &amp;&amp; !scriptBreakpoint.actions.isEmpty()) {
</span><span class="cx"> #ifndef NDEBUG
</span></span></pre></div>
<a id="branchessafari601branchSourceJavaScriptCoreinspectoragentsInspectorDebuggerAgentcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp (193245 => 193246)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp        2015-12-03 19:01:31 UTC (rev 193245)
+++ branches/safari-601-branch/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp        2015-12-03 19:01:42 UTC (rev 193246)
</span><span class="lines">@@ -189,7 +189,7 @@
</span><span class="cx">         breakProgram(DebuggerFrontendDispatcher::Reason::Assert, buildAssertPauseReason(message));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static Ref&lt;InspectorObject&gt; buildObjectForBreakpointCookie(const String&amp; url, int lineNumber, int columnNumber, const String&amp; condition, RefPtr&lt;InspectorArray&gt;&amp; actions, bool isRegex, bool autoContinue)
</del><ins>+static Ref&lt;InspectorObject&gt; buildObjectForBreakpointCookie(const String&amp; url, int lineNumber, int columnNumber, const String&amp; condition, RefPtr&lt;InspectorArray&gt;&amp; actions, bool isRegex, bool autoContinue, unsigned ignoreCount)
</ins><span class="cx"> {
</span><span class="cx">     Ref&lt;InspectorObject&gt; breakpointObject = InspectorObject::create();
</span><span class="cx">     breakpointObject-&gt;setString(ASCIILiteral(&quot;url&quot;), url);
</span><span class="lines">@@ -198,6 +198,7 @@
</span><span class="cx">     breakpointObject-&gt;setString(ASCIILiteral(&quot;condition&quot;), condition);
</span><span class="cx">     breakpointObject-&gt;setBoolean(ASCIILiteral(&quot;isRegex&quot;), isRegex);
</span><span class="cx">     breakpointObject-&gt;setBoolean(ASCIILiteral(&quot;autoContinue&quot;), autoContinue);
</span><ins>+    breakpointObject-&gt;setInteger(ASCIILiteral(&quot;ignoreCount&quot;), ignoreCount);
</ins><span class="cx"> 
</span><span class="cx">     if (actions)
</span><span class="cx">         breakpointObject-&gt;setArray(ASCIILiteral(&quot;actions&quot;), actions);
</span><span class="lines">@@ -300,20 +301,22 @@
</span><span class="cx"> 
</span><span class="cx">     String condition = emptyString();
</span><span class="cx">     bool autoContinue = false;
</span><ins>+    unsigned ignoreCount = 0;
</ins><span class="cx">     RefPtr&lt;InspectorArray&gt; actions;
</span><span class="cx">     if (options) {
</span><span class="cx">         options-&gt;getString(ASCIILiteral(&quot;condition&quot;), condition);
</span><span class="cx">         options-&gt;getBoolean(ASCIILiteral(&quot;autoContinue&quot;), autoContinue);
</span><span class="cx">         options-&gt;getArray(ASCIILiteral(&quot;actions&quot;), actions);
</span><ins>+        options-&gt;getInteger(ASCIILiteral(&quot;ignoreCount&quot;), ignoreCount);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     BreakpointActions breakpointActions;
</span><span class="cx">     if (!breakpointActionsFromProtocol(errorString, actions, &amp;breakpointActions))
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    m_javaScriptBreakpoints.set(breakpointIdentifier, buildObjectForBreakpointCookie(url, lineNumber, columnNumber, condition, actions, isRegex, autoContinue));
</del><ins>+    m_javaScriptBreakpoints.set(breakpointIdentifier, buildObjectForBreakpointCookie(url, lineNumber, columnNumber, condition, actions, isRegex, autoContinue, ignoreCount));
</ins><span class="cx"> 
</span><del>-    ScriptBreakpoint breakpoint(lineNumber, columnNumber, condition, breakpointActions, autoContinue);
</del><ins>+    ScriptBreakpoint breakpoint(lineNumber, columnNumber, condition, breakpointActions, autoContinue, ignoreCount);
</ins><span class="cx">     for (ScriptsMap::iterator it = m_scripts.begin(); it != m_scripts.end(); ++it) {
</span><span class="cx">         String scriptURL = !it-&gt;value.sourceURL.isEmpty() ? it-&gt;value.sourceURL : it-&gt;value.url;
</span><span class="cx">         if (!matches(scriptURL, url, isRegex))
</span><span class="lines">@@ -351,11 +354,13 @@
</span><span class="cx"> 
</span><span class="cx">     String condition = emptyString();
</span><span class="cx">     bool autoContinue = false;
</span><ins>+    unsigned ignoreCount = 0;
</ins><span class="cx">     RefPtr&lt;InspectorArray&gt; actions;
</span><span class="cx">     if (options) {
</span><span class="cx">         options-&gt;getString(ASCIILiteral(&quot;condition&quot;), condition);
</span><span class="cx">         options-&gt;getBoolean(ASCIILiteral(&quot;autoContinue&quot;), autoContinue);
</span><span class="cx">         options-&gt;getArray(ASCIILiteral(&quot;actions&quot;), actions);
</span><ins>+        options-&gt;getInteger(ASCIILiteral(&quot;ignoreCount&quot;), ignoreCount);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     BreakpointActions breakpointActions;
</span><span class="lines">@@ -368,7 +373,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    ScriptBreakpoint breakpoint(lineNumber, columnNumber, condition, breakpointActions, autoContinue);
</del><ins>+    ScriptBreakpoint breakpoint(lineNumber, columnNumber, condition, breakpointActions, autoContinue, ignoreCount);
</ins><span class="cx">     actualLocation = resolveBreakpoint(breakpointIdentifier, sourceID, breakpoint);
</span><span class="cx">     if (!actualLocation) {
</span><span class="cx">         errorString = ASCIILiteral(&quot;Could not resolve breakpoint&quot;);
</span><span class="lines">@@ -406,7 +411,7 @@
</span><span class="cx">     if (!parseLocation(errorString, location, sourceID, lineNumber, columnNumber))
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    ScriptBreakpoint breakpoint(lineNumber, columnNumber, &quot;&quot;, false);
</del><ins>+    ScriptBreakpoint breakpoint(lineNumber, columnNumber, &quot;&quot;, false, 0);
</ins><span class="cx">     m_continueToLocationBreakpointID = scriptDebugServer().setBreakpoint(sourceID, breakpoint, &amp;lineNumber, &amp;columnNumber);
</span><span class="cx">     resume(errorString);
</span><span class="cx"> }
</span><span class="lines">@@ -641,6 +646,7 @@
</span><span class="cx">         breakpointObject-&gt;getInteger(ASCIILiteral(&quot;columnNumber&quot;), breakpoint.columnNumber);
</span><span class="cx">         breakpointObject-&gt;getString(ASCIILiteral(&quot;condition&quot;), breakpoint.condition);
</span><span class="cx">         breakpointObject-&gt;getBoolean(ASCIILiteral(&quot;autoContinue&quot;), breakpoint.autoContinue);
</span><ins>+        breakpointObject-&gt;getInteger(ASCIILiteral(&quot;ignoreCount&quot;), breakpoint.ignoreCount);
</ins><span class="cx">         ErrorString errorString;
</span><span class="cx">         RefPtr&lt;InspectorArray&gt; actions;
</span><span class="cx">         breakpointObject-&gt;getArray(ASCIILiteral(&quot;actions&quot;), actions);
</span></span></pre></div>
<a id="branchessafari601branchSourceJavaScriptCoreinspectorprotocolDebuggerjson"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/JavaScriptCore/inspector/protocol/Debugger.json (193245 => 193246)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/JavaScriptCore/inspector/protocol/Debugger.json        2015-12-03 19:01:31 UTC (rev 193245)
+++ branches/safari-601-branch/Source/JavaScriptCore/inspector/protocol/Debugger.json        2015-12-03 19:01:42 UTC (rev 193246)
</span><span class="lines">@@ -48,7 +48,8 @@
</span><span class="cx">             &quot;properties&quot;: [
</span><span class="cx">                 { &quot;name&quot;: &quot;condition&quot;, &quot;type&quot;: &quot;string&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true.&quot; },
</span><span class="cx">                 { &quot;name&quot;: &quot;actions&quot;, &quot;type&quot;: &quot;array&quot;, &quot;optional&quot;: true, &quot;items&quot;: { &quot;$ref&quot;: &quot;BreakpointAction&quot; }, &quot;description&quot;: &quot;Actions to perform automatically when the breakpoint is triggered.&quot; },
</span><del>-                { &quot;name&quot;: &quot;autoContinue&quot;, &quot;type&quot;: &quot;boolean&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;Automatically continue after hitting this breakpoint and running actions.&quot; }
</del><ins>+                { &quot;name&quot;: &quot;autoContinue&quot;, &quot;type&quot;: &quot;boolean&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;Automatically continue after hitting this breakpoint and running actions.&quot; },
+                { &quot;name&quot;: &quot;ignoreCount&quot;, &quot;type&quot;: &quot;integer&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;Number of times to ignore this breakpoint, before stopping on the breakpoint and running actions.&quot; }
</ins><span class="cx">             ],
</span><span class="cx">             &quot;description&quot;: &quot;Extra options that modify breakpoint behavior.&quot;
</span><span class="cx">         },
</span></span></pre></div>
<a id="branchessafari601branchSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebInspectorUI/ChangeLog (193245 => 193246)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebInspectorUI/ChangeLog        2015-12-03 19:01:31 UTC (rev 193245)
+++ branches/safari-601-branch/Source/WebInspectorUI/ChangeLog        2015-12-03 19:01:42 UTC (rev 193246)
</span><span class="lines">@@ -1,5 +1,43 @@
</span><span class="cx"> 2015-12-02  Timothy Hatcher  &lt;timothy@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r190542. rdar://problem/23221163
+
+    2015-10-02  Matt Baker  &lt;mattbaker@apple.com&gt;
+
+            Web Inspector: Add breakpoint option to ignore n times before stopping
+            https://bugs.webkit.org/show_bug.cgi?id=147664
+
+            Reviewed by Timothy Hatcher.
+
+            * Localizations/en.lproj/localizedStrings.js:
+            New strings for breakpoint popover labels.
+
+            * UserInterface/Controllers/BreakpointPopoverController.js:
+            (WebInspector.BreakpointPopoverController.prototype._createPopoverContent):
+            Add ignoreCount UI to popover, if backend support exists. UI based on same
+            feature in Xcode's breakpoint editing dialog.
+            (WebInspector.BreakpointPopoverController.prototype._popoverIgnoreInputChanged):
+            User input sanity checks on numeric input.
+
+            * UserInterface/Controllers/DebuggerManager.js:
+            Listen for changes to breakpoint ignoreCount property.
+
+            * UserInterface/Models/Breakpoint.js:
+            (WebInspector.Breakpoint):
+            (WebInspector.Breakpoint.prototype.get ignoreCount):
+            (WebInspector.Breakpoint.prototype.set ignoreCount):
+            New property for ignoreCount.
+            (WebInspector.Breakpoint.prototype.get options):
+            Added ignoreCount to options object.
+            (WebInspector.Breakpoint.prototype.get info):
+            Added ignoreCount to info object.
+
+            * UserInterface/Views/BreakpointPopoverController.css:
+            (#edit-breakpoint-popover-ignore):
+            New styles for breakpoint popover.
+
+2015-12-02  Timothy Hatcher  &lt;timothy@apple.com&gt;
+
</ins><span class="cx">         Merge r190540. rdar://problem/23221163
</span><span class="cx"> 
</span><span class="cx">     2015-10-02  Matt Baker  &lt;mattbaker@apple.com&gt;
</span></span></pre></div>
<a id="branchessafari601branchSourceWebInspectorUILocalizationsenlprojlocalizedStringsjs"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (193245 => 193246)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2015-12-03 19:01:31 UTC (rev 193245)
+++ branches/safari-601-branch/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2015-12-03 19:01:42 UTC (rev 193246)
</span><span class="lines">@@ -312,6 +312,7 @@
</span><span class="cx"> localizedStrings[&quot;Icon and Text (Horizontal)&quot;] = &quot;Icon and Text (Horizontal)&quot;;
</span><span class="cx"> localizedStrings[&quot;Icon and Text (Vertical)&quot;] = &quot;Icon and Text (Vertical)&quot;;
</span><span class="cx"> localizedStrings[&quot;Identity&quot;] = &quot;Identity&quot;;
</span><ins>+localizedStrings[&quot;Ignore&quot;] = &quot;Ignore&quot;;
</ins><span class="cx"> localizedStrings[&quot;Ignored&quot;] = &quot;Ignored&quot;;
</span><span class="cx"> localizedStrings[&quot;Image&quot;] = &quot;Image&quot;;
</span><span class="cx"> localizedStrings[&quot;Image Size&quot;] = &quot;Image Size&quot;;
</span><span class="lines">@@ -628,5 +629,6 @@
</span><span class="cx"> localizedStrings[&quot;key&quot;] = &quot;key&quot;;
</span><span class="cx"> localizedStrings[&quot;line &quot;] = &quot;line &quot;;
</span><span class="cx"> localizedStrings[&quot;originally %s&quot;] = &quot;originally %s&quot;;
</span><ins>+localizedStrings[&quot;times before stopping&quot;] = &quot;times before stopping&quot;;
</ins><span class="cx"> localizedStrings[&quot;value&quot;] = &quot;value&quot;;
</span><span class="cx"> localizedStrings[&quot; %s  Profile Recorded&quot;] = &quot; %s  Profile Recorded&quot;;
</span></span></pre></div>
<a id="branchessafari601branchSourceWebInspectorUIUserInterfaceControllersBreakpointPopoverControllerjs"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Controllers/BreakpointPopoverController.js (193245 => 193246)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Controllers/BreakpointPopoverController.js        2015-12-03 19:01:31 UTC (rev 193245)
+++ branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Controllers/BreakpointPopoverController.js        2015-12-03 19:01:42 UTC (rev 193246)
</span><span class="lines">@@ -124,7 +124,7 @@
</span><span class="cx">         var checkboxLabel = document.createElement(&quot;label&quot;);
</span><span class="cx">         checkboxLabel.className = &quot;toggle&quot;;
</span><span class="cx">         checkboxLabel.appendChild(checkboxElement);
</span><del>-        checkboxLabel.append(this._breakpoint.sourceCodeLocation.displayLocationString());
</del><ins>+        checkboxLabel.appendChild(document.createTextNode(this._breakpoint.sourceCodeLocation.displayLocationString()));
</ins><span class="cx"> 
</span><span class="cx">         var table = document.createElement(&quot;table&quot;);
</span><span class="cx"> 
</span><span class="lines">@@ -144,6 +144,27 @@
</span><span class="cx"> 
</span><span class="cx">         // COMPATIBILITY (iOS 7): Debugger.setBreakpoint did not support options.
</span><span class="cx">         if (DebuggerAgent.setBreakpoint.supports(&quot;options&quot;)) {
</span><ins>+            // COMPATIBILITY (iOS 9): Legacy backends don't support breakpoint ignore count. Since support
+            // can't be tested directly, check for CSS.getSupportedSystemFontFamilyNames.
+            // FIXME: Use explicit version checking once https://webkit.org/b/148680 is fixed.
+            if (CSSAgent.getSupportedSystemFontFamilyNames) {
+                var ignoreCountRow = table.appendChild(document.createElement(&quot;tr&quot;));
+                var ignoreCountHeader = ignoreCountRow.appendChild(document.createElement(&quot;th&quot;));
+                var ignoreCountLabel = ignoreCountHeader.appendChild(document.createElement(&quot;label&quot;));
+                var ignoreCountData = ignoreCountRow.appendChild(document.createElement(&quot;td&quot;));
+                this._ignoreCountInput = ignoreCountData.appendChild(document.createElement(&quot;input&quot;));
+                this._ignoreCountInput.id = &quot;edit-breakpoint-popover-ignore&quot;;
+                this._ignoreCountInput.type = &quot;number&quot;;
+                this._ignoreCountInput.min = 0;
+                this._ignoreCountInput.value = this._ignoreCount || 0;
+                this._ignoreCountInput.addEventListener(&quot;change&quot;, this._popoverIgnoreInputChanged.bind(this));
+
+                var ignoreCountText = ignoreCountData.appendChild(document.createElement(&quot;span&quot;));
+                ignoreCountLabel.setAttribute(&quot;for&quot;, this._ignoreCountInput.id);
+                ignoreCountLabel.textContent = WebInspector.UIString(&quot;Ignore&quot;);
+                ignoreCountText.textContent = WebInspector.UIString(&quot;times before stopping&quot;);
+            }
+
</ins><span class="cx">             var actionRow = table.appendChild(document.createElement(&quot;tr&quot;));
</span><span class="cx">             var actionHeader = actionRow.appendChild(document.createElement(&quot;th&quot;));
</span><span class="cx">             var actionData = this._actionsContainer = actionRow.appendChild(document.createElement(&quot;td&quot;));
</span><span class="lines">@@ -191,6 +212,19 @@
</span><span class="cx">         this._breakpoint.condition = event.target.value;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    _popoverIgnoreInputChanged(event)
+    {
+        var ignoreCount = 0;
+        if (event.target.value) {
+            ignoreCount = parseInt(event.target.value, 10);
+            if (isNaN(ignoreCount) || ignoreCount &lt; 0)
+                ignoreCount = 0;
+        }
+
+        this._ignoreCountInput.value = ignoreCount;
+        this._breakpoint.ignoreCount = ignoreCount;
+    }
+
</ins><span class="cx">     _popoverToggleAutoContinueCheckboxChanged(event)
</span><span class="cx">     {
</span><span class="cx">         this._breakpoint.autoContinue = event.target.checked;
</span></span></pre></div>
<a id="branchessafari601branchSourceWebInspectorUIUserInterfaceControllersDebuggerManagerjs"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js (193245 => 193246)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js        2015-12-03 19:01:31 UTC (rev 193245)
+++ branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js        2015-12-03 19:01:42 UTC (rev 193246)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx">         WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.DisplayLocationDidChange, this._breakpointDisplayLocationDidChange, this);
</span><span class="cx">         WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.DisabledStateDidChange, this._breakpointDisabledStateDidChange, this);
</span><span class="cx">         WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.ConditionDidChange, this._breakpointEditablePropertyDidChange, this);
</span><ins>+        WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.IgnoreCountDidChange, this._breakpointEditablePropertyDidChange, this);
</ins><span class="cx">         WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.AutoContinueDidChange, this._breakpointEditablePropertyDidChange, this);
</span><span class="cx">         WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.ActionsDidChange, this._breakpointEditablePropertyDidChange, this);
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari601branchSourceWebInspectorUIUserInterfaceModelsBreakpointjs"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Models/Breakpoint.js (193245 => 193246)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Models/Breakpoint.js        2015-12-03 19:01:31 UTC (rev 193245)
+++ branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Models/Breakpoint.js        2015-12-03 19:01:42 UTC (rev 193246)
</span><span class="lines">@@ -39,6 +39,7 @@
</span><span class="cx">             var lineNumber = sourceCodeLocationOrInfo.lineNumber || 0;
</span><span class="cx">             var columnNumber = sourceCodeLocationOrInfo.columnNumber || 0;
</span><span class="cx">             var location = new WebInspector.SourceCodeLocation(null, lineNumber, columnNumber);
</span><ins>+            var ignoreCount = sourceCodeLocationOrInfo.ignoreCount || 0;
</ins><span class="cx">             var autoContinue = sourceCodeLocationOrInfo.autoContinue || false;
</span><span class="cx">             var actions = sourceCodeLocationOrInfo.actions || [];
</span><span class="cx">             for (var i = 0; i &lt; actions.length; ++i)
</span><span class="lines">@@ -53,6 +54,7 @@
</span><span class="cx">         this._scriptIdentifier = scriptIdentifier || null;
</span><span class="cx">         this._disabled = disabled || false;
</span><span class="cx">         this._condition = condition || &quot;&quot;;
</span><ins>+        this._ignoreCount = ignoreCount || 0;
</ins><span class="cx">         this._autoContinue = autoContinue || false;
</span><span class="cx">         this._actions = actions || [];
</span><span class="cx">         this._resolved = false;
</span><span class="lines">@@ -141,6 +143,25 @@
</span><span class="cx">         this.dispatchEventToListeners(WebInspector.Breakpoint.Event.ConditionDidChange);
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    get ignoreCount()
+    {
+        return this._ignoreCount;
+    }
+
+    set ignoreCount(ignoreCount)
+    {
+        console.assert(ignoreCount &gt;= 0, &quot;Ignore count cannot be negative.&quot;);
+        if (ignoreCount &lt; 0)
+            return;
+
+        if (this._ignoreCount === ignoreCount)
+            return;
+
+        this._ignoreCount = ignoreCount;
+
+        this.dispatchEventToListeners(WebInspector.Breakpoint.Event.IgnoreCountDidChange);
+    }
+
</ins><span class="cx">     get autoContinue()
</span><span class="cx">     {
</span><span class="cx">         return this._autoContinue;
</span><span class="lines">@@ -165,6 +186,7 @@
</span><span class="cx">     {
</span><span class="cx">         return {
</span><span class="cx">             condition: this._condition,
</span><ins>+            ignoreCount: this._ignoreCount,
</ins><span class="cx">             actions: this._serializableActions(),
</span><span class="cx">             autoContinue: this._autoContinue
</span><span class="cx">         };
</span><span class="lines">@@ -179,6 +201,7 @@
</span><span class="cx">             columnNumber: this._sourceCodeLocation.columnNumber,
</span><span class="cx">             disabled: this._disabled,
</span><span class="cx">             condition: this._condition,
</span><ins>+            ignoreCount: this._ignoreCount,
</ins><span class="cx">             actions: this._serializableActions(),
</span><span class="cx">             autoContinue: this._autoContinue
</span><span class="cx">         };
</span><span class="lines">@@ -325,6 +348,7 @@
</span><span class="cx">     DisabledStateDidChange: &quot;breakpoint-disabled-state-did-change&quot;,
</span><span class="cx">     ResolvedStateDidChange: &quot;breakpoint-resolved-state-did-change&quot;,
</span><span class="cx">     ConditionDidChange: &quot;breakpoint-condition-did-change&quot;,
</span><ins>+    IgnoreCountDidChange: &quot;breakpoint-ignore-count-did-change&quot;,
</ins><span class="cx">     ActionsDidChange: &quot;breakpoint-actions-did-change&quot;,
</span><span class="cx">     AutoContinueDidChange: &quot;breakpoint-auto-continue-did-change&quot;,
</span><span class="cx">     LocationDidChange: &quot;breakpoint-location-did-change&quot;,
</span></span></pre></div>
<a id="branchessafari601branchSourceWebInspectorUIUserInterfaceViewsBreakpointPopoverControllercss"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/BreakpointPopoverController.css (193245 => 193246)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/BreakpointPopoverController.css        2015-12-03 19:01:31 UTC (rev 193245)
+++ branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/BreakpointPopoverController.css        2015-12-03 19:01:42 UTC (rev 193246)
</span><span class="lines">@@ -60,6 +60,11 @@
</span><span class="cx">     width: 100%;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#edit-breakpoint-popover-ignore {
+    width: 40px;
+    margin-right: 4px;
+}
+
</ins><span class="cx"> #edit-breakpoint-popoover-auto-continue {
</span><span class="cx">     margin-left: 0;
</span><span class="cx">     margin-right: 4px;
</span></span></pre>
</div>
</div>

</body>
</html>