Web Inspector: Paused Debugger prevents page reload
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Sep 2015 01:03:35 +0000 (01:03 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Sep 2015 01:03:35 +0000 (01:03 +0000)
commit8d044a2356eae363e3d49fadbf2f7554f813884a
tree786c1f4c2008796a389931232596e15631dc116c
parented41c51971a3446fa8e26583f2c8883650f61534
Web Inspector: Paused Debugger prevents page reload
https://bugs.webkit.org/show_bug.cgi?id=148174

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-09-15
Reviewed by Brian Burg.

Source/JavaScriptCore:

* 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.

Source/WebCore:

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.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@189834 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/debugger/Debugger.cpp
Source/JavaScriptCore/debugger/Debugger.h
Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp
Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h
Source/WebCore/ChangeLog
Source/WebCore/inspector/InspectorController.cpp
Source/WebCore/inspector/InspectorController.h
Source/WebCore/inspector/InspectorInstrumentation.cpp
Source/WebCore/inspector/PageDebuggerAgent.cpp
Source/WebCore/inspector/PageDebuggerAgent.h
Source/WebCore/loader/FrameLoader.cpp