Title: [190790] branches/safari-601.1.46-branch/Source

Diff

Modified: branches/safari-601.1.46-branch/Source/_javascript_Core/ChangeLog (190789 => 190790)


--- branches/safari-601.1.46-branch/Source/_javascript_Core/ChangeLog	2015-10-09 14:21:29 UTC (rev 190789)
+++ branches/safari-601.1.46-branch/Source/_javascript_Core/ChangeLog	2015-10-09 14:21:37 UTC (rev 190790)
@@ -1,5 +1,27 @@
 2015-10-08  Matthew Hanson  <matthew_han...@apple.com>
 
+        Merge r189834. rdar://problem/22807373
+
+    2015-09-15  Joseph Pecoraro  <pecor...@apple.com>
+
+            Web Inspector: Paused Debugger prevents page reload
+            https://bugs.webkit.org/show_bug.cgi?id=148174
+
+            Reviewed by Brian Burg.
+
+            * debugger/Debugger.h:
+            (JSC::Debugger::suppressAllPauses):
+            (JSC::Debugger::setSuppressAllPauses):
+            * debugger/Debugger.cpp:
+            (JSC::Debugger::Debugger):
+            (JSC::Debugger::pauseIfNeeded):
+            * inspector/agents/InspectorDebuggerAgent.h:
+            * inspector/agents/InspectorDebuggerAgent.cpp:
+            (Inspector::InspectorDebuggerAgent::setSuppressAllPauses):
+            Provide a way to suppress pauses.
+
+2015-10-08  Matthew Hanson  <matthew_han...@apple.com>
+
         Merge r189460. rdar://problem/22823239
 
     2015-09-06  Mark Lam  <mark....@apple.com>

Modified: branches/safari-601.1.46-branch/Source/_javascript_Core/debugger/Debugger.cpp (190789 => 190790)


--- branches/safari-601.1.46-branch/Source/_javascript_Core/debugger/Debugger.cpp	2015-10-09 14:21:29 UTC (rev 190789)
+++ branches/safari-601.1.46-branch/Source/_javascript_Core/debugger/Debugger.cpp	2015-10-09 14:21:37 UTC (rev 190790)
@@ -160,6 +160,7 @@
     , m_breakpointsActivated(true)
     , m_hasHandlerForExceptionCallback(false)
     , m_isInWorkerThread(isInWorkerThread)
+    , m_suppressAllPauses(false)
     , m_steppingMode(SteppingModeDisabled)
     , m_reasonForPause(NotPaused)
     , m_pauseOnCallFrame(0)
@@ -648,6 +649,9 @@
     if (m_isPaused)
         return;
 
+    if (m_suppressAllPauses)
+        return;
+
     JSGlobalObject* vmEntryGlobalObject = callFrame->vmEntryGlobalObject();
     if (!needPauseHandling(vmEntryGlobalObject))
         return;

Modified: branches/safari-601.1.46-branch/Source/_javascript_Core/debugger/Debugger.h (190789 => 190790)


--- branches/safari-601.1.46-branch/Source/_javascript_Core/debugger/Debugger.h	2015-10-09 14:21:29 UTC (rev 190789)
+++ branches/safari-601.1.46-branch/Source/_javascript_Core/debugger/Debugger.h	2015-10-09 14:21:37 UTC (rev 190790)
@@ -108,6 +108,9 @@
     bool isPaused() const { return m_isPaused; }
     bool isStepping() const { return m_steppingMode == SteppingModeEnabled; }
 
+    bool suppressAllPauses() const { return m_suppressAllPauses; }
+    void setSuppressAllPauses(bool suppress) { m_suppressAllPauses = suppress; }
+
     virtual void sourceParsed(ExecState*, SourceProvider*, int errorLineNumber, const WTF::String& errorMessage) = 0;
 
     void exception(CallFrame*, JSValue exceptionValue, bool hasCatchHandler);
@@ -196,6 +199,7 @@
     bool m_breakpointsActivated : 1;
     bool m_hasHandlerForExceptionCallback : 1;
     bool m_isInWorkerThread : 1;
+    bool m_suppressAllPauses : 1;
     unsigned m_steppingMode : 1; // SteppingMode
 
     ReasonForPause m_reasonForPause;

