Changeset 167816 in webkit


Ignore:
Timestamp:
Apr 25, 2014 12:45:06 PM (10 years ago)
Author:
mark.lam@apple.com
Message:

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:
Location:
trunk/Source/JavaScriptCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r167814 r167816  
     12014-04-25  Mark Lam  <mark.lam@apple.com>
     2
     3        Refactor debugging code to use BreakpointActions instead of Vector<ScriptBreakpointAction>.
     4        <https://webkit.org/b/132201>
     5
     6        Reviewed by Joseph Pecoraro.
     7
     8        BreakpointActions is Vector<ScriptBreakpointAction>.  Let's just consistently use
     9        BreakpointActions everywhere.
     10
     11        * inspector/ScriptBreakpoint.h:
     12        (Inspector::ScriptBreakpoint::ScriptBreakpoint):
     13        * inspector/ScriptDebugServer.cpp:
     14        (Inspector::ScriptDebugServer::setBreakpoint):
     15        (Inspector::ScriptDebugServer::getActionsForBreakpoint):
     16        * inspector/ScriptDebugServer.h:
     17        * inspector/agents/InspectorDebuggerAgent.cpp:
     18        (Inspector::InspectorDebuggerAgent::breakpointActionsFromProtocol):
     19        (Inspector::InspectorDebuggerAgent::setBreakpointByUrl):
     20        (Inspector::InspectorDebuggerAgent::setBreakpoint):
     21        (Inspector::InspectorDebuggerAgent::removeBreakpoint):
     22        * inspector/agents/InspectorDebuggerAgent.h:
     23
    1242014-04-24  Filip Pizlo  <fpizlo@apple.com>
    225
  • trunk/Source/JavaScriptCore/inspector/ScriptBreakpoint.h

    r165676 r167816  
    5656};
    5757
     58typedef Vector<ScriptBreakpointAction> BreakpointActions;
     59
    5860struct ScriptBreakpoint {
    5961    ScriptBreakpoint()
     
    6971    }
    7072
    71     ScriptBreakpoint(int lineNumber, int columnNumber, const String& condition, Vector<ScriptBreakpointAction>& actions, bool autoContinue)
     73    ScriptBreakpoint(int lineNumber, int columnNumber, const String& condition, BreakpointActions& actions, bool autoContinue)
    7274        : lineNumber(lineNumber)
    7375        , columnNumber(columnNumber)
     
    8183    int columnNumber;
    8284    String condition;
    83     Vector<ScriptBreakpointAction> actions;
     85    BreakpointActions actions;
    8486    bool autoContinue;
    8587};
  • trunk/Source/JavaScriptCore/inspector/ScriptDebugServer.cpp

    r165676 r167816  
    7171        ASSERT(it == m_breakpointIDToActions.end());
    7272#endif
    73         const Vector<ScriptBreakpointAction> &actions = scriptBreakpoint.actions;
     73        const BreakpointActions& actions = scriptBreakpoint.actions;
    7474        m_breakpointIDToActions.set(id, actions);
    7575    }
     
    325325}
    326326
    327 const Vector<ScriptBreakpointAction>& ScriptDebugServer::getActionsForBreakpoint(JSC::BreakpointID breakpointID)
     327const BreakpointActions& ScriptDebugServer::getActionsForBreakpoint(JSC::BreakpointID breakpointID)
    328328{
    329329    ASSERT(breakpointID != JSC::noBreakpointID);
     
    332332        return m_breakpointIDToActions.find(breakpointID)->value;
    333333   
    334     static NeverDestroyed<Vector<ScriptBreakpointAction>> emptyActionVector = Vector<ScriptBreakpointAction>();
     334    static NeverDestroyed<BreakpointActions> emptyActionVector = BreakpointActions();
    335335    return emptyActionVector;
    336336}
  • trunk/Source/JavaScriptCore/inspector/ScriptDebugServer.h

    r165676 r167816  
    5959    virtual void recompileAllJSFunctions() = 0;
    6060
    61     const Vector<ScriptBreakpointAction>& getActionsForBreakpoint(JSC::BreakpointID);
     61    const BreakpointActions& getActionsForBreakpoint(JSC::BreakpointID);
    6262
    6363    class Task {
     
    9797
    9898private:
    99     typedef Vector<ScriptBreakpointAction> BreakpointActions;
    10099    typedef HashMap<JSC::BreakpointID, BreakpointActions> BreakpointIDToActionsMap;
    101100
  • trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp

    r165676 r167816  
    196196}
    197197
    198 bool InspectorDebuggerAgent::breakpointActionsFromProtocol(ErrorString* errorString, RefPtr<InspectorArray>& actions, Vector<ScriptBreakpointAction>* result)
     198bool InspectorDebuggerAgent::breakpointActionsFromProtocol(ErrorString* errorString, RefPtr<InspectorArray>& actions, BreakpointActions* result)
    199199{
    200200    if (!actions)
     
    267267    }
    268268
    269     Vector<ScriptBreakpointAction> breakpointActions;
     269    BreakpointActions breakpointActions;
    270270    if (!breakpointActionsFromProtocol(errorString, actions, &breakpointActions))
    271271        return;
     
    318318    }
    319319
    320     Vector<ScriptBreakpointAction> breakpointActions;
     320    BreakpointActions breakpointActions;
    321321    if (!breakpointActionsFromProtocol(errorString, actions, &breakpointActions))
    322322        return;
     
    343343
    344344    for (JSC::BreakpointID breakpointID : m_breakpointIdentifierToDebugServerBreakpointIDs.take(breakpointIdentifier)) {
    345         const Vector<ScriptBreakpointAction>& breakpointActions = scriptDebugServer().getActionsForBreakpoint(breakpointID);
     345        const BreakpointActions& breakpointActions = scriptDebugServer().getActionsForBreakpoint(breakpointID);
    346346        for (auto& action : breakpointActions)
    347347            m_injectedScriptManager->releaseObjectGroup(objectGroupForBreakpointAction(action));
  • trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h

    r165676 r167816  
    144144    void clearBreakDetails();
    145145
    146     bool breakpointActionsFromProtocol(ErrorString*, RefPtr<InspectorArray>& actions, Vector<ScriptBreakpointAction>* result);
     146    bool breakpointActionsFromProtocol(ErrorString*, RefPtr<InspectorArray>& actions, BreakpointActions* result);
    147147
    148148    typedef HashMap<JSC::SourceID, Script> ScriptsMap;
Note: See TracChangeset for help on using the changeset viewer.