Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (167815 => 167816)
--- trunk/Source/_javascript_Core/ChangeLog 2014-04-25 19:41:56 UTC (rev 167815)
+++ trunk/Source/_javascript_Core/ChangeLog 2014-04-25 19:45:06 UTC (rev 167816)
@@ -1,3 +1,26 @@
+2014-04-25 Mark Lam <[email protected]>
+
+ Refactor debugging code to use BreakpointActions instead of Vector<ScriptBreakpointAction>.
+ <https://webkit.org/b/132201>
+
+ Reviewed by Joseph Pecoraro.
+
+ BreakpointActions is Vector<ScriptBreakpointAction>. Let's just consistently use
+ BreakpointActions everywhere.
+
+ * inspector/ScriptBreakpoint.h:
+ (Inspector::ScriptBreakpoint::ScriptBreakpoint):
+ * inspector/ScriptDebugServer.cpp:
+ (Inspector::ScriptDebugServer::setBreakpoint):
+ (Inspector::ScriptDebugServer::getActionsForBreakpoint):
+ * inspector/ScriptDebugServer.h:
+ * inspector/agents/InspectorDebuggerAgent.cpp:
+ (Inspector::InspectorDebuggerAgent::breakpointActionsFromProtocol):
+ (Inspector::InspectorDebuggerAgent::setBreakpointByUrl):
+ (Inspector::InspectorDebuggerAgent::setBreakpoint):
+ (Inspector::InspectorDebuggerAgent::removeBreakpoint):
+ * inspector/agents/InspectorDebuggerAgent.h:
+
2014-04-24 Filip Pizlo <[email protected]>
DFG worklist scanning should not treat the key as a separate entity
Modified: trunk/Source/_javascript_Core/inspector/ScriptBreakpoint.h (167815 => 167816)
--- trunk/Source/_javascript_Core/inspector/ScriptBreakpoint.h 2014-04-25 19:41:56 UTC (rev 167815)
+++ trunk/Source/_javascript_Core/inspector/ScriptBreakpoint.h 2014-04-25 19:45:06 UTC (rev 167816)
@@ -55,6 +55,8 @@
String data;
};
+typedef Vector<ScriptBreakpointAction> BreakpointActions;
+
struct ScriptBreakpoint {
ScriptBreakpoint()
{
@@ -68,7 +70,7 @@
{
}
- ScriptBreakpoint(int lineNumber, int columnNumber, const String& condition, Vector<ScriptBreakpointAction>& actions, bool autoContinue)
+ ScriptBreakpoint(int lineNumber, int columnNumber, const String& condition, BreakpointActions& actions, bool autoContinue)
: lineNumber(lineNumber)
, columnNumber(columnNumber)
, condition(condition)
@@ -80,7 +82,7 @@
int lineNumber;
int columnNumber;
String condition;
- Vector<ScriptBreakpointAction> actions;
+ BreakpointActions actions;
bool autoContinue;
};
Modified: trunk/Source/_javascript_Core/inspector/ScriptDebugServer.cpp (167815 => 167816)
--- trunk/Source/_javascript_Core/inspector/ScriptDebugServer.cpp 2014-04-25 19:41:56 UTC (rev 167815)
+++ trunk/Source/_javascript_Core/inspector/ScriptDebugServer.cpp 2014-04-25 19:45:06 UTC (rev 167816)
@@ -70,7 +70,7 @@
BreakpointIDToActionsMap::iterator it = m_breakpointIDToActions.find(id);
ASSERT(it == m_breakpointIDToActions.end());
#endif
- const Vector<ScriptBreakpointAction> &actions = scriptBreakpoint.actions;
+ const BreakpointActions& actions = scriptBreakpoint.actions;
m_breakpointIDToActions.set(id, actions);
}
return id;
@@ -324,14 +324,14 @@
dispatchFunctionToListeners(&ScriptDebugServer::dispatchDidContinue, vmEntryGlobalObject);
}
-const Vector<ScriptBreakpointAction>& ScriptDebugServer::getActionsForBreakpoint(JSC::BreakpointID breakpointID)
+const BreakpointActions& ScriptDebugServer::getActionsForBreakpoint(JSC::BreakpointID breakpointID)
{
ASSERT(breakpointID != JSC::noBreakpointID);
if (m_breakpointIDToActions.contains(breakpointID))
return m_breakpointIDToActions.find(breakpointID)->value;
- static NeverDestroyed<Vector<ScriptBreakpointAction>> emptyActionVector = Vector<ScriptBreakpointAction>();
+ static NeverDestroyed<BreakpointActions> emptyActionVector = BreakpointActions();
return emptyActionVector;
}
Modified: trunk/Source/_javascript_Core/inspector/ScriptDebugServer.h (167815 => 167816)
--- trunk/Source/_javascript_Core/inspector/ScriptDebugServer.h 2014-04-25 19:41:56 UTC (rev 167815)
+++ trunk/Source/_javascript_Core/inspector/ScriptDebugServer.h 2014-04-25 19:45:06 UTC (rev 167816)
@@ -58,7 +58,7 @@
virtual void recompileAllJSFunctions() = 0;
- const Vector<ScriptBreakpointAction>& getActionsForBreakpoint(JSC::BreakpointID);
+ const BreakpointActions& getActionsForBreakpoint(JSC::BreakpointID);
class Task {
WTF_MAKE_FAST_ALLOCATED;
@@ -96,7 +96,6 @@
bool m_doneProcessingDebuggerEvents;
private:
- typedef Vector<ScriptBreakpointAction> BreakpointActions;
typedef HashMap<JSC::BreakpointID, BreakpointActions> BreakpointIDToActionsMap;
virtual void sourceParsed(JSC::ExecState*, JSC::SourceProvider*, int errorLine, const String& errorMsg) override final;
Modified: trunk/Source/_javascript_Core/inspector/agents/InspectorDebuggerAgent.cpp (167815 => 167816)
--- trunk/Source/_javascript_Core/inspector/agents/InspectorDebuggerAgent.cpp 2014-04-25 19:41:56 UTC (rev 167815)
+++ trunk/Source/_javascript_Core/inspector/agents/InspectorDebuggerAgent.cpp 2014-04-25 19:45:06 UTC (rev 167816)
@@ -195,7 +195,7 @@
return false;
}
-bool InspectorDebuggerAgent::breakpointActionsFromProtocol(ErrorString* errorString, RefPtr<InspectorArray>& actions, Vector<ScriptBreakpointAction>* result)
+bool InspectorDebuggerAgent::breakpointActionsFromProtocol(ErrorString* errorString, RefPtr<InspectorArray>& actions, BreakpointActions* result)
{
if (!actions)
return true;
@@ -266,7 +266,7 @@
actions = (*options)->getArray(ASCIILiteral("actions"));
}
- Vector<ScriptBreakpointAction> breakpointActions;
+ BreakpointActions breakpointActions;
if (!breakpointActionsFromProtocol(errorString, actions, &breakpointActions))
return;
@@ -317,7 +317,7 @@
actions = (*options)->getArray(ASCIILiteral("actions"));
}
- Vector<ScriptBreakpointAction> breakpointActions;
+ BreakpointActions breakpointActions;
if (!breakpointActionsFromProtocol(errorString, actions, &breakpointActions))
return;
@@ -342,7 +342,7 @@
m_javaScriptBreakpoints.remove(breakpointIdentifier);
for (JSC::BreakpointID breakpointID : m_breakpointIdentifierToDebugServerBreakpointIDs.take(breakpointIdentifier)) {
- const Vector<ScriptBreakpointAction>& breakpointActions = scriptDebugServer().getActionsForBreakpoint(breakpointID);
+ const BreakpointActions& breakpointActions = scriptDebugServer().getActionsForBreakpoint(breakpointID);
for (auto& action : breakpointActions)
m_injectedScriptManager->releaseObjectGroup(objectGroupForBreakpointAction(action));
Modified: trunk/Source/_javascript_Core/inspector/agents/InspectorDebuggerAgent.h (167815 => 167816)
--- trunk/Source/_javascript_Core/inspector/agents/InspectorDebuggerAgent.h 2014-04-25 19:41:56 UTC (rev 167815)
+++ trunk/Source/_javascript_Core/inspector/agents/InspectorDebuggerAgent.h 2014-04-25 19:45:06 UTC (rev 167816)
@@ -143,7 +143,7 @@
void clearInspectorBreakpointState();
void clearBreakDetails();
- bool breakpointActionsFromProtocol(ErrorString*, RefPtr<InspectorArray>& actions, Vector<ScriptBreakpointAction>* result);
+ bool breakpointActionsFromProtocol(ErrorString*, RefPtr<InspectorArray>& actions, BreakpointActions* result);
typedef HashMap<JSC::SourceID, Script> ScriptsMap;
typedef HashMap<String, Vector<JSC::BreakpointID>> BreakpointIdentifierToDebugServerBreakpointIDsMap;