Repository navigation
Commit 797f26e
committed
[Site Isolation] Web Inspector: Add the debugger pause session coordinator with typed IPC and release on teardown
https://bugs.webkit.org/show_bug.cgi?id=326737
rdar://189451502
Reviewed by Qianlang Chen.
With site isolation, a paused frame holds every page in its own WebContent process
(webkit.org/b/326582), but frames of the same page in other processes keep running timers, rAF,
postMessage handlers, and fetch callbacks. This is the first step of holding them too: a pause
session coordinator in the UI process, behind a new off-by-default preference,
SiteIsolationGlobalDebuggerPauseEnabled.
- WebContent to UI: when a FrameDebugger pauses or continues and the preference is on,
DebuggerSuspensionController tells the page's InspectorBackendClient, which in WebKit sends
WebPageProxy::FrameDidPauseForDebugger or FrameDidContinueForDebugger. Iframe processes send
these to their WebPageProxy directly, and ProvisionalPageProxy forwards them like
SendMessageToInspectorFrontend. The paused frame's page and identifier are kept for the
end-of-pause notification, since a paused iframe can be removed before it resumes.
- UI: DebuggerPauseCoordinator, owned by WebPageProxy, opens a session on the first stopping frame
and sends WebInspectorBackend::SuspendForDebugger with a new DebuggerPauseSessionIdentifier to the
page in every other process of forEachWebContentProcess(); the pausing process already holds its
pages. When the last stopping frame continues, it sends ResumeFromDebugger to the same pages. The
identifier is a WebCore type, so the session holds stay typed in WebCore too.
- UI to WebContent: PageInspectorController::suspendForDebuggerSession() and
resumeFromDebuggerSession() add and remove a session hold in the page's
DebuggerSuspensionController, which holds the page's documents while any hold is active.
- Validation: a pause report counts only while an inspector frontend is connected, as counted by
WebPageInspectorController (a new hasFrontends()) rather than by the count the web process
reports, and only for a frame that the sending process hosts or is loading. A frame of another
page fails a MESSAGE_CHECK. Other mismatches are ignored rather than treated as bad messages,
because a report can race with the frame's removal and with a commit in another process. A
continue report only ends a pause that the same process reported, so stopping frames are kept as
(process, frame) pairs: a frame that moved can be stopping in its old and its new process at once.
- Teardown: the session closes, resuming the other processes, when the last inspector frontend
disconnects and when the page closes. Releasing it when the paused frame's process exits, or when
the paused frame is removed or moves to another process, is webkit.org/b/327427.
Later steps add the stepping signal, late joiners, continuation deferral, concurrent stoppers (the
process that paused first is not held if it resumes while another stays paused), the scope rule, and
the protocol and frontend; until then every step closes and reopens the session.
pause-holds-cross-process-frames.html pauses the main frame and checks that a cross-site iframe in
another process stops until resume, and does the same the other way around; both checks fail
without the coordinator. pause-holds-cross-process-frames-disabled.html checks that nothing is held
with the preference off.
* LayoutTests/http/tests/site-isolation/inspector/debugger/pause-holds-cross-process-frames-disabled-expected.txt: Added.
* LayoutTests/http/tests/site-isolation/inspector/debugger/pause-holds-cross-process-frames-disabled.html: Added.
* LayoutTests/http/tests/site-isolation/inspector/debugger/pause-holds-cross-process-frames-expected.txt: Added.
* LayoutTests/http/tests/site-isolation/inspector/debugger/pause-holds-cross-process-frames.html: Added.
* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml:
* Source/WebCore/Headers.cmake:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/inspector/DebuggerPauseSessionIdentifier.h: Added.
* Source/WebCore/inspector/DebuggerSuspensionController.cpp:
(WebCore::pausedPage):
(WebCore::DebuggerSuspensionController::frameDebuggerDidPause):
(WebCore::DebuggerSuspensionController::frameDebuggerDidContinue):
(WebCore::DebuggerSuspensionController::addSessionHold):
(WebCore::DebuggerSuspensionController::removeSessionHold):
(WebCore::DebuggerSuspensionController::shouldHoldDocuments const):
* Source/WebCore/inspector/DebuggerSuspensionController.h:
* Source/WebCore/inspector/FrameDebugger.cpp:
(WebCore::FrameDebugger::didPause):
* Source/WebCore/inspector/InspectorBackendClient.h:
(WebCore::InspectorBackendClient::frameDebuggerDidPause):
(WebCore::InspectorBackendClient::frameDebuggerDidContinue):
* Source/WebCore/inspector/PageInspectorController.cpp:
(WebCore::PageInspectorController::suspendForDebuggerSession):
(WebCore::PageInspectorController::resumeFromDebuggerSession):
* Source/WebCore/inspector/PageInspectorController.h:
* Source/WebKit/Scripts/webkit/messages.py:
(serialized_identifiers):
* Source/WebKit/Scripts/webkit/tests/MessageArgumentDescriptions.cpp:
(IPC::serializedIdentifiers):
* Source/WebKit/Shared/WTFArgumentCoders.serialization.in:
* Source/WebKit/Sources.txt:
* Source/WebKit/UIProcess/Inspector/DebuggerPauseCoordinator.cpp: Added.
(WebKit::DebuggerPauseCoordinator::DebuggerPauseCoordinator):
(WebKit::DebuggerPauseCoordinator::~DebuggerPauseCoordinator):
(WebKit::DebuggerPauseCoordinator::frameDidPause):
(WebKit::DebuggerPauseCoordinator::frameDidContinue):
(WebKit::DebuggerPauseCoordinator::openSession):
(WebKit::DebuggerPauseCoordinator::closeSession):
* Source/WebKit/UIProcess/Inspector/DebuggerPauseCoordinator.h: Added.
* Source/WebKit/UIProcess/Inspector/WebPageInspectorController.cpp:
(WebKit::WebPageInspectorController::hasFrontends const):
(WebKit::WebPageInspectorController::disconnectFrontend):
(WebKit::WebPageInspectorController::disconnectAllFrontends):
* Source/WebKit/UIProcess/Inspector/WebPageInspectorController.h:
* Source/WebKit/UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::didReceiveMessage):
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::close):
(WebKit::WebPageProxy::frameDidPauseForDebugger):
(WebKit::WebPageProxy::frameDidContinueForDebugger):
(WebKit::WebPageProxy::lastInspectorFrontendDidDisconnect):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/WebPageProxy.messages.in:
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:
* Source/WebKit/WebProcess/Inspector/WebInspectorBackend.cpp:
(WebKit::WebInspectorBackend::suspendForDebugger):
(WebKit::WebInspectorBackend::resumeFromDebugger):
* Source/WebKit/WebProcess/Inspector/WebInspectorBackend.h:
* Source/WebKit/WebProcess/Inspector/WebInspectorBackend.messages.in:
* Source/WebKit/WebProcess/Inspector/WebInspectorBackendClient.cpp:
(WebKit::WebInspectorBackendClient::frameDebuggerDidPause):
(WebKit::WebInspectorBackendClient::frameDebuggerDidContinue):
* Source/WebKit/WebProcess/Inspector/WebInspectorBackendClient.h:
Canonical link: https://commits.webkit.org/323835@main1 parent f3e9b7e commit 797f26e
32 files changed
Lines changed: 545 additions & 4 deletions
File tree
- LayoutTests/http/tests/site-isolation/inspector/debugger
- Source
- WTF/Scripts/Preferences
- WebCore
- WebCore.xcodeproj
- inspector
- WebKit
- Scripts/webkit
- tests
- UIProcess
- Inspector
- WebKit.xcodeproj
- WebProcess/Inspector
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5860 | 5860 | | |
5861 | 5861 | | |
5862 | 5862 | | |
| 5863 | + | |
| 5864 | + | |
| 5865 | + | |
| 5866 | + | |
| 5867 | + | |
| 5868 | + | |
| 5869 | + | |
| 5870 | + | |
5863 | 5871 | | |
5864 | 5872 | | |
5865 | 5873 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1764 | 1764 | | |
1765 | 1765 | | |
1766 | 1766 | | |
| 1767 | + | |
1767 | 1768 | | |
1768 | 1769 | | |
1769 | 1770 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7604 | 7604 | | |
7605 | 7605 | | |
7606 | 7606 | | |
| 7607 | + | |
7607 | 7608 | | |
7608 | 7609 | | |
7609 | 7610 | | |
| |||
24330 | 24331 | | |
24331 | 24332 | | |
24332 | 24333 | | |
| 24334 | + | |
24333 | 24335 | | |
24334 | 24336 | | |
24335 | 24337 | | |
| |||
26575 | 26577 | | |
26576 | 26578 | | |
26577 | 26579 | | |
| 26580 | + | |
26578 | 26581 | | |
26579 | 26582 | | |
26580 | 26583 | | |
| |||
45673 | 45676 | | |
45674 | 45677 | | |
45675 | 45678 | | |
| 45679 | + | |
45676 | 45680 | | |
45677 | 45681 | | |
45678 | 45682 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
| 33 | + | |
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
| 39 | + | |
| 40 | + | |
37 | 41 | | |
38 | 42 | | |
39 | 43 | | |
| |||
42 | 46 | | |
43 | 47 | | |
44 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
45 | 58 | | |
46 | 59 | | |
47 | 60 | | |
48 | 61 | | |
49 | 62 | | |
50 | 63 | | |
51 | 64 | | |
52 | | - | |
| 65 | + | |
53 | 66 | | |
54 | 67 | | |
55 | 68 | | |
56 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
57 | 79 | | |
58 | 80 | | |
59 | 81 | | |
60 | 82 | | |
61 | 83 | | |
62 | 84 | | |
63 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
64 | 107 | | |
65 | 108 | | |
66 | 109 | | |
| |||
78 | 121 | | |
79 | 122 | | |
80 | 123 | | |
81 | | - | |
| 124 | + | |
82 | 125 | | |
83 | 126 | | |
84 | 127 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| |||
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
51 | | - | |
| 53 | + | |
52 | 54 | | |
53 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
54 | 59 | | |
55 | 60 | | |
56 | 61 | | |
| |||
64 | 69 | | |
65 | 70 | | |
66 | 71 | | |
| 72 | + | |
67 | 73 | | |
68 | 74 | | |
69 | 75 | | |
0 commit comments