Changeset 86581 in webkit


Ignore:
Timestamp:
May 16, 2011 9:58:15 AM (13 years ago)
Author:
podivilov@chromium.org
Message:

2011-05-16 Pavel Podivilov <podivilov@chromium.org>

Reviewed by Yury Semikhatsky.

Web Inspector: debuggerWasEnabled notification should not be send to front-end on navigation.
https://bugs.webkit.org/show_bug.cgi?id=60888

  • inspector/InspectorController.cpp: (WebCore::InspectorController::disableDebugger):
  • inspector/InspectorDebuggerAgent.cpp: (WebCore::InspectorDebuggerAgent::enable): (WebCore::InspectorDebuggerAgent::disable): (WebCore::InspectorDebuggerAgent::restore): (WebCore::InspectorDebuggerAgent::clearFrontend):
  • inspector/InspectorDebuggerAgent.h:
Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r86566 r86581  
     12011-05-16  Pavel Podivilov  <podivilov@chromium.org>
     2
     3        Reviewed by Yury Semikhatsky.
     4
     5        Web Inspector: debuggerWasEnabled notification should not be send to front-end on navigation.
     6        https://bugs.webkit.org/show_bug.cgi?id=60888
     7
     8        * inspector/InspectorController.cpp:
     9        (WebCore::InspectorController::disableDebugger):
     10        * inspector/InspectorDebuggerAgent.cpp:
     11        (WebCore::InspectorDebuggerAgent::enable):
     12        (WebCore::InspectorDebuggerAgent::disable):
     13        (WebCore::InspectorDebuggerAgent::restore):
     14        (WebCore::InspectorDebuggerAgent::clearFrontend):
     15        * inspector/InspectorDebuggerAgent.h:
     16
    1172011-05-16  Yury Semikhatsky  <yurys@chromium.org>
    218
  • trunk/Source/WebCore/inspector/InspectorController.cpp

    r86564 r86581  
    448448void InspectorController::disableDebugger()
    449449{
    450     m_debuggerAgent->disable();
     450    ErrorString error;
     451    m_debuggerAgent->disable(&error);
    451452}
    452453
  • trunk/Source/WebCore/inspector/InspectorDebuggerAgent.cpp

    r86542 r86581  
    6565}
    6666
    67 void InspectorDebuggerAgent::enable(bool restoringFromState)
    68 {
    69     ASSERT(m_frontend);
    70     if (!restoringFromState && enabled())
    71         return;
    72     m_inspectorState->setBoolean(DebuggerAgentState::debuggerEnabled, true);
     67void InspectorDebuggerAgent::enable()
     68{
    7369    m_instrumentingAgents->setInspectorDebuggerAgent(this);
    7470
    75     scriptDebugServer().clearBreakpoints();
    7671    // FIXME(WK44513): breakpoints activated flag should be synchronized between all front-ends
    7772    scriptDebugServer().setBreakpointsActivated(true);
    7873    startListeningScriptDebugServer();
    7974
    80     m_frontend->debuggerWasEnabled();
    8175    if (m_listener)
    8276        m_listener->debuggerWasEnabled();
     
    8579void InspectorDebuggerAgent::disable()
    8680{
    87     if (!enabled())
    88         return;
    89     m_inspectorState->setBoolean(DebuggerAgentState::debuggerEnabled, false);
    9081    m_inspectorState->setObject(DebuggerAgentState::javaScriptBreakpoints, InspectorObject::create());
    9182    m_instrumentingAgents->setInspectorDebuggerAgent(0);
    9283
    9384    stopListeningScriptDebugServer();
     85    scriptDebugServer().clearBreakpoints();
    9486    clear();
     87
     88    if (m_listener)
     89        m_listener->debuggerWasDisabled();
     90}
     91
     92bool InspectorDebuggerAgent::enabled()
     93{
     94    return m_inspectorState->getBoolean(DebuggerAgentState::debuggerEnabled);
     95}
     96
     97void InspectorDebuggerAgent::enable(ErrorString*)
     98{
     99    if (enabled())
     100        return;
     101
     102    enable();
     103    m_inspectorState->setBoolean(DebuggerAgentState::debuggerEnabled, true);
     104
     105    ASSERT(m_frontend);
     106    m_frontend->debuggerWasEnabled();
     107}
     108
     109void InspectorDebuggerAgent::disable(ErrorString*)
     110{
     111    if (!enabled())
     112        return;
     113
     114    disable();
     115    m_inspectorState->setBoolean(DebuggerAgentState::debuggerEnabled, false);
    95116
    96117    if (m_frontend)
    97118        m_frontend->debuggerWasDisabled();
    98     if (m_listener)
    99         m_listener->debuggerWasDisabled();
    100 }
    101 
    102 bool InspectorDebuggerAgent::enabled()
    103 {
    104     return m_inspectorState->getBoolean(DebuggerAgentState::debuggerEnabled);
    105119}
    106120
    107121void InspectorDebuggerAgent::restore()
    108122{
    109     if (m_inspectorState->getBoolean(DebuggerAgentState::debuggerEnabled))
    110         enable(true);
     123    if (enabled())
     124        enable();
    111125}
    112126
     
    122136    if (!enabled())
    123137        return;
    124     // If the window is being closed with the debugger enabled,
    125     // remember this state to re-enable debugger on the next window
    126     // opening.
     138
    127139    disable();
     140
     141    // FIXME: due to m_state->mute() hack in InspectorController, debuggerEnabled is actually set to false only
     142    // in InspectorState, but not in cookie. That's why after navigation debuggerEnabled will be true,
     143    // but after front-end re-open it will still be false.
     144    m_inspectorState->setBoolean(DebuggerAgentState::debuggerEnabled, false);
    128145}
    129146
  • trunk/Source/WebCore/inspector/InspectorDebuggerAgent.h

    r85321 r86581  
    6969    virtual ~InspectorDebuggerAgent();
    7070
    71     void enable(ErrorString*) { enable(false); }
    72     void disable(ErrorString*) { disable(); }
    73     void disable();
     71    void enable(ErrorString*);
     72    void disable(ErrorString*);
    7473    bool enabled();
    7574    void restore();
     
    117116
    118117private:
    119     void enable(bool restoringFromState);
     118    void enable();
     119    void disable();
    120120
    121121    PassRefPtr<InspectorArray> currentCallFrames();
Note: See TracChangeset for help on using the changeset viewer.