Changeset 190790 in webkit


Ignore:
Timestamp:
Oct 9, 2015 7:21:37 AM (9 years ago)
Author:
matthew_hanson@apple.com
Message:

Merge r189834. rdar://problem/22807373

Location:
branches/safari-601.1.46-branch/Source
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-601.1.46-branch/Source/JavaScriptCore/ChangeLog

    r190788 r190790  
     12015-10-08  Matthew Hanson  <matthew_hanson@apple.com>
     2
     3        Merge r189834. rdar://problem/22807373
     4
     5    2015-09-15  Joseph Pecoraro  <pecoraro@apple.com>
     6
     7            Web Inspector: Paused Debugger prevents page reload
     8            https://bugs.webkit.org/show_bug.cgi?id=148174
     9
     10            Reviewed by Brian Burg.
     11
     12            * debugger/Debugger.h:
     13            (JSC::Debugger::suppressAllPauses):
     14            (JSC::Debugger::setSuppressAllPauses):
     15            * debugger/Debugger.cpp:
     16            (JSC::Debugger::Debugger):
     17            (JSC::Debugger::pauseIfNeeded):
     18            * inspector/agents/InspectorDebuggerAgent.h:
     19            * inspector/agents/InspectorDebuggerAgent.cpp:
     20            (Inspector::InspectorDebuggerAgent::setSuppressAllPauses):
     21            Provide a way to suppress pauses.
     22
    1232015-10-08  Matthew Hanson  <matthew_hanson@apple.com>
    224
  • branches/safari-601.1.46-branch/Source/JavaScriptCore/debugger/Debugger.cpp

    r186279 r190790  
    161161    , m_hasHandlerForExceptionCallback(false)
    162162    , m_isInWorkerThread(isInWorkerThread)
     163    , m_suppressAllPauses(false)
    163164    , m_steppingMode(SteppingModeDisabled)
    164165    , m_reasonForPause(NotPaused)
     
    649650        return;
    650651
     652    if (m_suppressAllPauses)
     653        return;
     654
    651655    JSGlobalObject* vmEntryGlobalObject = callFrame->vmEntryGlobalObject();
    652656    if (!needPauseHandling(vmEntryGlobalObject))
  • branches/safari-601.1.46-branch/Source/JavaScriptCore/debugger/Debugger.h

    r185608 r190790  
    109109    bool isStepping() const { return m_steppingMode == SteppingModeEnabled; }
    110110
     111    bool suppressAllPauses() const { return m_suppressAllPauses; }
     112    void setSuppressAllPauses(bool suppress) { m_suppressAllPauses = suppress; }
     113
    111114    virtual void sourceParsed(ExecState*, SourceProvider*, int errorLineNumber, const WTF::String& errorMessage) = 0;
    112115
     
    197200    bool m_hasHandlerForExceptionCallback : 1;
    198201    bool m_isInWorkerThread : 1;
     202    bool m_suppressAllPauses : 1;
    199203    unsigned m_steppingMode : 1; // SteppingMode
    200204
  • branches/safari-601.1.46-branch/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp

    r186279 r190790  
    135135{
    136136    return scriptDebugServer().isPaused();
     137}
     138
     139void InspectorDebuggerAgent::setSuppressAllPauses(bool suppress)
     140{
     141    scriptDebugServer().setSuppressAllPauses(suppress);
    137142}
    138143
  • branches/safari-601.1.46-branch/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h

    r185722 r190790  
    8989
    9090    bool isPaused();
    91    
     91
     92    void setSuppressAllPauses(bool);
     93
    9294    void handleConsoleAssert(const String& message);
    9395
  • branches/safari-601.1.46-branch/Source/WebCore/ChangeLog

    r190786 r190790  
     12015-10-08  Matthew Hanson  <matthew_hanson@apple.com>
     2
     3        Merge r189834. rdar://problem/22807373
     4
     5    2015-09-15  Joseph Pecoraro  <pecoraro@apple.com>
     6
     7            Web Inspector: Paused Debugger prevents page reload
     8            https://bugs.webkit.org/show_bug.cgi?id=148174
     9
     10            Reviewed by Brian Burg.
     11
     12            When navigating the page while paused, suppress any pausing until the page
     13            has completed navigation. If not paused and navigating, you can still pause
     14            in pagehide and unload handlers or other late page events.
     15
     16            Could not write a reliable test for this at the moment.
     17            InspectorTest.reloadPage has multiple issues with the output,
     18            so I'll investigate making reload tests more reliable later.
     19
     20            * inspector/InspectorController.h:
     21            * inspector/InspectorController.cpp:
     22            (WebCore::InspectorController::resume): Deleted.
     23            * loader/FrameLoader.cpp:
     24            (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
     25            We now use existing InspectorInstrumentation functions instead of a method
     26            on InspectorController during load. In dropping the method InspectorController
     27            can drop a member variable no longer used.
     28
     29            * inspector/InspectorInstrumentation.h:
     30            (WebCore::InspectorInstrumentation::willStartProvisionalLoad):
     31            Add a new instrumentation hook.
     32
     33            * inspector/InspectorInstrumentation.cpp:
     34            (WebCore::InspectorInstrumentation::willStartProvisionalLoadImpl):
     35            (WebCore::InspectorInstrumentation::didCommitLoadImpl):
     36            When starting or completing main frame navigations, let the PageDebuggerAgent do some work.
     37
     38            * inspector/PageDebuggerAgent.h:
     39            * inspector/PageDebuggerAgent.cpp:
     40            (WebCore::PageDebuggerAgent::mainFrameStartedLoading):
     41            (WebCore::PageDebuggerAgent::mainFrameStoppedLoading):
     42            (WebCore::PageDebuggerAgent::mainFrameNavigated):
     43            Suppress pausing if navigating while paused. Otherwise behave as normal.
     44
    1452015-10-08  Matthew Hanson  <matthew_hanson@apple.com>
    246
  • branches/safari-601.1.46-branch/Source/WebCore/inspector/InspectorController.cpp

    r186279 r190790  
    151151
    152152    auto debuggerAgentPtr = std::make_unique<PageDebuggerAgent>(m_injectedScriptManager.get(), m_instrumentingAgents.get(), pageAgent, m_overlay.get());
    153     m_debuggerAgent = debuggerAgentPtr.get();
     153    PageDebuggerAgent* debuggerAgent = debuggerAgentPtr.get();
    154154    m_agents.append(WTF::move(debuggerAgentPtr));
    155155
    156     auto domDebuggerAgentPtr = std::make_unique<InspectorDOMDebuggerAgent>(m_instrumentingAgents.get(), m_domAgent, m_debuggerAgent);
     156    auto domDebuggerAgentPtr = std::make_unique<InspectorDOMDebuggerAgent>(m_instrumentingAgents.get(), m_domAgent, debuggerAgent);
    157157    m_domDebuggerAgent = domDebuggerAgentPtr.get();
    158158    m_agents.append(WTF::move(domDebuggerAgentPtr));
     
    172172    }
    173173
    174     runtimeAgent->setScriptDebugServer(&m_debuggerAgent->scriptDebugServer());
    175     m_timelineAgent->setPageScriptDebugServer(&m_debuggerAgent->scriptDebugServer());
     174    runtimeAgent->setScriptDebugServer(&debuggerAgent->scriptDebugServer());
     175    m_timelineAgent->setPageScriptDebugServer(&debuggerAgent->scriptDebugServer());
    176176}
    177177
     
    398398}
    399399
    400 void InspectorController::resume()
    401 {
    402     if (m_debuggerAgent) {
    403         ErrorString unused;
    404         m_debuggerAgent->resume(unused);
    405     }
    406 }
    407 
    408400bool InspectorController::developerExtrasEnabled() const
    409401{
  • branches/safari-601.1.46-branch/Source/WebCore/inspector/InspectorController.h

    r186133 r190790  
    124124    WEBCORE_EXPORT void setProfilerEnabled(bool);
    125125
    126     void resume();
    127 
    128126    InspectorClient* inspectorClient() const { return m_inspectorClient; }
    129127    InspectorPageAgent* pageAgent() const { return m_pageAgent; }
     
    151149    InspectorResourceAgent* m_resourceAgent;
    152150    InspectorPageAgent* m_pageAgent;
    153     PageDebuggerAgent* m_debuggerAgent;
    154151    InspectorDOMDebuggerAgent* m_domDebuggerAgent;
    155152    InspectorTimelineAgent* m_timelineAgent;
  • branches/safari-601.1.46-branch/Source/WebCore/inspector/InspectorInstrumentation.cpp

    r186133 r190790  
    773773        if (InspectorLayerTreeAgent* layerTreeAgent = instrumentingAgents.inspectorLayerTreeAgent())
    774774            layerTreeAgent->reset();
     775
     776        if (PageDebuggerAgent* pageDebuggerAgent = instrumentingAgents.pageDebuggerAgent())
     777            pageDebuggerAgent->mainFrameNavigated();
    775778    }
    776779
     
    803806void InspectorInstrumentation::frameStartedLoadingImpl(InstrumentingAgents& instrumentingAgents, Frame& frame)
    804807{
     808    if (frame.isMainFrame()) {
     809        if (PageDebuggerAgent* pageDebuggerAgent = instrumentingAgents.pageDebuggerAgent())
     810            pageDebuggerAgent->mainFrameStartedLoading();
     811    }
     812
    805813    if (InspectorPageAgent* inspectorPageAgent = instrumentingAgents.inspectorPageAgent())
    806814        inspectorPageAgent->frameStartedLoading(frame);
     
    809817void InspectorInstrumentation::frameStoppedLoadingImpl(InstrumentingAgents& instrumentingAgents, Frame& frame)
    810818{
     819    if (frame.isMainFrame()) {
     820        if (PageDebuggerAgent* pageDebuggerAgent = instrumentingAgents.pageDebuggerAgent())
     821            pageDebuggerAgent->mainFrameStoppedLoading();
     822    }
     823
    811824    if (InspectorPageAgent* inspectorPageAgent = instrumentingAgents.inspectorPageAgent())
    812825        inspectorPageAgent->frameStoppedLoading(frame);
  • branches/safari-601.1.46-branch/Source/WebCore/inspector/PageDebuggerAgent.cpp

    r180653 r190790  
    145145}
    146146
     147void PageDebuggerAgent::mainFrameStartedLoading()
     148{
     149    if (isPaused()) {
     150        setSuppressAllPauses(true);
     151        ErrorString unused;
     152        resume(unused);
     153    }
     154}
     155
     156void PageDebuggerAgent::mainFrameStoppedLoading()
     157{
     158    setSuppressAllPauses(false);
     159}
     160
     161void PageDebuggerAgent::mainFrameNavigated()
     162{
     163    setSuppressAllPauses(false);
     164}
     165
    147166} // namespace WebCore
  • branches/safari-601.1.46-branch/Source/WebCore/inspector/PageDebuggerAgent.h

    r178820 r190790  
    5252    void didClearMainFrameWindowObject();
    5353
     54    void mainFrameStartedLoading();
     55    void mainFrameStoppedLoading();
     56    void mainFrameNavigated();
     57
    5458    virtual PageScriptDebugServer& scriptDebugServer() override;
    5559
  • branches/safari-601.1.46-branch/Source/WebCore/loader/FrameLoader.cpp

    r187980 r190790  
    29832983        return;
    29842984
    2985     if (Page* page = m_frame.page()) {
    2986         if (m_frame.isMainFrame())
    2987             page->inspectorController().resume();
    2988     }
    2989 
    29902985    setProvisionalDocumentLoader(m_policyDocumentLoader.get());
    29912986    m_loadType = type;
Note: See TracChangeset for help on using the changeset viewer.