<!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 <timothy@apple.com>
</span><span class="cx">
</span><ins>+ Merge r190542. rdar://problem/23221163
+
+ 2015-10-02 Matt Baker <mattbaker@apple.com>
+
+ 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 <timothy@apple.com>
+
</ins><span class="cx"> Merge r190146. rdar://problem/23221163
</span><span class="cx">
</span><span class="cx"> 2015-09-22 Saam barati <sbarati@apple.com>
</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<Breakpoint> {
</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& condition, bool autoContinue)
- : id(noBreakpointID)
- , sourceID(sourceID)
</del><ins>+ Breakpoint(SourceID sourceID, unsigned line, unsigned column, const String& 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->hitCount++;
+ if (breakpoint->ignoreCount >= breakpoint->hitCount)
+ return false;
+
</ins><span class="cx"> if (breakpoint->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& condition, bool autoContinue)
</del><ins>+ ScriptBreakpoint(int lineNumber, int columnNumber, const String& 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& condition, BreakpointActions& actions, bool autoContinue)
</del><ins>+ ScriptBreakpoint(int lineNumber, int columnNumber, const String& condition, BreakpointActions& 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 && !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<InspectorObject> buildObjectForBreakpointCookie(const String& url, int lineNumber, int columnNumber, const String& condition, RefPtr<InspectorArray>& actions, bool isRegex, bool autoContinue)
</del><ins>+static Ref<InspectorObject> buildObjectForBreakpointCookie(const String& url, int lineNumber, int columnNumber, const String& condition, RefPtr<InspectorArray>& actions, bool isRegex, bool autoContinue, unsigned ignoreCount)
</ins><span class="cx"> {
</span><span class="cx"> Ref<InspectorObject> breakpointObject = InspectorObject::create();
</span><span class="cx"> breakpointObject->setString(ASCIILiteral("url"), url);
</span><span class="lines">@@ -198,6 +198,7 @@
</span><span class="cx"> breakpointObject->setString(ASCIILiteral("condition"), condition);
</span><span class="cx"> breakpointObject->setBoolean(ASCIILiteral("isRegex"), isRegex);
</span><span class="cx"> breakpointObject->setBoolean(ASCIILiteral("autoContinue"), autoContinue);
</span><ins>+ breakpointObject->setInteger(ASCIILiteral("ignoreCount"), ignoreCount);
</ins><span class="cx">
</span><span class="cx"> if (actions)
</span><span class="cx"> breakpointObject->setArray(ASCIILiteral("actions"), 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<InspectorArray> actions;
</span><span class="cx"> if (options) {
</span><span class="cx"> options->getString(ASCIILiteral("condition"), condition);
</span><span class="cx"> options->getBoolean(ASCIILiteral("autoContinue"), autoContinue);
</span><span class="cx"> options->getArray(ASCIILiteral("actions"), actions);
</span><ins>+ options->getInteger(ASCIILiteral("ignoreCount"), ignoreCount);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> BreakpointActions breakpointActions;
</span><span class="cx"> if (!breakpointActionsFromProtocol(errorString, actions, &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->value.sourceURL.isEmpty() ? it->value.sourceURL : it->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<InspectorArray> actions;
</span><span class="cx"> if (options) {
</span><span class="cx"> options->getString(ASCIILiteral("condition"), condition);
</span><span class="cx"> options->getBoolean(ASCIILiteral("autoContinue"), autoContinue);
</span><span class="cx"> options->getArray(ASCIILiteral("actions"), actions);
</span><ins>+ options->getInteger(ASCIILiteral("ignoreCount"), 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("Could not resolve breakpoint");
</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, "", false);
</del><ins>+ ScriptBreakpoint breakpoint(lineNumber, columnNumber, "", false, 0);
</ins><span class="cx"> m_continueToLocationBreakpointID = scriptDebugServer().setBreakpoint(sourceID, breakpoint, &lineNumber, &columnNumber);
</span><span class="cx"> resume(errorString);
</span><span class="cx"> }
</span><span class="lines">@@ -641,6 +646,7 @@
</span><span class="cx"> breakpointObject->getInteger(ASCIILiteral("columnNumber"), breakpoint.columnNumber);
</span><span class="cx"> breakpointObject->getString(ASCIILiteral("condition"), breakpoint.condition);
</span><span class="cx"> breakpointObject->getBoolean(ASCIILiteral("autoContinue"), breakpoint.autoContinue);
</span><ins>+ breakpointObject->getInteger(ASCIILiteral("ignoreCount"), breakpoint.ignoreCount);
</ins><span class="cx"> ErrorString errorString;
</span><span class="cx"> RefPtr<InspectorArray> actions;
</span><span class="cx"> breakpointObject->getArray(ASCIILiteral("actions"), 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"> "properties": [
</span><span class="cx"> { "name": "condition", "type": "string", "optional": true, "description": "Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true." },
</span><span class="cx"> { "name": "actions", "type": "array", "optional": true, "items": { "$ref": "BreakpointAction" }, "description": "Actions to perform automatically when the breakpoint is triggered." },
</span><del>- { "name": "autoContinue", "type": "boolean", "optional": true, "description": "Automatically continue after hitting this breakpoint and running actions." }
</del><ins>+ { "name": "autoContinue", "type": "boolean", "optional": true, "description": "Automatically continue after hitting this breakpoint and running actions." },
+ { "name": "ignoreCount", "type": "integer", "optional": true, "description": "Number of times to ignore this breakpoint, before stopping on the breakpoint and running actions." }
</ins><span class="cx"> ],
</span><span class="cx"> "description": "Extra options that modify breakpoint behavior."
</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 <timothy@apple.com>
</span><span class="cx">
</span><ins>+ Merge r190542. rdar://problem/23221163
+
+ 2015-10-02 Matt Baker <mattbaker@apple.com>
+
+ 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 <timothy@apple.com>
+
</ins><span class="cx"> Merge r190540. rdar://problem/23221163
</span><span class="cx">
</span><span class="cx"> 2015-10-02 Matt Baker <mattbaker@apple.com>
</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["Icon and Text (Horizontal)"] = "Icon and Text (Horizontal)";
</span><span class="cx"> localizedStrings["Icon and Text (Vertical)"] = "Icon and Text (Vertical)";
</span><span class="cx"> localizedStrings["Identity"] = "Identity";
</span><ins>+localizedStrings["Ignore"] = "Ignore";
</ins><span class="cx"> localizedStrings["Ignored"] = "Ignored";
</span><span class="cx"> localizedStrings["Image"] = "Image";
</span><span class="cx"> localizedStrings["Image Size"] = "Image Size";
</span><span class="lines">@@ -628,5 +629,6 @@
</span><span class="cx"> localizedStrings["key"] = "key";
</span><span class="cx"> localizedStrings["line "] = "line ";
</span><span class="cx"> localizedStrings["originally %s"] = "originally %s";
</span><ins>+localizedStrings["times before stopping"] = "times before stopping";
</ins><span class="cx"> localizedStrings["value"] = "value";
</span><span class="cx"> localizedStrings[" %s Profile Recorded"] = " %s Profile Recorded";
</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("label");
</span><span class="cx"> checkboxLabel.className = "toggle";
</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("table");
</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("options")) {
</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("tr"));
+ var ignoreCountHeader = ignoreCountRow.appendChild(document.createElement("th"));
+ var ignoreCountLabel = ignoreCountHeader.appendChild(document.createElement("label"));
+ var ignoreCountData = ignoreCountRow.appendChild(document.createElement("td"));
+ this._ignoreCountInput = ignoreCountData.appendChild(document.createElement("input"));
+ this._ignoreCountInput.id = "edit-breakpoint-popover-ignore";
+ this._ignoreCountInput.type = "number";
+ this._ignoreCountInput.min = 0;
+ this._ignoreCountInput.value = this._ignoreCount || 0;
+ this._ignoreCountInput.addEventListener("change", this._popoverIgnoreInputChanged.bind(this));
+
+ var ignoreCountText = ignoreCountData.appendChild(document.createElement("span"));
+ ignoreCountLabel.setAttribute("for", this._ignoreCountInput.id);
+ ignoreCountLabel.textContent = WebInspector.UIString("Ignore");
+ ignoreCountText.textContent = WebInspector.UIString("times before stopping");
+ }
+
</ins><span class="cx"> var actionRow = table.appendChild(document.createElement("tr"));
</span><span class="cx"> var actionHeader = actionRow.appendChild(document.createElement("th"));
</span><span class="cx"> var actionData = this._actionsContainer = actionRow.appendChild(document.createElement("td"));
</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 < 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 < 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 || "";
</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 >= 0, "Ignore count cannot be negative.");
+ if (ignoreCount < 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: "breakpoint-disabled-state-did-change",
</span><span class="cx"> ResolvedStateDidChange: "breakpoint-resolved-state-did-change",
</span><span class="cx"> ConditionDidChange: "breakpoint-condition-did-change",
</span><ins>+ IgnoreCountDidChange: "breakpoint-ignore-count-did-change",
</ins><span class="cx"> ActionsDidChange: "breakpoint-actions-did-change",
</span><span class="cx"> AutoContinueDidChange: "breakpoint-auto-continue-did-change",
</span><span class="cx"> LocationDidChange: "breakpoint-location-did-change",
</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>