Modified: branches/safari-601.1.46-branch/Source/_javascript_Core/inspector/agents/InspectorDebuggerAgent.cpp (190789 => 190790)


--- branches/safari-601.1.46-branch/Source/_javascript_Core/inspector/agents/InspectorDebuggerAgent.cpp	2015-10-09 14:21:29 UTC (rev 190789)
+++ branches/safari-601.1.46-branch/Source/_javascript_Core/inspector/agents/InspectorDebuggerAgent.cpp	2015-10-09 14:21:37 UTC (rev 190790)
@@ -136,6 +136,11 @@
     return scriptDebugServer().isPaused();
 }
 
+void InspectorDebuggerAgent::setSuppressAllPauses(bool suppress)
+{
+    scriptDebugServer().setSuppressAllPauses(suppress);
+}
+
 static RefPtr<InspectorObject> buildAssertPauseReason(const String& message)
 {
     auto reason = Inspector::Protocol::Debugger::AssertPauseReason::create().release();

Modified: branches/safari-601.1.46-branch/Source/_javascript_Core/inspector/agents/InspectorDebuggerAgent.h (190789 => 190790)


--- branches/safari-601.1.46-branch/Source/_javascript_Core/inspector/agents/InspectorDebuggerAgent.h	2015-10-09 14:21:29 UTC (rev 190789)
+++ branches/safari-601.1.46-branch/Source/_javascript_Core/inspector/agents/InspectorDebuggerAgent.h	2015-10-09 14:21:37 UTC (rev 190790)
@@ -88,7 +88,9 @@
     virtual void setOverlayMessage(ErrorString&, const String*) override;
 
     bool isPaused();
-    
+
+    void setSuppressAllPauses(bool);
+
     void handleConsoleAssert(const String& message);
 
     void schedulePauseOnNextStatement(DebuggerFrontendDispatcher::Reason breakReason, RefPtr<InspectorObject>&& data);

Modified: branches/safari-601.1.46-branch/Source/WebCore/ChangeLog (190789 => 190790)


--- branches/safari-601.1.46-branch/Source/WebCore/ChangeLog	2015-10-09 14:21:29 UTC (rev 190789)
+++ branches/safari-601.1.46-branch/Source/WebCore/ChangeLog	2015-10-09 14:21:37 UTC (rev 190790)
@@ -1,5 +1,49 @@
 2015-10-08  Matthew Hanson  <matthew_han...@apple.com>
 
+        Merge r189834. rdar://problem/22807373
+
+    2015-09-15  Joseph Pecoraro  <pecor...@apple.com>
+
+            Web Inspector: Paused Debugger prevents page reload
+            https://bugs.webkit.org/show_bug.cgi?id=148174
+
+            Reviewed by Brian Burg.
+
+            When navigating the page while paused, suppress any pausing until the page
+            has completed navigation. If not paused and navigating, you can still pause
+            in pagehide and unload handlers or other late page events.
+
+            Could not write a reliable test for this at the moment.
+            InspectorTest.reloadPage has multiple issues with the output,
+            so I'll investigate making reload tests more reliable later.
+
+            * inspector/InspectorController.h:
+            * inspector/InspectorController.cpp:
+            (WebCore::InspectorController::resume): Deleted.
+            * loader/FrameLoader.cpp:
+            (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
+            We now use existing InspectorInstrumentation functions instead of a method
+            on InspectorController during load. In dropping the method InspectorController
+            can drop a member variable no longer used.
+
+            * inspector/InspectorInstrumentation.h:
+            (WebCore::InspectorInstrumentation::willStartProvisionalLoad):
+            Add a new instrumentation hook.
+
+            * inspector/InspectorInstrumentation.cpp:
+            (WebCore::InspectorInstrumentation::willStartProvisionalLoadImpl):
+            (WebCore::InspectorInstrumentation::didCommitLoadImpl):
+            When starting or completing main frame navigations, let the PageDebuggerAgent do some work.
+
+            * inspector/PageDebuggerAgent.h:
+            * inspector/PageDebuggerAgent.cpp:
+            (WebCore::PageDebuggerAgent::mainFrameStartedLoading):
+            (WebCore::PageDebuggerAgent::mainFrameStoppedLoading):
+            (WebCore::PageDebuggerAgent::mainFrameNavigated):
+            Suppress pausing if navigating while paused. Otherwise behave as normal.
+
+2015-10-08  Matthew Hanson  <matthew_han...@apple.com>
+
         Merge r189421. rdar://problem/22823243
 
     2015-09-04  Myles C. Maxfield  <mmaxfi...@apple.com>

Modified: branches/safari-601.1.46-branch/Source/WebCore/inspector/InspectorController.cpp (190789 => 190790)


--- branches/safari-601.1.46-branch/Source/WebCore/inspector/InspectorController.cpp	2015-10-09 14:21:29 UTC (rev 190789)
+++ branches/safari-601.1.46-branch/Source/WebCore/inspector/InspectorController.cpp	2015-10-09 14:21:37 UTC (rev 190790)
@@ -150,10 +150,10 @@
     m_agents.append(WTF::move(consoleAgentPtr));
 
     auto debuggerAgentPtr = std::make_unique<PageDebuggerAgent>(m_injectedScriptManager.get(), m_instrumentingAgents.get(), pageAgent, m_overlay.get());
-    m_debuggerAgent = debuggerAgentPtr.get();
+    PageDebuggerAgent* debuggerAgent = debuggerAgentPtr.get();
     m_agents.append(WTF::move(debuggerAgentPtr));
 
-    auto domDebuggerAgentPtr = std::make_unique<InspectorDOMDebuggerAgent>(m_instrumentingAgents.get(), m_domAgent, m_debuggerAgent);
+    auto domDebuggerAgentPtr = std::make_unique<InspectorDOMDebuggerAgent>(m_instrumentingAgents.get(), m_domAgent, debuggerAgent);
     m_domDebuggerAgent = domDebuggerAgentPtr.get();
     m_agents.append(WTF::move(domDebuggerAgentPtr));
 
@@ -171,8 +171,8 @@
         );
     }
 
-    runtimeAgent->setScriptDebugServer(&m_debuggerAgent->scriptDebugServer());
-    m_timelineAgent->setPageScriptDebugServer(&m_debuggerAgent->scriptDebugServer());
+    runtimeAgent->setScriptDebugServer(&debuggerAgent->scriptDebugServer());
+    m_timelineAgent->setPageScriptDebugServer(&debuggerAgent->scriptDebugServer());
 }
 
 InspectorController::~InspectorController()
@@ -397,14 +397,6 @@
     }
 }
 
-void InspectorController::resume()
-{
-    if (m_debuggerAgent) {
-        ErrorString unused;
-        m_debuggerAgent->resume(unused);
-    }
-}
-
 bool InspectorController::developerExtrasEnabled() const
 {
     return m_page.settings().developerExtrasEnabled();

Modified: branches/safari-601.1.46-branch/Source/WebCore/inspector/InspectorController.h (190789 => 190790)


--- branches/safari-601.1.46-branch/Source/WebCore/inspector/InspectorController.h	2015-10-09 14:21:29 UTC (rev 190789)
+++ branches/safari-601.1.46-branch/Source/WebCore/inspector/InspectorController.h	2015-10-09 14:21:37 UTC (rev 190790)
@@ -123,8 +123,6 @@
     WEBCORE_EXPORT bool profilerEnabled() const;
     WEBCORE_EXPORT void setProfilerEnabled(bool);
 
-    void resume();
-
     InspectorClient* inspectorClient() const { return m_inspectorClient; }
     InspectorPageAgent* pageAgent() const { return m_pageAgent; }
 
@@ -150,7 +148,6 @@
     InspectorDOMAgent* m_domAgent;
     InspectorResourceAgent* m_resourceAgent;
     InspectorPageAgent* m_pageAgent;
-    PageDebuggerAgent* m_debuggerAgent;
     InspectorDOMDebuggerAgent* m_domDebuggerAgent;
     InspectorTimelineAgent* m_timelineAgent;
 

Modified: branches/safari-601.1.46-branch/Source/WebCore/inspector/InspectorInstrumentation.cpp (190789 => 190790)


--- branches/safari-601.1.46-branch/Source/WebCore/inspector/InspectorInstrumentation.cpp	2015-10-09 14:21:29 UTC (rev 190789)
+++ branches/safari-601.1.46-branch/Source/WebCore/inspector/InspectorInstrumentation.cpp	2015-10-09 14:21:37 UTC (rev 190790)
@@ -772,6 +772,9 @@
 
         if (InspectorLayerTreeAgent* layerTreeAgent = instrumentingAgents.inspectorLayerTreeAgent())
             layerTreeAgent->reset();
+
+        if (PageDebuggerAgent* pageDebuggerAgent = instrumentingAgents.pageDebuggerAgent())
+            pageDebuggerAgent->mainFrameNavigated();
     }
 
     if (InspectorDOMAgent* domAgent = instrumentingAgents.inspectorDOMAgent())
@@ -802,12 +805,22 @@
 
 void InspectorInstrumentation::frameStartedLoadingImpl(InstrumentingAgents& instrumentingAgents, Frame& frame)
 {
+    if (frame.isMainFrame()) {
+        if (PageDebuggerAgent* pageDebuggerAgent = instrumentingAgents.pageDebuggerAgent())
+            pageDebuggerAgent->mainFrameStartedLoading();
+    }
+
     if (InspectorPageAgent* inspectorPageAgent = instrumentingAgents.inspectorPageAgent())
         inspectorPageAgent->frameStartedLoading(frame);
 }
 
 void InspectorInstrumentation::frameStoppedLoadingImpl(InstrumentingAgents& instrumentingAgents, Frame& frame)
 {
+    if (frame.isMainFrame()) {
+        if (PageDebuggerAgent* pageDebuggerAgent = instrumentingAgents.pageDebuggerAgent())
+            pageDebuggerAgent->mainFrameStoppedLoading();
+    }
+
     if (InspectorPageAgent* inspectorPageAgent = instrumentingAgents.inspectorPageAgent())
         inspectorPageAgent->frameStoppedLoading(frame);
 }

Modified: branches/safari-601.1.46-branch/Source/WebCore/inspector/PageDebuggerAgent.cpp (190789 => 190790)


--- branches/safari-601.1.46-branch/Source/WebCore/inspector/PageDebuggerAgent.cpp	2015-10-09 14:21:29 UTC (rev 190789)
+++ branches/safari-601.1.46-branch/Source/WebCore/inspector/PageDebuggerAgent.cpp	2015-10-09 14:21:37 UTC (rev 190790)
@@ -144,4 +144,23 @@
     didClearGlobalObject();
 }
 
+void PageDebuggerAgent::mainFrameStartedLoading()
+{
+    if (isPaused()) {
+        setSuppressAllPauses(true);
+        ErrorString unused;
+        resume(unused);
+    }
+}
+
+void PageDebuggerAgent::mainFrameStoppedLoading()
+{
+    setSuppressAllPauses(false);
+}
+
+void PageDebuggerAgent::mainFrameNavigated()
+{
+    setSuppressAllPauses(false);
+}
+
 } // namespace WebCore

Modified: branches/safari-601.1.46-branch/Source/WebCore/inspector/PageDebuggerAgent.h (190789 => 190790)


--- branches/safari-601.1.46-branch/Source/WebCore/inspector/PageDebuggerAgent.h	2015-10-09 14:21:29 UTC (rev 190789)
+++ branches/safari-601.1.46-branch/Source/WebCore/inspector/PageDebuggerAgent.h	2015-10-09 14:21:37 UTC (rev 190790)
@@ -51,6 +51,10 @@
 
     void didClearMainFrameWindowObject();
 
+    void mainFrameStartedLoading();
+    void mainFrameStoppedLoading();
+    void mainFrameNavigated();
+
     virtual PageScriptDebugServer& scriptDebugServer() override;
 
 protected:

Modified: branches/safari-601.1.46-branch/Source/WebCore/loader/FrameLoader.cpp (190789 => 190790)


--- branches/safari-601.1.46-branch/Source/WebCore/loader/FrameLoader.cpp	2015-10-09 14:21:29 UTC (rev 190789)
+++ branches/safari-601.1.46-branch/Source/WebCore/loader/FrameLoader.cpp	2015-10-09 14:21:37 UTC (rev 190790)
@@ -2982,11 +2982,6 @@
     if (!m_frame.page())
         return;
 
-    if (Page* page = m_frame.page()) {
-        if (m_frame.isMainFrame())
-            page->inspectorController().resume();
-    }
-
     setProvisionalDocumentLoader(m_policyDocumentLoader.get());
     m_loadType = type;
     setState(FrameStateProvisional);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to