Web Inspector: opt out of process swap on navigation if a Web Inspector frontend...
[WebKit-https.git] / Source / WebKit / UIProcess / WebPageProxy.h
1 /*
2  * Copyright (C) 2010-2018 Apple Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23  * THE POSSIBILITY OF SUCH DAMAGE.
24  */
25
26 #pragma once
27
28 #include "APIObject.h"
29 #include "AssistedNodeInformation.h"
30 #include "AutoCorrectionCallback.h"
31 #include "Connection.h"
32 #include "ContextMenuContextData.h"
33 #include "DownloadID.h"
34 #include "DragControllerAction.h"
35 #include "EditingRange.h"
36 #include "EditorState.h"
37 #include "GeolocationPermissionRequestManagerProxy.h"
38 #include "HiddenPageThrottlingAutoIncreasesCounter.h"
39 #include "LayerTreeContext.h"
40 #include "MessageSender.h"
41 #include "NotificationPermissionRequestManagerProxy.h"
42 #include "PageLoadState.h"
43 #include "ProcessTerminationReason.h"
44 #include "ProcessThrottler.h"
45 #include "SandboxExtension.h"
46 #include "ShareableBitmap.h"
47 #include "SuspendedPageProxy.h"
48 #include "SystemPreviewController.h"
49 #include "UserMediaPermissionRequestManagerProxy.h"
50 #include "VisibleContentRectUpdateInfo.h"
51 #include "VisibleWebPageCounter.h"
52 #include "WKBase.h"
53 #include "WKPagePrivate.h"
54 #include "WebColorPicker.h"
55 #include "WebContextMenuItemData.h"
56 #include "WebCoreArgumentCoders.h"
57 #include "WebFrameProxy.h"
58 #include "WebPageCreationParameters.h"
59 #include "WebPageDiagnosticLoggingClient.h"
60 #include "WebPageInjectedBundleClient.h"
61 #include "WebPaymentCoordinatorProxy.h"
62 #include "WebPreferences.h"
63 #include <WebCore/AlternativeTextClient.h> // FIXME: Needed by WebPageProxyMessages.h for DICTATION_ALTERNATIVES.
64 #include "WebPageProxyMessages.h"
65 #include "WebPopupMenuProxy.h"
66 #include "WebProcessLifetimeTracker.h"
67 #include "WebsitePoliciesData.h"
68 #include <WebCore/ActivityState.h>
69 #include <WebCore/AutoplayEvent.h>
70 #include <WebCore/Color.h>
71 #include <WebCore/DragActions.h>
72 #include <WebCore/EventTrackingRegions.h>
73 #include <WebCore/FrameLoaderTypes.h>
74 #include <WebCore/FrameView.h> // FIXME: Move LayoutViewportConstraint to its own file and stop including this.
75 #include <WebCore/LayoutPoint.h>
76 #include <WebCore/LayoutSize.h>
77 #include <WebCore/MediaPlaybackTargetContext.h>
78 #include <WebCore/MediaProducer.h>
79 #include <WebCore/PlatformScreen.h>
80 #include <WebCore/ScrollTypes.h>
81 #include <WebCore/SearchPopupMenu.h>
82 #include <WebCore/TextChecking.h>
83 #include <WebCore/TextGranularity.h>
84 #include <WebCore/URL.h>
85 #include <WebCore/UserInterfaceLayoutDirection.h>
86 #include <memory>
87 #include <wtf/CompletionHandler.h>
88 #include <wtf/HashMap.h>
89 #include <wtf/HashSet.h>
90 #include <wtf/MonotonicTime.h>
91 #include <wtf/Optional.h>
92 #include <wtf/ProcessID.h>
93 #include <wtf/Ref.h>
94 #include <wtf/RefPtr.h>
95 #include <wtf/Vector.h>
96 #include <wtf/text/WTFString.h>
97
98 OBJC_CLASS NSView;
99 OBJC_CLASS _WKRemoteObjectRegistry;
100
101 #if ENABLE(DRAG_SUPPORT)
102 #include <WebCore/DragActions.h>
103 #endif
104
105 #if ENABLE(TOUCH_EVENTS)
106 #include "NativeWebTouchEvent.h"
107 #endif
108
109 #if PLATFORM(COCOA)
110 #include "LayerRepresentation.h"
111 #include "TouchBarMenuData.h"
112 #include "TouchBarMenuItemData.h"
113 #endif
114
115 #if PLATFORM(GTK)
116 #include "ArgumentCodersGtk.h"
117 #endif
118
119 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
120 #include <WebCore/MediaPlaybackTargetPicker.h>
121 #include <WebCore/WebMediaSessionManagerClient.h>
122 #endif
123
124 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
125 #include "DisplayLink.h"
126 #endif
127
128 #if ENABLE(MEDIA_SESSION)
129 namespace WebCore {
130 class MediaSessionMetadata;
131 }
132 #endif
133
134 namespace API {
135 class ContextMenuClient;
136 class FindClient;
137 class FindMatchesClient;
138 class FormClient;
139 class FullscreenClient;
140 class HistoryClient;
141 class IconLoadingClient;
142 class LoaderClient;
143 class Navigation;
144 class NavigationClient;
145 class PolicyClient;
146 class UIClient;
147 class URLRequest;
148 }
149
150 namespace IPC {
151 class Decoder;
152 class Connection;
153 }
154
155 namespace WebCore {
156 class AuthenticationChallenge;
157 class Cursor;
158 class DragData;
159 class FloatRect;
160 class GraphicsLayer;
161 class IntSize;
162 class ProtectionSpace;
163 class RunLoopObserver;
164 class SharedBuffer;
165 class TextIndicator;
166 class ValidationBubble;
167
168 enum SelectionDirection : uint8_t;
169
170 enum class AutoplayEvent;
171 enum class HasInsecureContent;
172 enum class NavigationPolicyCheck;
173 enum class NotificationDirection;
174 enum class ShouldSample;
175
176 struct ApplicationManifest;
177 struct BackForwardItemIdentifier;
178 struct DictionaryPopupInfo;
179 struct ExceptionDetails;
180 struct FileChooserSettings;
181 struct GlobalWindowIdentifier;
182 struct MediaStreamRequest;
183 struct SecurityOriginData;
184 struct TextAlternativeWithRange;
185 struct TextCheckingResult;
186 struct ViewportAttributes;
187 struct WindowFeatures;
188
189 template <typename> class RectEdges;
190 using FloatBoxExtent = RectEdges<float>;
191 }
192
193 #if ENABLE(ATTACHMENT_ELEMENT)
194 namespace WebCore {
195 struct AttachmentDisplayOptions;
196 struct AttachmentInfo;
197 }
198 #endif
199
200 #if PLATFORM(GTK)
201 typedef GtkWidget* PlatformWidget;
202 #endif
203
204 #if PLATFORM(GTK) || PLATFORM(WPE)
205 typedef struct OpaqueJSContext* JSGlobalContextRef;
206 #endif
207
208 namespace WebKit {
209 class CertificateInfo;
210 class DrawingAreaProxy;
211 class NativeWebGestureEvent;
212 class NativeWebKeyboardEvent;
213 class NativeWebMouseEvent;
214 class NativeWebWheelEvent;
215 class PageClient;
216 class RemoteLayerTreeScrollingPerformanceData;
217 class RemoteLayerTreeTransaction;
218 class RemoteScrollingCoordinatorProxy;
219 class UserData;
220 class ViewSnapshot;
221 class VisitedLinkStore;
222 class WebBackForwardList;
223 class WebBackForwardListItem;
224 class WebContextMenuProxy;
225 class WebEditCommandProxy;
226 class WebFullScreenManagerProxy;
227 class PlaybackSessionManagerProxy;
228 class WebNavigationState;
229 class VideoFullscreenManagerProxy;
230 class WebCredentialsMessengerProxy;
231 class WebKeyboardEvent;
232 class WebURLSchemeHandler;
233 class WebMouseEvent;
234 class WebOpenPanelResultListenerProxy;
235 class WebPageGroup;
236 class WebProcessProxy;
237 class WebUserContentControllerProxy;
238 class WebWheelEvent;
239 class WebsiteDataStore;
240 class GamepadData;
241
242 struct AttributedString;
243 struct ColorSpaceData;
244 struct EditingRange;
245 struct EditorState;
246 struct FrameInfoData;
247 struct InteractionInformationRequest;
248 struct LoadParameters;
249 struct PlatformPopupMenuData;
250 struct PrintInfo;
251 struct WebPopupItem;
252 struct URLSchemeTaskParameters;
253
254 #if USE(QUICK_LOOK)
255 class QuickLookDocumentData;
256 #endif
257
258 typedef GenericCallback<uint64_t> UnsignedCallback;
259 typedef GenericCallback<EditingRange> EditingRangeCallback;
260 typedef GenericCallback<const String&> StringCallback;
261 typedef GenericCallback<API::SerializedScriptValue*, bool, const WebCore::ExceptionDetails&> ScriptValueCallback;
262
263 #if ENABLE(ATTACHMENT_ELEMENT)
264 typedef GenericCallback<const WebCore::AttachmentInfo&> AttachmentInfoCallback;
265 #endif
266
267 #if PLATFORM(GTK)
268 typedef GenericCallback<API::Error*> PrintFinishedCallback;
269 #endif
270
271 #if ENABLE(TOUCH_EVENTS)
272 struct QueuedTouchEvents {
273     QueuedTouchEvents(const NativeWebTouchEvent& event)
274         : forwardedEvent(event)
275     {
276     }
277     NativeWebTouchEvent forwardedEvent;
278     Vector<NativeWebTouchEvent> deferredTouchEvents;
279 };
280 #endif
281
282 typedef GenericCallback<const String&, bool, int32_t> ValidateCommandCallback;
283 typedef GenericCallback<const WebCore::IntRect&, const EditingRange&> RectForCharacterRangeCallback;
284
285 #if ENABLE(APPLICATION_MANIFEST)
286 typedef GenericCallback<const std::optional<WebCore::ApplicationManifest>&> ApplicationManifestCallback;
287 #endif
288
289 #if PLATFORM(MAC)
290 typedef GenericCallback<const AttributedString&, const EditingRange&> AttributedStringForCharacterRangeCallback;
291 typedef GenericCallback<const String&, double, bool> FontAtSelectionCallback;
292 #endif
293
294 #if PLATFORM(IOS)
295 typedef GenericCallback<const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t> GestureCallback;
296 typedef GenericCallback<const WebCore::IntPoint&, uint32_t, uint32_t> TouchesCallback;
297 typedef GenericCallback<const Vector<WebCore::SelectionRect>&> SelectionRectsCallback;
298 typedef GenericCallback<const AssistedNodeInformation&> AssistedNodeInformationCallback;
299 struct NodeAssistanceArguments {
300     AssistedNodeInformation m_nodeInformation;
301     bool m_userIsInteracting;
302     bool m_blurPreviousNode;
303     bool m_changingActivityState;
304     RefPtr<API::Object> m_userData;
305 };
306
307 using DrawToPDFCallback = GenericCallback<const IPC::DataReference&>;
308 #endif
309
310 #if PLATFORM(COCOA)
311 typedef GenericCallback<const WTF::MachSendRight&> MachSendRightCallback;
312 typedef GenericCallback<bool, bool, String, double, double, uint64_t> NowPlayingInfoCallback;
313 #endif
314
315 class WebPageProxy : public API::ObjectImpl<API::Object::Type::Page>
316 #if ENABLE(INPUT_TYPE_COLOR)
317     , public WebColorPicker::Client
318 #endif
319 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
320     , public WebCore::WebMediaSessionManagerClient
321 #endif
322     , public WebPopupMenuProxy::Client
323     , public IPC::MessageReceiver
324     , public IPC::MessageSender {
325 public:
326     static Ref<WebPageProxy> create(PageClient&, WebProcessProxy&, uint64_t pageID, Ref<API::PageConfiguration>&&);
327     virtual ~WebPageProxy();
328
329     const API::PageConfiguration& configuration() const;
330
331     uint64_t pageID() const { return m_pageID; }
332
333     PAL::SessionID sessionID() const;
334
335     WebFrameProxy* mainFrame() const { return m_mainFrame.get(); }
336     WebFrameProxy* focusedFrame() const { return m_focusedFrame.get(); }
337     WebFrameProxy* frameSetLargestFrame() const { return m_frameSetLargestFrame.get(); }
338
339     DrawingAreaProxy* drawingArea() const { return m_drawingArea.get(); }
340
341     WebNavigationState& navigationState() { return *m_navigationState.get(); }
342
343     WebsiteDataStore& websiteDataStore() { return m_websiteDataStore; }
344     void changeWebsiteDataStore(WebsiteDataStore&);
345
346 #if ENABLE(DATA_DETECTION)
347     NSArray *dataDetectionResults() { return m_dataDetectionResults.get(); }
348 #endif
349         
350 #if ENABLE(ASYNC_SCROLLING) && PLATFORM(COCOA)
351     RemoteScrollingCoordinatorProxy* scrollingCoordinatorProxy() const { return m_scrollingCoordinatorProxy.get(); }
352 #endif
353
354     WebBackForwardList& backForwardList() { return m_backForwardList; }
355
356     bool addsVisitedLinks() const { return m_addsVisitedLinks; }
357     void setAddsVisitedLinks(bool addsVisitedLinks) { m_addsVisitedLinks = addsVisitedLinks; }
358
359     void fullscreenMayReturnToInline();
360     void didEnterFullscreen();
361     void didExitFullscreen();
362
363     WebInspectorProxy* inspector() const;
364
365     void didChangeInspectorFrontendCount(unsigned count) { m_inspectorFrontendCount = count; }
366     unsigned inspectorFrontendCount() const { return m_inspectorFrontendCount; }
367
368     bool isControlledByAutomation() const { return m_controlledByAutomation; }
369     void setControlledByAutomation(bool);
370
371 #if ENABLE(REMOTE_INSPECTOR)
372     bool allowsRemoteInspection() const { return m_allowsRemoteInspection; }
373     void setAllowsRemoteInspection(bool);
374     String remoteInspectionNameOverride() const { return m_remoteInspectionNameOverride; }
375     void setRemoteInspectionNameOverride(const String&);
376 #endif
377
378 #if ENABLE(FULLSCREEN_API)
379     WebFullScreenManagerProxy* fullScreenManager();
380
381     API::FullscreenClient& fullscreenClient() const { return *m_fullscreenClient; }
382     void setFullscreenClient(std::unique_ptr<API::FullscreenClient>&&);
383 #endif
384 #if (PLATFORM(IOS) && HAVE(AVKIT)) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
385     PlaybackSessionManagerProxy* playbackSessionManager();
386     VideoFullscreenManagerProxy* videoFullscreenManager();
387 #endif
388
389 #if PLATFORM(IOS)
390     bool allowsMediaDocumentInlinePlayback() const;
391     void setAllowsMediaDocumentInlinePlayback(bool);
392 #endif
393
394     SystemPreviewController* systemPreviewController() { return m_systemPreviewController.get(); }
395
396 #if ENABLE(CONTEXT_MENUS)
397     API::ContextMenuClient& contextMenuClient() { return *m_contextMenuClient; }
398     void setContextMenuClient(std::unique_ptr<API::ContextMenuClient>&&);
399 #endif
400     API::FindClient& findClient() { return *m_findClient; }
401     void setFindClient(std::unique_ptr<API::FindClient>&&);
402     API::FindMatchesClient& findMatchesClient() { return *m_findMatchesClient; }
403     void setFindMatchesClient(std::unique_ptr<API::FindMatchesClient>&&);
404     API::DiagnosticLoggingClient* diagnosticLoggingClient() { return m_diagnosticLoggingClient.get(); }
405     void setDiagnosticLoggingClient(std::unique_ptr<API::DiagnosticLoggingClient>&&);
406     void setFormClient(std::unique_ptr<API::FormClient>&&);
407     void setNavigationClient(std::unique_ptr<API::NavigationClient>&&);
408     void setHistoryClient(std::unique_ptr<API::HistoryClient>&&);
409     void setLoaderClient(std::unique_ptr<API::LoaderClient>&&);
410     void setPolicyClient(std::unique_ptr<API::PolicyClient>&&);
411     void setInjectedBundleClient(const WKPageInjectedBundleClientBase*);
412     WebPageInjectedBundleClient* injectedBundleClient() { return m_injectedBundleClient.get(); }
413
414     API::UIClient& uiClient() { return *m_uiClient; }
415     void setUIClient(std::unique_ptr<API::UIClient>&&);
416
417     API::IconLoadingClient& iconLoadingClient() { return *m_iconLoadingClient; }
418     void setIconLoadingClient(std::unique_ptr<API::IconLoadingClient>&&);
419
420     void initializeWebPage();
421
422     void close();
423     bool tryClose();
424     bool isClosed() const { return m_isClosed; }
425
426     void setIsUsingHighPerformanceWebGL(bool value) { m_isUsingHighPerformanceWebGL = value; }
427     bool isUsingHighPerformanceWebGL() const { return m_isUsingHighPerformanceWebGL; }
428
429     void didExceedInactiveMemoryLimitWhileActive();
430     void didExceedBackgroundCPULimitWhileInForeground();
431
432     void closePage(bool stopResponsivenessTimer);
433
434     void addPlatformLoadParameters(LoadParameters&);
435     RefPtr<API::Navigation> loadRequest(WebCore::ResourceRequest&&, WebCore::ShouldOpenExternalURLsPolicy = WebCore::ShouldOpenExternalURLsPolicy::ShouldAllowExternalSchemes, API::Object* userData = nullptr);
436     RefPtr<API::Navigation> loadFile(const String& fileURL, const String& resourceDirectoryURL, API::Object* userData = nullptr);
437     RefPtr<API::Navigation> loadData(API::Data*, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData = nullptr);
438     RefPtr<API::Navigation> loadHTMLString(const String& htmlString, const String& baseURL, API::Object* userData = nullptr);
439     void loadAlternateHTMLString(const String& htmlString, const WebCore::URL& baseURL, const WebCore::URL& unreachableURL, API::Object* userData = nullptr);
440     void loadPlainTextString(const String&, API::Object* userData = nullptr);
441     void loadWebArchiveData(API::Data*, API::Object* userData = nullptr);
442     void navigateToPDFLinkWithSimulatedClick(const String& url, WebCore::IntPoint documentPoint, WebCore::IntPoint screenPoint);
443
444     void stopLoading();
445     RefPtr<API::Navigation> reload(OptionSet<WebCore::ReloadOption>);
446
447     RefPtr<API::Navigation> goForward();
448     RefPtr<API::Navigation> goBack();
449
450     RefPtr<API::Navigation> goToBackForwardItem(WebBackForwardListItem&);
451     void tryRestoreScrollPosition();
452     void didChangeBackForwardList(WebBackForwardListItem* addedItem, Vector<Ref<WebBackForwardListItem>>&& removed);
453     void willGoToBackForwardListItem(const WebCore::BackForwardItemIdentifier&, bool inPageCache, const UserData&);
454
455     bool shouldKeepCurrentBackForwardListItemInList(WebBackForwardListItem&);
456
457     bool willHandleHorizontalScrollEvents() const;
458
459     void updateWebsitePolicies(WebsitePoliciesData&&);
460
461     bool canShowMIMEType(const String& mimeType);
462
463     bool drawsBackground() const { return m_drawsBackground; }
464     void setDrawsBackground(bool);
465
466     String currentURL() const;
467
468     float topContentInset() const { return m_topContentInset; }
469     void setTopContentInset(float);
470
471     WebCore::Color underlayColor() const { return m_underlayColor; }
472     void setUnderlayColor(const WebCore::Color&);
473
474     // At this time, m_pageExtendedBackgroundColor can be set via pageExtendedBackgroundColorDidChange() which is a message
475     // from the UIProcess, or by didCommitLayerTree(). When PLATFORM(MAC) adopts UI side compositing, we should get rid of
476     // the message entirely.
477     WebCore::Color pageExtendedBackgroundColor() const { return m_pageExtendedBackgroundColor; }
478
479     void viewWillStartLiveResize();
480     void viewWillEndLiveResize();
481
482     void setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent&, WTF::Function<void (CallbackBase::Error)>&&);
483     
484     void clearSelection();
485     void restoreSelectionInFocusedEditableElement();
486
487     void setViewNeedsDisplay(const WebCore::Region&);
488     void requestScroll(const WebCore::FloatPoint& scrollPosition, const WebCore::IntPoint& scrollOrigin, bool isProgrammaticScroll);
489     
490     WebCore::FloatPoint viewScrollPosition() const;
491
492     void setDelegatesScrolling(bool delegatesScrolling) { m_delegatesScrolling = delegatesScrolling; }
493     bool delegatesScrolling() const { return m_delegatesScrolling; }
494
495     enum class ActivityStateChangeDispatchMode { Deferrable, Immediate };
496     void activityStateDidChange(WebCore::ActivityState::Flags mayHaveChanged, bool wantsSynchronousReply = false, ActivityStateChangeDispatchMode = ActivityStateChangeDispatchMode::Deferrable);
497     bool isInWindow() const { return m_activityState & WebCore::ActivityState::IsInWindow; }
498     void waitForDidUpdateActivityState();
499     void didUpdateActivityState() { m_waitingForDidUpdateActivityState = false; }
500
501     void layerHostingModeDidChange();
502
503     WebCore::IntSize viewSize() const;
504     bool isViewVisible() const { return m_activityState & WebCore::ActivityState::IsVisible; }
505     bool isViewFocused() const { return m_activityState & WebCore::ActivityState::IsFocused; }
506     bool isViewWindowActive() const { return m_activityState & WebCore::ActivityState::WindowIsActive; }
507
508     void addMIMETypeWithCustomContentProvider(const String& mimeType);
509
510     void executeEditCommand(const String& commandName, const String& argument = String());
511     void validateCommand(const String& commandName, WTF::Function<void (const String&, bool, int32_t, CallbackBase::Error)>&&);
512
513     const EditorState& editorState() const { return m_editorState; }
514     bool canDelete() const { return hasSelectedRange() && isContentEditable(); }
515     bool hasSelectedRange() const { return m_editorState.selectionIsRange; }
516     bool isContentEditable() const { return m_editorState.isContentEditable; }
517
518 #if PLATFORM(COCOA)
519     const TouchBarMenuData& touchBarMenuData() const { return m_touchBarMenuData; }
520 #endif
521
522     bool maintainsInactiveSelection() const;
523     void setMaintainsInactiveSelection(bool);
524     void setEditable(bool);
525     bool isEditable() const { return m_isEditable; }
526
527     void activateMediaStreamCaptureInPage();
528     bool isMediaStreamCaptureMuted() const { return m_mutedState & WebCore::MediaProducer::CaptureDevicesAreMuted; }
529     void setMediaStreamCaptureMuted(bool);
530     void executeEditCommand(const String& commandName, const String& argument, WTF::Function<void(CallbackBase::Error)>&&);
531         
532 #if PLATFORM(IOS)
533     double displayedContentScale() const { return m_lastVisibleContentRectUpdate.scale(); }
534     const WebCore::FloatRect& exposedContentRect() const { return m_lastVisibleContentRectUpdate.exposedContentRect(); }
535     const WebCore::FloatRect& unobscuredContentRect() const { return m_lastVisibleContentRectUpdate.unobscuredContentRect(); }
536     bool inStableState() const { return m_lastVisibleContentRectUpdate.inStableState(); }
537     const WebCore::FloatRect& unobscuredContentRectRespectingInputViewBounds() const { return m_lastVisibleContentRectUpdate.unobscuredContentRectRespectingInputViewBounds(); }
538     // When visual viewports are enabled, this is the layout viewport rect.
539     const WebCore::FloatRect& customFixedPositionRect() const { return m_lastVisibleContentRectUpdate.customFixedPositionRect(); }
540
541     void updateVisibleContentRects(const VisibleContentRectUpdateInfo&);
542     void resendLastVisibleContentRects();
543
544     WebCore::FloatRect computeCustomFixedPositionRect(const WebCore::FloatRect& unobscuredContentRect, const WebCore::FloatRect& unobscuredContentRectRespectingInputViewBounds, const WebCore::FloatRect& currentCustomFixedPositionRect, double displayedContentScale, WebCore::FrameView::LayoutViewportConstraint = WebCore::FrameView::LayoutViewportConstraint::Unconstrained, bool visualViewportEnabled = false) const;
545
546     void overflowScrollViewWillStartPanGesture();
547     void overflowScrollViewDidScroll();
548     void overflowScrollWillStartScroll();
549     void overflowScrollDidEndScroll();
550
551     void dynamicViewportSizeUpdate(const WebCore::FloatSize& viewLayoutSize, const WebCore::FloatSize& maximumUnobscuredSize, const WebCore::FloatRect& targetExposedContentRect, const WebCore::FloatRect& targetUnobscuredRect, const WebCore::FloatRect& targetUnobscuredRectInScrollViewCoordinates, const WebCore::FloatBoxExtent& unobscuredSafeAreaInsets, double targetScale, int32_t deviceOrientation);
552     void synchronizeDynamicViewportUpdate();
553
554     void setViewportConfigurationViewLayoutSize(const WebCore::FloatSize&);
555     void setMaximumUnobscuredSize(const WebCore::FloatSize&);
556     void setDeviceOrientation(int32_t);
557     int32_t deviceOrientation() const { return m_deviceOrientation; }
558     void willCommitLayerTree(uint64_t transactionID);
559
560     void selectWithGesture(const WebCore::IntPoint, WebCore::TextGranularity, uint32_t gestureType, uint32_t gestureState, bool isInteractingWithAssistedNode, WTF::Function<void (const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t, CallbackBase::Error)>&&);
561     void updateSelectionWithTouches(const WebCore::IntPoint, uint32_t touches, bool baseIsStart, WTF::Function<void (const WebCore::IntPoint&, uint32_t, uint32_t, CallbackBase::Error)>&&);
562     void selectWithTwoTouches(const WebCore::IntPoint from, const WebCore::IntPoint to, uint32_t gestureType, uint32_t gestureState, WTF::Function<void (const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t, CallbackBase::Error)>&&);
563     void extendSelection(WebCore::TextGranularity);
564     void selectWordBackward();
565     void moveSelectionByOffset(int32_t offset, WTF::Function<void (CallbackBase::Error)>&&);
566     void selectTextWithGranularityAtPoint(const WebCore::IntPoint, WebCore::TextGranularity, bool isInteractingWithAssistedNode, WTF::Function<void (CallbackBase::Error)>&&);
567     void selectPositionAtPoint(const WebCore::IntPoint, bool isInteractingWithAssistedNode, WTF::Function<void (CallbackBase::Error)>&&);
568     void selectPositionAtBoundaryWithDirection(const WebCore::IntPoint, WebCore::TextGranularity, WebCore::SelectionDirection, bool isInteractingWithAssistedNode, WTF::Function<void (CallbackBase::Error)>&&);
569     void moveSelectionAtBoundaryWithDirection(WebCore::TextGranularity, WebCore::SelectionDirection, WTF::Function<void(CallbackBase::Error)>&&);
570     void beginSelectionInDirection(WebCore::SelectionDirection, WTF::Function<void (uint64_t, CallbackBase::Error)>&&);
571     void updateSelectionWithExtentPoint(const WebCore::IntPoint, bool isInteractingWithAssistedNode, WTF::Function<void (uint64_t, CallbackBase::Error)>&&);
572     void updateSelectionWithExtentPointAndBoundary(const WebCore::IntPoint, WebCore::TextGranularity, bool isInteractingWithAssistedNode, WTF::Function<void(uint64_t, CallbackBase::Error)>&&);
573     void requestAutocorrectionData(const String& textForAutocorrection, WTF::Function<void (const Vector<WebCore::FloatRect>&, const String&, double, uint64_t, CallbackBase::Error)>&&);
574     void applyAutocorrection(const String& correction, const String& originalText, WTF::Function<void (const String&, CallbackBase::Error)>&&);
575     bool applyAutocorrection(const String& correction, const String& originalText);
576     void requestAutocorrectionContext(WTF::Function<void (const String&, const String&, const String&, const String&, uint64_t, uint64_t, CallbackBase::Error)>&&);
577     void getAutocorrectionContext(String& contextBefore, String& markedText, String& selectedText, String& contextAfter, uint64_t& location, uint64_t& length);
578     void requestDictationContext(WTF::Function<void (const String&, const String&, const String&, CallbackBase::Error)>&&);
579     void replaceDictatedText(const String& oldText, const String& newText);
580     void replaceSelectedText(const String& oldText, const String& newText);
581     void didReceivePositionInformation(const InteractionInformationAtPosition&);
582     void requestPositionInformation(const InteractionInformationRequest&);
583     void startInteractionWithElementAtPosition(const WebCore::IntPoint&);
584     void stopInteraction();
585     void performActionOnElement(uint32_t action);
586     void saveImageToLibrary(const SharedMemory::Handle& imageHandle, uint64_t imageSize);
587     void focusNextAssistedNode(bool isForward, WTF::Function<void (CallbackBase::Error)>&& = [] (auto) { });
588     void setAssistedNodeValue(const String&);
589     void setAssistedNodeValueAsNumber(double);
590     void setAssistedNodeSelectedIndex(uint32_t index, bool allowMultipleSelection = false);
591     void applicationDidEnterBackground();
592     void applicationDidFinishSnapshottingAfterEnteringBackground();
593     void applicationWillEnterForeground();
594     void applicationWillResignActive();
595     void applicationDidBecomeActive();
596     void commitPotentialTapFailed();
597     void didNotHandleTapAsClick(const WebCore::IntPoint&);
598     void didCompleteSyntheticClick();
599     void disableDoubleTapGesturesDuringTapIfNecessary(uint64_t requestID);
600     void contentSizeCategoryDidChange(const String& contentSizeCategory);
601     void getSelectionContext(WTF::Function<void(const String&, const String&, const String&, CallbackBase::Error)>&&);
602     void handleTwoFingerTapAtPoint(const WebCore::IntPoint&, uint64_t requestID);
603     void setForceAlwaysUserScalable(bool);
604     void setIsScrollingOrZooming(bool);
605     void requestRectsForGranularityWithSelectionOffset(WebCore::TextGranularity, uint32_t offset, WTF::Function<void(const Vector<WebCore::SelectionRect>&, CallbackBase::Error)>&&);
606     void requestRectsAtSelectionOffsetWithText(int32_t offset, const String&, WTF::Function<void(const Vector<WebCore::SelectionRect>&, CallbackBase::Error)>&&);
607     void autofillLoginCredentials(const String& username, const String& password);
608     void storeSelectionForAccessibility(bool);
609     void startAutoscrollAtPosition(const WebCore::FloatPoint& positionInWindow);
610     void cancelAutoscroll();
611 #if ENABLE(DATA_INTERACTION)
612     void didPerformDataInteractionControllerOperation(bool handled);
613     void didHandleStartDataInteractionRequest(bool started);
614     void didHandleAdditionalDragItemsRequest(bool added);
615     void requestStartDataInteraction(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition);
616     void requestAdditionalItemsForDragSession(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition);
617     void didConcludeEditDataInteraction(std::optional<WebCore::TextIndicatorData>);
618 #endif
619 #endif
620 #if ENABLE(DATA_DETECTION)
621     void setDataDetectionResult(const DataDetectionResult&);
622 #endif
623     void didCommitLayerTree(const WebKit::RemoteLayerTreeTransaction&);
624     void layerTreeCommitComplete();
625
626     bool updateLayoutViewportParameters(const WebKit::RemoteLayerTreeTransaction&);
627
628 #if PLATFORM(GTK)
629     void setComposition(const String& text, Vector<WebCore::CompositionUnderline> underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeEnd);
630     void confirmComposition(const String& compositionString, int64_t selectionStart, int64_t selectionLength);
631     void cancelComposition();
632 #endif
633
634 #if PLATFORM(GTK)
635     void setInputMethodState(bool enabled);
636 #endif
637
638 #if PLATFORM (GTK) && HAVE(GTK_GESTURES)
639     void getCenterForZoomGesture(const WebCore::IntPoint& centerInViewCoordinates, WebCore::IntPoint& center);
640 #endif
641
642 #if PLATFORM(COCOA)
643     void windowAndViewFramesChanged(const WebCore::FloatRect& viewFrameInWindowCoordinates, const WebCore::FloatPoint& accessibilityViewCoordinates);
644     void setMainFrameIsScrollable(bool);
645
646     void sendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdentifier, const String& textInput);
647     bool shouldDelayWindowOrderingForEvent(const WebMouseEvent&);
648     bool acceptsFirstMouse(int eventNumber, const WebMouseEvent&);
649
650     void setAcceleratedCompositingRootLayer(LayerOrView*);
651     LayerOrView* acceleratedCompositingRootLayer() const;
652
653     void setTextAsync(const String&);
654     void insertTextAsync(const String& text, const EditingRange& replacementRange, bool registerUndoGroup = false, EditingRangeIsRelativeTo = EditingRangeIsRelativeTo::EditableRoot, bool suppressSelectionUpdate = false);
655     void getMarkedRangeAsync(WTF::Function<void (EditingRange, CallbackBase::Error)>&&);
656     void getSelectedRangeAsync(WTF::Function<void (EditingRange, CallbackBase::Error)>&&);
657     void characterIndexForPointAsync(const WebCore::IntPoint&, WTF::Function<void (uint64_t, CallbackBase::Error)>&&);
658     void firstRectForCharacterRangeAsync(const EditingRange&, WTF::Function<void (const WebCore::IntRect&, const EditingRange&, CallbackBase::Error)>&&);
659     void setCompositionAsync(const String& text, const Vector<WebCore::CompositionUnderline>& underlines, const EditingRange& selectionRange, const EditingRange& replacementRange);
660     void confirmCompositionAsync();
661
662     void setScrollPerformanceDataCollectionEnabled(bool);
663     bool scrollPerformanceDataCollectionEnabled() const { return m_scrollPerformanceDataCollectionEnabled; }
664     RemoteLayerTreeScrollingPerformanceData* scrollingPerformanceData() { return m_scrollingPerformanceData.get(); }
665 #endif // PLATFORM(COCOA)
666
667 #if PLATFORM(MAC)
668     void insertDictatedTextAsync(const String& text, const EditingRange& replacementRange, const Vector<WebCore::TextAlternativeWithRange>& dictationAlternatives, bool registerUndoGroup);
669     void attributedSubstringForCharacterRangeAsync(const EditingRange&, WTF::Function<void (const AttributedString&, const EditingRange&, CallbackBase::Error)>&&);
670     void setFont(const String& fontFamily, double fontSize, uint64_t fontTraits);
671     void fontAtSelection(WTF::Function<void (const String&, double, bool, CallbackBase::Error)>&&);
672
673     void startWindowDrag();
674     NSWindow *platformWindow();
675     void rootViewToWindow(const WebCore::IntRect& viewRect, WebCore::IntRect& windowRect);
676
677 #if WK_API_ENABLED
678     NSView *inspectorAttachmentView();
679     _WKRemoteObjectRegistry *remoteObjectRegistry();
680 #endif
681
682     void intrinsicContentSizeDidChange(const WebCore::IntSize& intrinsicContentSize);
683     CGRect boundsOfLayerInLayerBackedWindowCoordinates(CALayer *) const;
684 #endif // PLATFORM(MAC)
685
686 #if PLATFORM(GTK)
687     PlatformWidget viewWidget();
688     const WebCore::Color& backgroundColor() const { return m_backgroundColor; }
689     void setBackgroundColor(const WebCore::Color& color) { m_backgroundColor = color; }
690 #endif
691
692     bool isProcessingMouseEvents() const;
693     void processNextQueuedMouseEvent();
694     void handleMouseEvent(const NativeWebMouseEvent&);
695
696     void handleWheelEvent(const NativeWebWheelEvent&);
697     void handleKeyboardEvent(const NativeWebKeyboardEvent&);
698
699 #if ENABLE(MAC_GESTURE_EVENTS)
700     void handleGestureEvent(const NativeWebGestureEvent&);
701 #endif
702
703 #if ENABLE(IOS_TOUCH_EVENTS)
704     void handleTouchEventSynchronously(NativeWebTouchEvent&);
705     void handleTouchEventAsynchronously(const NativeWebTouchEvent&);
706
707 #elif ENABLE(TOUCH_EVENTS)
708     void handleTouchEvent(const NativeWebTouchEvent&);
709 #endif
710
711     void scrollBy(WebCore::ScrollDirection, WebCore::ScrollGranularity);
712     void centerSelectionInVisibleArea();
713
714     const String& toolTip() const { return m_toolTip; }
715
716     const String& userAgent() const { return m_userAgent; }
717     void setApplicationNameForUserAgent(const String&);
718     const String& applicationNameForUserAgent() const { return m_applicationNameForUserAgent; }
719     void setCustomUserAgent(const String&);
720     const String& customUserAgent() const { return m_customUserAgent; }
721     static String standardUserAgent(const String& applicationName = String());
722
723     bool supportsTextEncoding() const;
724     void setCustomTextEncodingName(const String&);
725     String customTextEncodingName() const { return m_customTextEncodingName; }
726
727     bool areActiveDOMObjectsAndAnimationsSuspended() const { return m_isPageSuspended; }
728     void resumeActiveDOMObjectsAndAnimations();
729     void suspendActiveDOMObjectsAndAnimations();
730
731     double estimatedProgress() const;
732
733     SessionState sessionState(WTF::Function<bool (WebBackForwardListItem&)>&& = nullptr) const;
734     RefPtr<API::Navigation> restoreFromSessionState(SessionState, bool navigate);
735
736     bool supportsTextZoom() const;
737     double textZoomFactor() const { return m_textZoomFactor; }
738     void setTextZoomFactor(double);
739     double pageZoomFactor() const;
740     void setPageZoomFactor(double);
741     void setPageAndTextZoomFactors(double pageZoomFactor, double textZoomFactor);
742
743     void scalePage(double scale, const WebCore::IntPoint& origin);
744     void scalePageInViewCoordinates(double scale, const WebCore::IntPoint& centerInViewCoordinates);
745     double pageScaleFactor() const;
746     double viewScaleFactor() const { return m_viewScaleFactor; }
747     void scaleView(double scale);
748     void setShouldScaleViewToFitDocument(bool);
749     
750     float deviceScaleFactor() const;
751     void setIntrinsicDeviceScaleFactor(float);
752     void setCustomDeviceScaleFactor(float);
753     void windowScreenDidChange(WebCore::PlatformDisplayID);
754     void accessibilitySettingsDidChange();
755 #if ENABLE(ACCESSIBILITY_EVENTS)
756     void updateAccessibilityEventsEnabled(bool);
757 #endif
758
759     void setUseFixedLayout(bool);
760     void setFixedLayoutSize(const WebCore::IntSize&);
761     bool useFixedLayout() const { return m_useFixedLayout; };
762     const WebCore::IntSize& fixedLayoutSize() const { return m_fixedLayoutSize; };
763
764     void setAlwaysShowsHorizontalScroller(bool);
765     void setAlwaysShowsVerticalScroller(bool);
766     bool alwaysShowsHorizontalScroller() const { return m_alwaysShowsHorizontalScroller; }
767     bool alwaysShowsVerticalScroller() const { return m_alwaysShowsVerticalScroller; }
768
769     void listenForLayoutMilestones(WebCore::LayoutMilestones);
770
771     bool hasHorizontalScrollbar() const { return m_mainFrameHasHorizontalScrollbar; }
772     bool hasVerticalScrollbar() const { return m_mainFrameHasVerticalScrollbar; }
773
774     void setSuppressScrollbarAnimations(bool);
775     bool areScrollbarAnimationsSuppressed() const { return m_suppressScrollbarAnimations; }
776
777     bool isPinnedToLeftSide() const { return m_mainFrameIsPinnedToLeftSide; }
778     bool isPinnedToRightSide() const { return m_mainFrameIsPinnedToRightSide; }
779     bool isPinnedToTopSide() const { return m_mainFrameIsPinnedToTopSide; }
780     bool isPinnedToBottomSide() const { return m_mainFrameIsPinnedToBottomSide; }
781
782     bool rubberBandsAtLeft() const;
783     void setRubberBandsAtLeft(bool);
784     bool rubberBandsAtRight() const;
785     void setRubberBandsAtRight(bool);
786     bool rubberBandsAtTop() const;
787     void setRubberBandsAtTop(bool);
788     bool rubberBandsAtBottom() const;
789     void setRubberBandsAtBottom(bool);
790
791     void setShouldUseImplicitRubberBandControl(bool shouldUseImplicitRubberBandControl) { m_shouldUseImplicitRubberBandControl = shouldUseImplicitRubberBandControl; }
792     bool shouldUseImplicitRubberBandControl() const { return m_shouldUseImplicitRubberBandControl; }
793         
794     void setEnableVerticalRubberBanding(bool);
795     bool verticalRubberBandingIsEnabled() const;
796     void setEnableHorizontalRubberBanding(bool);
797     bool horizontalRubberBandingIsEnabled() const;
798         
799     void setBackgroundExtendsBeyondPage(bool);
800     bool backgroundExtendsBeyondPage() const;
801
802     void setPaginationMode(WebCore::Pagination::Mode);
803     WebCore::Pagination::Mode paginationMode() const { return m_paginationMode; }
804     void setPaginationBehavesLikeColumns(bool);
805     bool paginationBehavesLikeColumns() const { return m_paginationBehavesLikeColumns; }
806     void setPageLength(double);
807     double pageLength() const { return m_pageLength; }
808     void setGapBetweenPages(double);
809     double gapBetweenPages() const { return m_gapBetweenPages; }
810     void setPaginationLineGridEnabled(bool);
811     bool paginationLineGridEnabled() const { return m_paginationLineGridEnabled; }
812     unsigned pageCount() const { return m_pageCount; }
813         
814 #if PLATFORM(MAC)
815     void setUseSystemAppearance(bool);
816     bool useSystemAppearance() const { return m_useSystemAppearance; }
817     void setDefaultAppearance(bool);
818     bool defaultAppearance() const { return m_defaultAppearance; }
819 #endif
820
821 #if PLATFORM(COCOA)
822     // Called by the web process through a message.
823     void registerWebProcessAccessibilityToken(const IPC::DataReference&);
824     // Called by the UI process when it is ready to send its tokens to the web process.
825     void registerUIProcessAccessibilityTokens(const IPC::DataReference& elemenToken, const IPC::DataReference& windowToken);
826     bool readSelectionFromPasteboard(const String& pasteboardName);
827     String stringSelectionForPasteboard();
828     RefPtr<WebCore::SharedBuffer> dataSelectionForPasteboard(const String& pasteboardType);
829     void makeFirstResponder();
830     void assistiveTechnologyMakeFirstResponder();
831
832     ColorSpaceData colorSpace();
833 #endif
834
835 #if ENABLE(SERVICE_CONTROLS)
836     void replaceSelectionWithPasteboardData(const Vector<String>& types, const IPC::DataReference&);
837 #endif
838
839     void pageScaleFactorDidChange(double);
840     void pluginScaleFactorDidChange(double);
841     void pluginZoomFactorDidChange(double);
842
843     // Find.
844     void findString(const String&, FindOptions, unsigned maxMatchCount);
845     void findStringMatches(const String&, FindOptions, unsigned maxMatchCount);
846     void getImageForFindMatch(int32_t matchIndex);
847     void selectFindMatch(int32_t matchIndex);
848     void didGetImageForFindMatch(const ShareableBitmap::Handle& contentImageHandle, uint32_t matchIndex);
849     void hideFindUI();
850     void countStringMatches(const String&, FindOptions, unsigned maxMatchCount);
851     void didCountStringMatches(const String&, uint32_t matchCount);
852     void setTextIndicator(const WebCore::TextIndicatorData&, uint64_t /* WebCore::TextIndicatorWindowLifetime */ lifetime = 0 /* Permanent */);
853     void setTextIndicatorAnimationProgress(float);
854     void clearTextIndicator();
855     void didFindString(const String&, const Vector<WebCore::IntRect>&, uint32_t matchCount, int32_t matchIndex, bool didWrapAround);
856     void didFailToFindString(const String&);
857     void didFindStringMatches(const String&, const Vector<Vector<WebCore::IntRect>>& matchRects, int32_t firstIndexAfterSelection);
858
859     void getContentsAsString(WTF::Function<void (const String&, CallbackBase::Error)>&&);
860     void getBytecodeProfile(WTF::Function<void (const String&, CallbackBase::Error)>&&);
861     void getSamplingProfilerOutput(WTF::Function<void (const String&, CallbackBase::Error)>&&);
862     void isWebProcessResponsive(WTF::Function<void (bool isWebProcessResponsive)>&&);
863
864 #if ENABLE(MHTML)
865     void getContentsAsMHTMLData(Function<void (API::Data*, CallbackBase::Error)>&&);
866 #endif
867     void getMainResourceDataOfFrame(WebFrameProxy*, Function<void (API::Data*, CallbackBase::Error)>&&);
868     void getResourceDataFromFrame(WebFrameProxy*, API::URL*, Function<void (API::Data*, CallbackBase::Error)>&&);
869     void getRenderTreeExternalRepresentation(WTF::Function<void (const String&, CallbackBase::Error)>&&);
870     void getSelectionOrContentsAsString(WTF::Function<void (const String&, CallbackBase::Error)>&&);
871     void getSelectionAsWebArchiveData(Function<void (API::Data*, CallbackBase::Error)>&&);
872     void getSourceForFrame(WebFrameProxy*, WTF::Function<void (const String&, CallbackBase::Error)>&&);
873     void getWebArchiveOfFrame(WebFrameProxy*, Function<void (API::Data*, CallbackBase::Error)>&&);
874     void runJavaScriptInMainFrame(const String&, bool, WTF::Function<void (API::SerializedScriptValue*, bool hadException, const WebCore::ExceptionDetails&, CallbackBase::Error)>&& callbackFunction);
875     void forceRepaint(RefPtr<VoidCallback>&&);
876
877     float headerHeight(WebFrameProxy&);
878     float footerHeight(WebFrameProxy&);
879     void drawHeader(WebFrameProxy&, WebCore::FloatRect&&);
880     void drawFooter(WebFrameProxy&, WebCore::FloatRect&&);
881
882 #if PLATFORM(COCOA)
883     // Dictionary.
884     void performDictionaryLookupAtLocation(const WebCore::FloatPoint&);
885     void performDictionaryLookupOfCurrentSelection();
886 #endif
887
888     void receivedPolicyDecision(WebCore::PolicyAction, WebFrameProxy&, uint64_t listenerID, API::Navigation* navigationID, std::optional<WebsitePoliciesData>&&);
889
890     void backForwardRemovedItem(const WebCore::BackForwardItemIdentifier&);
891
892 #if ENABLE(DRAG_SUPPORT)    
893     // Drag and drop support.
894     void dragEntered(WebCore::DragData&, const String& dragStorageName = String());
895     void dragUpdated(WebCore::DragData&, const String& dragStorageName = String());
896     void dragExited(WebCore::DragData&, const String& dragStorageName = String());
897     void performDragOperation(WebCore::DragData&, const String& dragStorageName, SandboxExtension::Handle&&, SandboxExtension::HandleArray&&);
898
899     void didPerformDragControllerAction(uint64_t dragOperation, bool mouseIsOverFileInput, unsigned numberOfItemsToBeAccepted, const WebCore::IntRect& insertionRect);
900     void dragEnded(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition, uint64_t operation);
901     void didStartDrag();
902     void dragCancelled();
903     void setDragCaretRect(const WebCore::IntRect&);
904 #if PLATFORM(COCOA)
905     void startDrag(const WebCore::DragItem&, const ShareableBitmap::Handle& dragImageHandle);
906     void setPromisedDataForImage(const String& pasteboardName, const SharedMemory::Handle& imageHandle, uint64_t imageSize, const String& filename, const String& extension,
907                          const String& title, const String& url, const String& visibleURL, const SharedMemory::Handle& archiveHandle, uint64_t archiveSize);
908 #endif
909 #if PLATFORM(GTK)
910     void startDrag(WebSelectionData&&, uint64_t dragOperation, const ShareableBitmap::Handle& dragImage);
911 #endif
912 #endif
913
914     void processDidBecomeUnresponsive();
915     void processDidBecomeResponsive();
916     void processDidTerminate(ProcessTerminationReason);
917     void willChangeProcessIsResponsive();
918     void didChangeProcessIsResponsive();
919
920 #if PLATFORM(IOS)
921     void processWillBecomeSuspended();
922     void processWillBecomeForeground();
923 #endif
924
925     virtual void enterAcceleratedCompositingMode(const LayerTreeContext&);
926     virtual void exitAcceleratedCompositingMode();
927     virtual void updateAcceleratedCompositingMode(const LayerTreeContext&);
928
929     enum UndoOrRedo { Undo, Redo };
930     void addEditCommand(WebEditCommandProxy*);
931     void removeEditCommand(WebEditCommandProxy*);
932     bool isValidEditCommand(WebEditCommandProxy*);
933     void registerEditCommand(Ref<WebEditCommandProxy>&&, UndoOrRedo);
934
935     bool canUndo();
936     bool canRedo();
937
938 #if PLATFORM(COCOA)
939     void registerKeypressCommandName(const String& name) { m_knownKeypressCommandNames.add(name); }
940     bool isValidKeypressCommandName(const String& name) const { return m_knownKeypressCommandNames.contains(name); }
941 #endif
942
943     WebProcessProxy& process() { return m_process; }
944     ProcessID processIdentifier() const;
945
946     WebPreferences& preferences() { return m_preferences; }
947     void setPreferences(WebPreferences&);
948
949     WebPageGroup& pageGroup() { return m_pageGroup; }
950
951     bool isValid() const;
952
953 #if ENABLE(DRAG_SUPPORT)
954     WebCore::DragOperation currentDragOperation() const { return m_currentDragOperation; }
955     bool currentDragIsOverFileInput() const { return m_currentDragIsOverFileInput; }
956     unsigned currentDragNumberOfFilesToBeAccepted() const { return m_currentDragNumberOfFilesToBeAccepted; }
957     WebCore::IntRect currentDragCaretRect() const { return m_currentDragCaretRect; }
958     void resetCurrentDragInformation();
959     void didEndDragging();
960 #endif
961
962     void preferencesDidChange();
963
964 #if ENABLE(CONTEXT_MENUS)
965     // Called by the WebContextMenuProxy.
966     void contextMenuItemSelected(const WebContextMenuItemData&);
967     void handleContextMenuKeyEvent();
968 #endif
969
970     // Called by the WebOpenPanelResultListenerProxy.
971 #if PLATFORM(IOS)
972     void didChooseFilesForOpenPanelWithDisplayStringAndIcon(const Vector<String>&, const String& displayString, const API::Data* iconData);
973 #endif
974     void didChooseFilesForOpenPanel(const Vector<String>&);
975     void didCancelForOpenPanel();
976
977     WebPageCreationParameters creationParameters();
978
979     void handleDownloadRequest(DownloadProxy*);
980
981     void advanceToNextMisspelling(bool startBeforeSelection);
982     void changeSpellingToWord(const String& word);
983 #if USE(APPKIT)
984     void uppercaseWord();
985     void lowercaseWord();
986     void capitalizeWord();
987 #endif
988
989 #if PLATFORM(COCOA)
990     bool isSmartInsertDeleteEnabled() const { return m_isSmartInsertDeleteEnabled; }
991     void setSmartInsertDeleteEnabled(bool);
992 #endif
993
994 #if PLATFORM(GTK)
995     String accessibilityPlugID() const { return m_accessibilityPlugID; }
996 #endif
997
998     void setCanRunModal(bool);
999     bool canRunModal();
1000
1001     void beginPrinting(WebFrameProxy*, const PrintInfo&);
1002     void endPrinting();
1003     void computePagesForPrinting(WebFrameProxy*, const PrintInfo&, Ref<ComputedPagesCallback>&&);
1004 #if PLATFORM(COCOA)
1005     void drawRectToImage(WebFrameProxy*, const PrintInfo&, const WebCore::IntRect&, const WebCore::IntSize&, Ref<ImageCallback>&&);
1006     void drawPagesToPDF(WebFrameProxy*, const PrintInfo&, uint32_t first, uint32_t count, Ref<DataCallback>&&);
1007 #if PLATFORM(IOS)
1008     uint32_t computePagesForPrintingAndDrawToPDF(uint64_t frameID, const PrintInfo&, DrawToPDFCallback::CallbackFunction&&);
1009     void drawToPDFCallback(const IPC::DataReference& pdfData, WebKit::CallbackID);
1010 #endif
1011 #elif PLATFORM(GTK)
1012     void drawPagesForPrinting(WebFrameProxy*, const PrintInfo&, Ref<PrintFinishedCallback>&&);
1013 #endif
1014
1015     PageLoadState& pageLoadState() { return m_pageLoadState; }
1016
1017 #if PLATFORM(COCOA)
1018     void handleAlternativeTextUIResult(const String& result);
1019 #endif
1020
1021     void saveDataToFileInDownloadsFolder(String&& suggestedFilename, String&& mimeType, WebCore::URL&& originatingURL, API::Data&);
1022     void savePDFToFileInDownloadsFolder(String&& suggestedFilename, WebCore::URL&& originatingURL, const IPC::DataReference&);
1023 #if PLATFORM(COCOA)
1024     void savePDFToTemporaryFolderAndOpenWithNativeApplicationRaw(const String& suggestedFilename, const String& originatingURLString, const uint8_t* data, unsigned long size, const String& pdfUUID);
1025     void savePDFToTemporaryFolderAndOpenWithNativeApplication(const String& suggestedFilename, const String& originatingURLString, const IPC::DataReference&, const String& pdfUUID);
1026     void openPDFFromTemporaryFolderWithNativeApplication(const String& pdfUUID);
1027 #endif
1028
1029     WebCore::IntRect visibleScrollerThumbRect() const { return m_visibleScrollerThumbRect; }
1030
1031     uint64_t renderTreeSize() const { return m_renderTreeSize; }
1032
1033     void printMainFrame();
1034     
1035     void setMediaVolume(float);
1036     void setMuted(WebCore::MediaProducer::MutedStateFlags);
1037     void setMayStartMediaWhenInWindow(bool);
1038     bool mayStartMediaWhenInWindow() const { return m_mayStartMediaWhenInWindow; }
1039     void setMediaCaptureEnabled(bool);
1040     bool mediaCaptureEnabled() const { return m_mediaCaptureEnabled; }
1041     void stopMediaCapture();
1042
1043 #if ENABLE(MEDIA_SESSION)
1044     bool hasMediaSessionWithActiveMediaElements() const { return m_hasMediaSessionWithActiveMediaElements; }
1045     void handleMediaEvent(WebCore::MediaEventType);
1046     void setVolumeOfMediaElement(double, uint64_t);
1047 #endif
1048         
1049 #if ENABLE(POINTER_LOCK)
1050     void didAllowPointerLock();
1051     void didDenyPointerLock();
1052 #endif
1053
1054     // WebPopupMenuProxy::Client
1055     NativeWebMouseEvent* currentlyProcessedMouseDownEvent() override;
1056
1057     void setSuppressVisibilityUpdates(bool flag);
1058     bool suppressVisibilityUpdates() { return m_suppressVisibilityUpdates; }
1059
1060 #if PLATFORM(IOS)
1061     void willStartUserTriggeredZooming();
1062
1063     void potentialTapAtPosition(const WebCore::FloatPoint&, uint64_t& requestID);
1064     void commitPotentialTap(uint64_t layerTreeTransactionIdAtLastTouchStart);
1065     void cancelPotentialTap();
1066     void tapHighlightAtPosition(const WebCore::FloatPoint&, uint64_t& requestID);
1067     void handleTap(const WebCore::FloatPoint&, uint64_t layerTreeTransactionIdAtLastTouchStart);
1068
1069     void inspectorNodeSearchMovedToPosition(const WebCore::FloatPoint&);
1070     void inspectorNodeSearchEndedAtPosition(const WebCore::FloatPoint&);
1071
1072     void blurAssistedNode();
1073 #endif
1074
1075     void postMessageToInjectedBundle(const String& messageName, API::Object* messageBody);
1076
1077 #if ENABLE(INPUT_TYPE_COLOR)
1078     void setColorPickerColor(const WebCore::Color&);
1079     void endColorPicker();
1080 #endif
1081
1082     WebCore::IntSize viewLayoutSize() const { return m_viewLayoutSize; }
1083     void setViewLayoutSize(const WebCore::IntSize&);
1084
1085     bool autoSizingShouldExpandToViewHeight() const { return m_autoSizingShouldExpandToViewHeight; }
1086     void setAutoSizingShouldExpandToViewHeight(bool);
1087
1088     void setViewportSizeForCSSViewportUnits(const WebCore::IntSize&);
1089     WebCore::IntSize viewportSizeForCSSViewportUnits() const { return m_viewportSizeForCSSViewportUnits.value_or(WebCore::IntSize()); }
1090
1091     void didReceiveAuthenticationChallengeProxy(uint64_t frameID, Ref<AuthenticationChallengeProxy>&&);
1092
1093     int64_t spellDocumentTag();
1094     void didFinishCheckingText(uint64_t requestID, const Vector<WebCore::TextCheckingResult>&);
1095     void didCancelCheckingText(uint64_t requestID);
1096
1097     void connectionWillOpen(IPC::Connection&);
1098     void webProcessWillShutDown();
1099
1100     void processDidFinishLaunching();
1101
1102     void didSaveToPageCache();
1103         
1104     void setScrollPinningBehavior(WebCore::ScrollPinningBehavior);
1105     WebCore::ScrollPinningBehavior scrollPinningBehavior() const { return m_scrollPinningBehavior; }
1106
1107     void setOverlayScrollbarStyle(std::optional<WebCore::ScrollbarOverlayStyle>);
1108     std::optional<WebCore::ScrollbarOverlayStyle> overlayScrollbarStyle() const { return m_scrollbarOverlayStyle; }
1109
1110     bool shouldRecordNavigationSnapshots() const { return m_shouldRecordNavigationSnapshots; }
1111     void setShouldRecordNavigationSnapshots(bool shouldRecordSnapshots) { m_shouldRecordNavigationSnapshots = shouldRecordSnapshots; }
1112     void recordAutomaticNavigationSnapshot();
1113     void recordNavigationSnapshot(WebBackForwardListItem&);
1114     void requestAssistedNodeInformation(Function<void(const AssistedNodeInformation&, CallbackBase::Error)>&&);
1115
1116 #if PLATFORM(COCOA)
1117     RefPtr<ViewSnapshot> takeViewSnapshot();
1118 #endif
1119
1120 #if ENABLE(SUBTLE_CRYPTO)
1121     void wrapCryptoKey(const Vector<uint8_t>&, bool& succeeded, Vector<uint8_t>&);
1122     void unwrapCryptoKey(const Vector<uint8_t>&, bool& succeeded, Vector<uint8_t>&);
1123 #endif
1124
1125     void signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String& challengeString, const WebCore::URL&, String& result);
1126
1127     void takeSnapshot(WebCore::IntRect, WebCore::IntSize bitmapSize, SnapshotOptions, WTF::Function<void (const ShareableBitmap::Handle&, CallbackBase::Error)>&&);
1128
1129     void navigationGestureDidBegin();
1130     void navigationGestureWillEnd(bool willNavigate, WebBackForwardListItem&);
1131     void navigationGestureDidEnd(bool willNavigate, WebBackForwardListItem&);
1132     void navigationGestureDidEnd();
1133     void navigationGestureSnapshotWasRemoved();
1134     void willRecordNavigationSnapshot(WebBackForwardListItem&);
1135
1136     bool isShowingNavigationGestureSnapshot() const { return m_isShowingNavigationGestureSnapshot; }
1137
1138     bool isPlayingAudio() const { return !!(m_mediaState & WebCore::MediaProducer::IsPlayingAudio); }
1139     void isPlayingMediaDidChange(WebCore::MediaProducer::MediaStateFlags, uint64_t);
1140     bool hasActiveAudioStream() const { return m_mediaState & WebCore::MediaProducer::HasActiveAudioCaptureDevice; }
1141     bool hasActiveVideoStream() const { return m_mediaState & WebCore::MediaProducer::HasActiveVideoCaptureDevice; }
1142     WebCore::MediaProducer::MediaStateFlags mediaStateFlags() const { return m_mediaState; }
1143     void handleAutoplayEvent(WebCore::AutoplayEvent, OptionSet<WebCore::AutoplayEventFlags>);
1144
1145     void videoControlsManagerDidChange();
1146     bool hasActiveVideoForControlsManager() const;
1147     void requestControlledElementID() const;
1148     void handleControlledElementIDResponse(const String&) const;
1149     bool isPlayingVideoInEnhancedFullscreen() const;
1150
1151 #if PLATFORM(COCOA)
1152     void requestActiveNowPlayingSessionInfo(Ref<NowPlayingInfoCallback>&&);
1153     void nowPlayingInfoCallback(bool, bool, const String&, double, double, uint64_t, CallbackID);
1154 #endif
1155
1156 #if ENABLE(MEDIA_SESSION)
1157     void hasMediaSessionWithActiveMediaElementsDidChange(bool);
1158     void mediaSessionMetadataDidChange(const WebCore::MediaSessionMetadata&);
1159     void focusedContentMediaElementDidChange(uint64_t);
1160 #endif
1161
1162 #if PLATFORM(MAC)
1163     API::HitTestResult* lastMouseMoveHitTestResult() const { return m_lastMouseMoveHitTestResult.get(); }
1164     void performImmediateActionHitTestAtLocation(WebCore::FloatPoint);
1165
1166     void immediateActionDidUpdate();
1167     void immediateActionDidCancel();
1168     void immediateActionDidComplete();
1169
1170     void* immediateActionAnimationControllerForHitTestResult(RefPtr<API::HitTestResult>, uint64_t, RefPtr<API::Object>);
1171
1172     void installActivityStateChangeCompletionHandler(WTF::Function<void ()>&&);
1173
1174     void handleAcceptedCandidate(WebCore::TextCheckingResult);
1175     void didHandleAcceptedCandidate();
1176
1177     void setHeaderBannerHeightForTesting(int);
1178     void setFooterBannerHeightForTesting(int);
1179 #endif
1180
1181 #if USE(UNIFIED_TEXT_CHECKING)
1182     void checkTextOfParagraph(const String& text, uint64_t checkingTypes, int32_t insertionPoint, Vector<WebCore::TextCheckingResult>& results);
1183 #endif
1184     void getGuessesForWord(const String& word, const String& context, int32_t insertionPoint, Vector<String>& guesses);
1185
1186     void setShouldDispatchFakeMouseMoveEvents(bool);
1187
1188     // Diagnostic messages logging.
1189     void logDiagnosticMessage(const String& message, const String& description, WebCore::ShouldSample);
1190     void logDiagnosticMessageWithResult(const String& message, const String& description, uint32_t result, WebCore::ShouldSample);
1191     void logDiagnosticMessageWithValue(const String& message, const String& description, double value, unsigned significantFigures, WebCore::ShouldSample);
1192     void logDiagnosticMessageWithEnhancedPrivacy(const String& message, const String& description, WebCore::ShouldSample);
1193
1194     // Performance logging.
1195     void logScrollingEvent(uint32_t eventType, MonotonicTime, uint64_t);
1196
1197     // Form validation messages.
1198     void showValidationMessage(const WebCore::IntRect& anchorClientRect, const String& message);
1199     void hideValidationMessage();
1200 #if PLATFORM(COCOA)
1201     WebCore::ValidationBubble* validationBubble() const { return m_validationBubble.get(); } // For testing.
1202 #endif
1203
1204 #if PLATFORM(IOS)
1205     void setIsKeyboardAnimatingIn(bool isKeyboardAnimatingIn) { m_isKeyboardAnimatingIn = isKeyboardAnimatingIn; }
1206 #endif
1207
1208 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
1209     void addPlaybackTargetPickerClient(uint64_t);
1210     void removePlaybackTargetPickerClient(uint64_t);
1211     void showPlaybackTargetPicker(uint64_t, const WebCore::FloatRect&, bool hasVideo);
1212     void playbackTargetPickerClientStateDidChange(uint64_t, WebCore::MediaProducer::MediaStateFlags);
1213     void setMockMediaPlaybackTargetPickerEnabled(bool);
1214     void setMockMediaPlaybackTargetPickerState(const String&, WebCore::MediaPlaybackTargetContext::State);
1215
1216     // WebMediaSessionManagerClient
1217     void setPlaybackTarget(uint64_t, Ref<WebCore::MediaPlaybackTarget>&&) override;
1218     void externalOutputDeviceAvailableDidChange(uint64_t, bool) override;
1219     void setShouldPlayToPlaybackTarget(uint64_t, bool) override;
1220 #endif
1221
1222     void didChangeBackgroundColor();
1223     void didLayoutForCustomContentProvider();
1224
1225     // For testing
1226     void clearWheelEventTestTrigger();
1227     void callAfterNextPresentationUpdate(WTF::Function<void (CallbackBase::Error)>&&);
1228
1229     void didReachLayoutMilestone(uint32_t layoutMilestones);
1230
1231     void didRestoreScrollPosition();
1232
1233     void getLoadDecisionForIcon(const WebCore::LinkIcon&, WebKit::CallbackID);
1234     void finishedLoadingIcon(WebKit::CallbackID, const IPC::DataReference&);
1235
1236     void setFocus(bool focused);
1237     void setWindowFrame(const WebCore::FloatRect&);
1238     void getWindowFrame(Ref<Messages::WebPageProxy::GetWindowFrame::DelayedReply>&&);
1239     void getWindowFrameWithCallback(Function<void(WebCore::FloatRect)>&&);
1240
1241     bool isResourceCachingDisabled() const { return m_isResourceCachingDisabled; }
1242     void setResourceCachingDisabled(bool);
1243
1244     WebCore::UserInterfaceLayoutDirection userInterfaceLayoutDirection();
1245     void setUserInterfaceLayoutDirection(WebCore::UserInterfaceLayoutDirection);
1246
1247     bool hasHadSelectionChangesFromUserInteraction() const { return m_hasHadSelectionChangesFromUserInteraction; }
1248     bool needsHiddenContentEditableQuirk() const { return m_needsHiddenContentEditableQuirk; }
1249     bool needsPlainTextQuirk() const { return m_needsPlainTextQuirk; }
1250
1251     bool isAlwaysOnLoggingAllowed() const;
1252
1253     void canAuthenticateAgainstProtectionSpace(uint64_t loaderID, uint64_t frameID, const WebCore::ProtectionSpace&);
1254
1255 #if ENABLE(GAMEPAD)
1256     void gamepadActivity(const Vector<GamepadData>&, bool shouldMakeGamepadsVisible);
1257 #endif
1258         
1259     WeakPtr<WebPageProxy> createWeakPtr() const { return m_weakPtrFactory.createWeakPtr(*const_cast<WebPageProxy*>(this)); }
1260
1261     void isLoadingChanged() { activityStateDidChange(WebCore::ActivityState::IsLoading); }
1262
1263     void clearUserMediaState();
1264
1265     void setShouldSkipWaitingForPaintAfterNextViewDidMoveToWindow(bool shouldSkip) { m_shouldSkipWaitingForPaintAfterNextViewDidMoveToWindow = shouldSkip; }
1266
1267     void setURLSchemeHandlerForScheme(Ref<WebURLSchemeHandler>&&, const String& scheme);
1268     WebURLSchemeHandler* urlSchemeHandlerForScheme(const String& scheme);
1269
1270 #if PLATFORM(COCOA)
1271     void createSandboxExtensionsIfNeeded(const Vector<String>& files, SandboxExtension::Handle& fileReadHandle, SandboxExtension::HandleArray& fileUploadHandles);
1272 #endif
1273     void editorStateChanged(const EditorState&);
1274
1275 #if PLATFORM(COCOA)
1276     void touchBarMenuDataRemoved();
1277     void touchBarMenuDataChanged(const TouchBarMenuData&);
1278     void touchBarMenuItemDataAdded(const TouchBarMenuItemData&);
1279     void touchBarMenuItemDataRemoved(const TouchBarMenuItemData&);
1280 #endif
1281
1282 #if HAVE(CFNETWORK_STORAGE_PARTITIONING)
1283     void hasStorageAccess(String&& subFrameHost, String&& topFrameHost, uint64_t frameID, uint64_t pageID, uint64_t webProcessContextId);
1284     void requestStorageAccess(String&& subFrameHost, String&& topFrameHost, uint64_t frameID, uint64_t pageID, uint64_t webProcessContextId);
1285 #endif
1286
1287 #if ENABLE(ATTACHMENT_ELEMENT)
1288     void insertAttachment(const String& identifier, const WebCore::AttachmentDisplayOptions&, const String& filename, std::optional<String> contentType, WebCore::SharedBuffer& data, Function<void(CallbackBase::Error)>&&);
1289     void requestAttachmentInfo(const String& identifier, Function<void(const WebCore::AttachmentInfo&, CallbackBase::Error)>&&);
1290     void setAttachmentDisplayOptions(const String& identifier, WebCore::AttachmentDisplayOptions, Function<void(CallbackBase::Error)>&&);
1291     void setAttachmentDataAndContentType(const String& identifier, WebCore::SharedBuffer& data, std::optional<String>&& newContentType, std::optional<String>&& newFilename, Function<void(CallbackBase::Error)>&&);
1292     void attachmentInfoCallback(const WebCore::AttachmentInfo&, CallbackID);
1293 #endif
1294
1295 #if ENABLE(APPLICATION_MANIFEST)
1296     void getApplicationManifest(Function<void(const std::optional<WebCore::ApplicationManifest>&, CallbackBase::Error)>&&);
1297 #endif
1298
1299     void writeBlobToFilePath(const WebCore::URL& blobURL, const String& path, Function<void(bool success)>&&);
1300
1301     WebPreferencesStore preferencesStore() const;
1302
1303     SuspendedPageProxy* maybeCreateSuspendedPage(WebProcessProxy&, API::Navigation&);
1304     SuspendedPageProxy* suspendedPage() const { return m_suspendedPage.get(); }
1305     void suspendedPageClosed(SuspendedPageProxy&);
1306
1307 private:
1308     WebPageProxy(PageClient&, WebProcessProxy&, uint64_t pageID, Ref<API::PageConfiguration>&&);
1309     void platformInitialize();
1310
1311     void notifyProcessPoolToPrewarm();
1312
1313     RefPtr<API::Navigation> goToBackForwardItem(WebBackForwardListItem&, WebCore::FrameLoadType);
1314
1315     void updateActivityState(WebCore::ActivityState::Flags flagsToUpdate = WebCore::ActivityState::AllFlags);
1316     void updateThrottleState();
1317     void updateHiddenPageThrottlingAutoIncreases();
1318
1319     enum class ResetStateReason {
1320         PageInvalidated,
1321         WebProcessExited,
1322         NavigationSwap,
1323     };
1324     void resetState(ResetStateReason);
1325     void resetStateAfterProcessExited(ProcessTerminationReason);
1326
1327     void setUserAgent(String&&);
1328
1329     // IPC::MessageReceiver
1330     // Implemented in generated WebPageProxyMessageReceiver.cpp
1331     void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override;
1332     void didReceiveSyncMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&) override;
1333
1334
1335     // IPC::MessageSender
1336     bool sendMessage(std::unique_ptr<IPC::Encoder>, OptionSet<IPC::SendOption>) override;
1337     IPC::Connection* messageSenderConnection() override;
1338     uint64_t messageSenderDestinationID() override;
1339
1340     // WebPopupMenuProxy::Client
1341     void valueChangedForPopupMenu(WebPopupMenuProxy*, int32_t newSelectedIndex) override;
1342     void setTextFromItemForPopupMenu(WebPopupMenuProxy*, int32_t index) override;
1343 #if PLATFORM(GTK)
1344     void failedToShowPopupMenu() override;
1345 #endif
1346
1347 #if ENABLE(POINTER_LOCK)
1348     void requestPointerLock();
1349     void requestPointerUnlock();
1350 #endif
1351
1352     void didCreateMainFrame(uint64_t frameID);
1353     void didCreateSubframe(uint64_t frameID);
1354     void didCreateWindow(uint64_t frameID, WebCore::GlobalWindowIdentifier&&);
1355
1356     void didStartProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, WebCore::URL&&, WebCore::URL&& unreachableURL, const UserData&);
1357     void didReceiveServerRedirectForProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, WebCore::ResourceRequest&&, const UserData&);
1358     void willPerformClientRedirectForFrame(uint64_t frameID, const String& url, double delay);
1359     void didCancelClientRedirectForFrame(uint64_t frameID);
1360     void didChangeProvisionalURLForFrame(uint64_t frameID, uint64_t navigationID, WebCore::URL&&);
1361     void didFailProvisionalLoadForFrame(uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, uint64_t navigationID, const String& provisionalURL, const WebCore::ResourceError&, const UserData&);
1362     void didCommitLoadForFrame(uint64_t frameID, uint64_t navigationID, const String& mimeType, bool frameHasCustomContentProvider, uint32_t frameLoadType, const WebCore::CertificateInfo&, bool containsPluginDocument, std::optional<WebCore::HasInsecureContent> forcedHasInsecureContent, const UserData&);
1363     void didFinishDocumentLoadForFrame(uint64_t frameID, uint64_t navigationID, const UserData&);
1364     void didFinishLoadForFrame(uint64_t frameID, uint64_t navigationID, const UserData&);
1365     void didFailLoadForFrame(uint64_t frameID, uint64_t navigationID, const WebCore::ResourceError&, const UserData&);
1366     void didSameDocumentNavigationForFrame(uint64_t frameID, uint64_t navigationID, uint32_t sameDocumentNavigationType, WebCore::URL&&, const UserData&);
1367     void didChangeMainDocument(uint64_t frameID);
1368
1369     void didReceiveTitleForFrame(uint64_t frameID, const String&, const UserData&);
1370     void didFirstLayoutForFrame(uint64_t frameID, const UserData&);
1371     void didFirstVisuallyNonEmptyLayoutForFrame(uint64_t frameID, const UserData&);
1372     void didDisplayInsecureContentForFrame(uint64_t frameID, const UserData&);
1373     void didRunInsecureContentForFrame(uint64_t frameID, const UserData&);
1374     void didDetectXSSForFrame(uint64_t frameID, const UserData&);
1375     void mainFramePluginHandlesPageScaleGestureDidChange(bool);
1376     void frameDidBecomeFrameSet(uint64_t frameID, bool);
1377     void didStartProgress();
1378     void didChangeProgress(double);
1379     void didFinishProgress();
1380     void setNetworkRequestsInProgress(bool);
1381
1382     void hasInsecureContent(WebCore::HasInsecureContent&);
1383
1384     void didDestroyNavigation(uint64_t navigationID);
1385
1386     void decidePolicyForNavigationAction(uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, uint64_t navigationID, NavigationActionData&&, const FrameInfoData&, uint64_t originatingPageID, const WebCore::ResourceRequest& originalRequest, WebCore::ResourceRequest&&, uint64_t listenerID, const UserData&);
1387     void decidePolicyForNavigationActionSync(uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, uint64_t navigationID, NavigationActionData&&, const FrameInfoData&, uint64_t originatingPageID, const WebCore::ResourceRequest& originalRequest, WebCore::ResourceRequest&&, uint64_t listenerID, const UserData&, Ref<Messages::WebPageProxy::DecidePolicyForNavigationActionSync::DelayedReply>&&);
1388     void decidePolicyForNewWindowAction(uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, NavigationActionData&&, WebCore::ResourceRequest&&, const String& frameName, uint64_t listenerID, const UserData&);
1389     void decidePolicyForResponse(uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, uint64_t navigationID, const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, bool canShowMIMEType, uint64_t listenerID, const UserData&);
1390     void unableToImplementPolicy(uint64_t frameID, const WebCore::ResourceError&, const UserData&);
1391
1392     void willSubmitForm(uint64_t frameID, uint64_t sourceFrameID, const Vector<std::pair<String, String>>& textFieldValues, uint64_t listenerID, const UserData&);
1393         
1394     void contentRuleListNotification(WebCore::URL&&, Vector<String>&& identifiers, Vector<String>&& notifications);
1395
1396     // History client
1397     void didNavigateWithNavigationData(const WebNavigationDataStore&, uint64_t frameID);
1398     void didPerformClientRedirect(const String& sourceURLString, const String& destinationURLString, uint64_t frameID);
1399     void didPerformServerRedirect(const String& sourceURLString, const String& destinationURLString, uint64_t frameID);
1400     void didUpdateHistoryTitle(const String& title, const String& url, uint64_t frameID);
1401
1402     // UI client
1403     void createNewPage(const FrameInfoData&, uint64_t originatingPageID, WebCore::ResourceRequest&&, WebCore::WindowFeatures&&, NavigationActionData&&, Ref<Messages::WebPageProxy::CreateNewPage::DelayedReply>&&);
1404     void showPage();
1405     void runJavaScriptAlert(uint64_t frameID, const WebCore::SecurityOriginData&, const String&, Ref<Messages::WebPageProxy::RunJavaScriptAlert::DelayedReply>&&);
1406     void runJavaScriptConfirm(uint64_t frameID, const WebCore::SecurityOriginData&, const String&, Ref<Messages::WebPageProxy::RunJavaScriptConfirm::DelayedReply>&&);
1407     void runJavaScriptPrompt(uint64_t frameID, const WebCore::SecurityOriginData&, const String&, const String&, Ref<Messages::WebPageProxy::RunJavaScriptPrompt::DelayedReply>&&);
1408     void setStatusText(const String&);
1409     void mouseDidMoveOverElement(WebHitTestResultData&&, uint32_t modifiers, UserData&&);
1410
1411 #if ENABLE(NETSCAPE_PLUGIN_API)
1412     void unavailablePluginButtonClicked(uint32_t opaquePluginUnavailabilityReason, const String& mimeType, const String& pluginURLString, const String& pluginsPageURLString, const String& frameURLString, const String& pageURLString);
1413 #endif // ENABLE(NETSCAPE_PLUGIN_API)
1414 #if ENABLE(WEBGL)
1415     void webGLPolicyForURL(WebCore::URL&&, Ref<Messages::WebPageProxy::WebGLPolicyForURL::DelayedReply>&&);
1416     void resolveWebGLPolicyForURL(WebCore::URL&&, Ref<Messages::WebPageProxy::ResolveWebGLPolicyForURL::DelayedReply>&&);
1417 #endif // ENABLE(WEBGL)
1418     void setToolbarsAreVisible(bool toolbarsAreVisible);
1419     void getToolbarsAreVisible(Ref<Messages::WebPageProxy::GetToolbarsAreVisible::DelayedReply>&&);
1420     void setMenuBarIsVisible(bool menuBarIsVisible);
1421     void getMenuBarIsVisible(Ref<Messages::WebPageProxy::GetMenuBarIsVisible::DelayedReply>&&);
1422     void setStatusBarIsVisible(bool statusBarIsVisible);
1423     void getStatusBarIsVisible(Ref<Messages::WebPageProxy::GetStatusBarIsVisible::DelayedReply>&&);
1424     void setIsResizable(bool isResizable);
1425     void screenToRootView(const WebCore::IntPoint& screenPoint, Ref<Messages::WebPageProxy::ScreenToRootView::DelayedReply>&&);
1426     void rootViewToScreen(const WebCore::IntRect& viewRect, Ref<Messages::WebPageProxy::RootViewToScreen::DelayedReply>&&);
1427 #if PLATFORM(IOS)
1428     void accessibilityScreenToRootView(const WebCore::IntPoint& screenPoint, WebCore::IntPoint& windowPoint);
1429     void rootViewToAccessibilityScreen(const WebCore::IntRect& viewRect, WebCore::IntRect& result);
1430 #endif
1431     void runBeforeUnloadConfirmPanel(uint64_t frameID, const WebCore::SecurityOriginData&, const String& message, RefPtr<Messages::WebPageProxy::RunBeforeUnloadConfirmPanel::DelayedReply>);
1432     void didChangeViewportProperties(const WebCore::ViewportAttributes&);
1433     void pageDidScroll();
1434     void runOpenPanel(uint64_t frameID, const WebCore::SecurityOriginData&, const WebCore::FileChooserSettings&);
1435     void printFrame(uint64_t frameID);
1436     void exceededDatabaseQuota(uint64_t frameID, const String& originIdentifier, const String& databaseName, const String& displayName, uint64_t currentQuota, uint64_t currentOriginUsage, uint64_t currentDatabaseUsage, uint64_t expectedUsage, Ref<Messages::WebPageProxy::ExceededDatabaseQuota::DelayedReply>&&);
1437     void reachedApplicationCacheOriginQuota(const String& originIdentifier, uint64_t currentQuota, uint64_t totalBytesNeeded, Ref<Messages::WebPageProxy::ReachedApplicationCacheOriginQuota::DelayedReply>&&);
1438     void requestGeolocationPermissionForFrame(uint64_t geolocationID, uint64_t frameID, String originIdentifier);
1439
1440 #if ENABLE(MEDIA_STREAM)
1441     UserMediaPermissionRequestManagerProxy& userMediaPermissionRequestManager();
1442 #endif
1443     void requestUserMediaPermissionForFrame(uint64_t userMediaID, uint64_t frameID, const WebCore::SecurityOriginData& userMediaDocumentOriginIdentifier, const WebCore::SecurityOriginData& topLevelDocumentOriginIdentifier, const WebCore::MediaStreamRequest&);
1444     void enumerateMediaDevicesForFrame(uint64_t userMediaID, uint64_t frameID, const WebCore::SecurityOriginData& userMediaDocumentOriginData, const WebCore::SecurityOriginData& topLevelDocumentOriginData);
1445
1446     void runModal();
1447     void notifyScrollerThumbIsVisibleInRect(const WebCore::IntRect&);
1448     void recommendedScrollbarStyleDidChange(int32_t newStyle);
1449     void didChangeScrollbarsForMainFrame(bool hasHorizontalScrollbar, bool hasVerticalScrollbar);
1450     void didChangeScrollOffsetPinningForMainFrame(bool pinnedToLeftSide, bool pinnedToRightSide, bool pinnedToTopSide, bool pinnedToBottomSide);
1451     void didChangePageCount(unsigned);
1452     void pageExtendedBackgroundColorDidChange(const WebCore::Color&);
1453 #if ENABLE(NETSCAPE_PLUGIN_API)
1454     void didFailToInitializePlugin(const String& mimeType, const String& frameURLString, const String& pageURLString);
1455     void didBlockInsecurePluginVersion(const String& mimeType, const String& pluginURLString, const String& frameURLString, const String& pageURLString, bool replacementObscured);
1456 #endif // ENABLE(NETSCAPE_PLUGIN_API)
1457     void setCanShortCircuitHorizontalWheelEvents(bool canShortCircuitHorizontalWheelEvents) { m_canShortCircuitHorizontalWheelEvents = canShortCircuitHorizontalWheelEvents; }
1458
1459     void reattachToWebProcess();
1460
1461     enum class ReattachForBackForward {
1462         Yes,
1463         No
1464     };
1465     void reattachToWebProcess(Ref<WebProcessProxy>&&, API::Navigation*, ReattachForBackForward);
1466
1467     RefPtr<API::Navigation> reattachToWebProcessForReload();
1468     RefPtr<API::Navigation> reattachToWebProcessWithItem(WebBackForwardListItem&);
1469
1470     void loadRequestWithNavigation(API::Navigation&, WebCore::ResourceRequest&&, WebCore::ShouldOpenExternalURLsPolicy, API::Object* userData, WebCore::NavigationPolicyCheck);
1471
1472     void requestNotificationPermission(uint64_t notificationID, const String& originString);
1473     void showNotification(const String& title, const String& body, const String& iconURL, const String& tag, const String& lang, WebCore::NotificationDirection, const String& originString, uint64_t notificationID);
1474     void cancelNotification(uint64_t notificationID);
1475     void clearNotifications(const Vector<uint64_t>& notificationIDs);
1476     void didDestroyNotification(uint64_t notificationID);
1477
1478     void didChangeContentSize(const WebCore::IntSize&);
1479
1480 #if ENABLE(INPUT_TYPE_COLOR)
1481     void showColorPicker(const WebCore::Color& initialColor, const WebCore::IntRect&);
1482     void didChooseColor(const WebCore::Color&) override;
1483     void didEndColorPicker() override;
1484 #endif
1485
1486     void compositionWasCanceled();
1487     void setHasHadSelectionChangesFromUserInteraction(bool);
1488     void setNeedsHiddenContentEditableQuirk(bool);
1489     void setNeedsPlainTextQuirk(bool);
1490
1491     // Back/Forward list management
1492     void backForwardAddItem(BackForwardListItemState&&);
1493     void backForwardGoToItem(const WebCore::BackForwardItemIdentifier&, SandboxExtension::Handle&);
1494     void backForwardItemAtIndex(int32_t index, std::optional<WebCore::BackForwardItemIdentifier>&);
1495     void backForwardBackListCount(int32_t& count);
1496     void backForwardForwardListCount(int32_t& count);
1497     void backForwardClear();
1498
1499     // Undo management
1500     void registerEditCommandForUndo(uint64_t commandID, uint32_t editAction);
1501     void registerInsertionUndoGrouping();
1502     void clearAllEditCommands();
1503     void canUndoRedo(uint32_t action, bool& result);
1504     void executeUndoRedo(uint32_t action, bool& result);
1505
1506     // Keyboard handling
1507 #if PLATFORM(COCOA)
1508     void executeSavedCommandBySelector(const String& selector, bool& handled);
1509 #endif
1510
1511 #if PLATFORM(GTK)
1512     void getEditorCommandsForKeyEvent(const AtomicString&, Vector<String>&);
1513     void bindAccessibilityTree(const String&);
1514 #endif
1515
1516     // Popup Menu.
1517     void showPopupMenu(const WebCore::IntRect& rect, uint64_t textDirection, const Vector<WebPopupItem>& items, int32_t selectedIndex, const PlatformPopupMenuData&);
1518     void hidePopupMenu();
1519
1520 #if ENABLE(CONTEXT_MENUS)
1521     void showContextMenu(ContextMenuContextData&&, const UserData&);
1522 #endif
1523
1524 #if ENABLE(TELEPHONE_NUMBER_DETECTION)
1525 #if PLATFORM(MAC)
1526     void showTelephoneNumberMenu(const String& telephoneNumber, const WebCore::IntPoint&);
1527 #endif
1528 #endif
1529
1530     // Search popup results
1531     void saveRecentSearches(const String&, const Vector<WebCore::RecentSearch>&);
1532     void loadRecentSearches(const String&, Vector<WebCore::RecentSearch>&);
1533
1534 #if PLATFORM(COCOA)
1535     // Speech.
1536     void getIsSpeaking(bool&);
1537     void speak(const String&);
1538     void stopSpeaking();
1539
1540     // Spotlight.
1541     void searchWithSpotlight(const String&);
1542         
1543     void searchTheWeb(const String&);
1544
1545     // Dictionary.
1546     void didPerformDictionaryLookup(const WebCore::DictionaryPopupInfo&);
1547 #endif
1548
1549 #if PLATFORM(MAC)
1550     bool appleMailPaginationQuirkEnabled();
1551 #endif
1552
1553 #if PLATFORM(MAC)
1554     // FIXME: Need to support iOS too, but there is no isAppleMail for iOS.
1555     bool appleMailLinesClampEnabled();
1556 #endif
1557
1558     // Spelling and grammar.
1559     void checkSpellingOfString(const String& text, int32_t& misspellingLocation, int32_t& misspellingLength);
1560     void checkGrammarOfString(const String& text, Vector<WebCore::GrammarDetail>&, int32_t& badGrammarLocation, int32_t& badGrammarLength);
1561     void spellingUIIsShowing(bool&);
1562     void updateSpellingUIWithMisspelledWord(const String& misspelledWord);
1563     void updateSpellingUIWithGrammarString(const String& badGrammarPhrase, const WebCore::GrammarDetail&);
1564     void learnWord(const String& word);
1565     void ignoreWord(const String& word);
1566     void requestCheckingOfString(uint64_t requestID, const WebCore::TextCheckingRequestData&, int32_t insertionPoint);
1567
1568     void takeFocus(uint32_t direction);
1569     void setToolTip(const String&);
1570     void setCursor(const WebCore::Cursor&);
1571     void setCursorHiddenUntilMouseMoves(bool);
1572
1573     void didReceiveEvent(uint32_t opaqueType, bool handled);
1574
1575     void voidCallback(CallbackID);
1576     void dataCallback(const IPC::DataReference&, CallbackID);
1577     void imageCallback(const ShareableBitmap::Handle&, CallbackID);
1578     void stringCallback(const String&, CallbackID);
1579     void invalidateStringCallback(CallbackID);
1580     void scriptValueCallback(const IPC::DataReference&, bool hadException, const WebCore::ExceptionDetails&, CallbackID);
1581     void computedPagesCallback(const Vector<WebCore::IntRect>&, double totalScaleFactorForPrinting, CallbackID);
1582     void validateCommandCallback(const String&, bool, int, CallbackID);
1583     void unsignedCallback(uint64_t, CallbackID);
1584     void editingRangeCallback(const EditingRange&, CallbackID);
1585 #if ENABLE(APPLICATION_MANIFEST)
1586     void applicationManifestCallback(const std::optional<WebCore::ApplicationManifest>&, CallbackID);
1587 #endif
1588 #if PLATFORM(COCOA)
1589     void machSendRightCallback(const WTF::MachSendRight&, CallbackID);
1590 #endif
1591     void rectForCharacterRangeCallback(const WebCore::IntRect&, const EditingRange&, CallbackID);
1592 #if PLATFORM(MAC)
1593     void attributedStringForCharacterRangeCallback(const AttributedString&, const EditingRange&, CallbackID);
1594     void fontAtSelectionCallback(const String&, double, bool, CallbackID);
1595 #endif
1596 #if PLATFORM(IOS)
1597     void gestureCallback(const WebCore::IntPoint&, uint32_t gestureType, uint32_t gestureState, uint32_t flags, CallbackID);
1598     void touchesCallback(const WebCore::IntPoint&, uint32_t touches, uint32_t flags, CallbackID);
1599     void autocorrectionDataCallback(const Vector<WebCore::FloatRect>&, const String& fontName, float fontSize, uint64_t fontTraits, CallbackID);
1600     void autocorrectionContextCallback(const String& beforeText, const String& markedText, const String& selectedText, const String& afterText, uint64_t location, uint64_t length, CallbackID);
1601     void selectionContextCallback(const String& selectedText, const String& beforeText, const String& afterText, CallbackID);
1602     void interpretKeyEvent(const EditorState&, bool isCharEvent, bool& handled);
1603     void showPlaybackTargetPicker(bool hasVideo, const WebCore::IntRect& elementRect, WebCore::RouteSharingPolicy, const String&);
1604     void selectionRectsCallback(const Vector<WebCore::SelectionRect>&, CallbackID);
1605 #endif
1606 #if PLATFORM(GTK)
1607     void printFinishedCallback(const WebCore::ResourceError&, CallbackID);
1608 #endif
1609
1610     void focusedFrameChanged(uint64_t frameID);
1611     void frameSetLargestFrameChanged(uint64_t frameID);
1612
1613     void didFinishLoadingDataForCustomContentProvider(const String& suggestedFilename, const IPC::DataReference&);
1614
1615 #if PLATFORM(COCOA)
1616     void pluginFocusOrWindowFocusChanged(uint64_t pluginComplexTextInputIdentifier, bool pluginHasFocusAndWindowHasFocus);
1617     void setPluginComplexTextInputState(uint64_t pluginComplexTextInputIdentifier, uint64_t complexTextInputState);
1618 #endif
1619
1620     bool maybeInitializeSandboxExtensionHandle(const WebCore::URL&, SandboxExtension::Handle&);
1621
1622 #if USE(AUTOMATIC_TEXT_REPLACEMENT)
1623     void toggleSmartInsertDelete();
1624     void toggleAutomaticQuoteSubstitution();
1625     void toggleAutomaticLinkDetection();
1626     void toggleAutomaticDashSubstitution();
1627     void toggleAutomaticTextReplacement();
1628 #endif
1629
1630 #if PLATFORM(MAC)
1631     void substitutionsPanelIsShowing(bool&);
1632     void showCorrectionPanel(int32_t panelType, const WebCore::FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, const Vector<String>& alternativeReplacementStrings);
1633     void dismissCorrectionPanel(int32_t reason);
1634     void dismissCorrectionPanelSoon(int32_t reason, String& result);
1635     void recordAutocorrectionResponse(int32_t responseType, const String& replacedString, const String& replacementString);
1636
1637 #if USE(DICTATION_ALTERNATIVES)
1638     void showDictationAlternativeUI(const WebCore::FloatRect& boundingBoxOfDictatedText, uint64_t dictationContext);
1639     void removeDictationAlternatives(uint64_t dictationContext);
1640     void dictationAlternatives(uint64_t dictationContext, Vector<String>& result);
1641 #endif
1642
1643     void setEditableElementIsFocused(bool);
1644 #endif // PLATFORM(MAC)
1645
1646 #if PLATFORM(IOS)
1647     WebCore::FloatSize screenSize();
1648     WebCore::FloatSize availableScreenSize();
1649     WebCore::FloatSize overrideScreenSize();
1650     float textAutosizingWidth();
1651
1652     void dynamicViewportUpdateChangedTarget(double newTargetScale, const WebCore::FloatPoint& newScrollPosition, uint64_t dynamicViewportSizeUpdateID);
1653     void couldNotRestorePageState();
1654     void restorePageState(std::optional<WebCore::FloatPoint> scrollPosition, const WebCore::FloatPoint& scrollOrigin, const WebCore::FloatBoxExtent& obscuredInsetsOnSave, double scale);
1655     void restorePageCenterAndScale(std::optional<WebCore::FloatPoint>, double scale);
1656
1657     void didGetTapHighlightGeometries(uint64_t requestID, const WebCore::Color& color, const Vector<WebCore::FloatQuad>& geometries, const WebCore::IntSize& topLeftRadius, const WebCore::IntSize& topRightRadius, const WebCore::IntSize& bottomLeftRadius, const WebCore::IntSize& bottomRightRadius);
1658
1659     void startAssistingNode(const AssistedNodeInformation&, bool userIsInteracting, bool blurPreviousNode, bool changingActivityState, const UserData&);
1660     void stopAssistingNode();
1661
1662     void showInspectorHighlight(const WebCore::Highlight&);
1663     void hideInspectorHighlight();
1664
1665     void showInspectorIndication();
1666     void hideInspectorIndication();
1667
1668     void enableInspectorNodeSearch();
1669     void disableInspectorNodeSearch();
1670     void assistedNodeInformationCallback(const AssistedNodeInformation&, CallbackID);
1671 #endif // PLATFORM(IOS)
1672
1673 #if ENABLE(DATA_DETECTION)
1674     RetainPtr<NSArray> m_dataDetectionResults;
1675 #endif
1676
1677     void clearLoadDependentCallbacks();
1678
1679     void performDragControllerAction(DragControllerAction, WebCore::DragData&, const String& dragStorageName, SandboxExtension::Handle&&, SandboxExtension::HandleArray&&);
1680
1681     void updateBackingStoreDiscardableState();
1682
1683     void setRenderTreeSize(uint64_t treeSize) { m_renderTreeSize = treeSize; }
1684
1685 #if PLATFORM(X11)
1686     void createPluginContainer(uint64_t& windowID);
1687     void windowedPluginGeometryDidChange(const WebCore::IntRect& frameRect, const WebCore::IntRect& clipRect, uint64_t windowID);
1688     void windowedPluginVisibilityDidChange(bool isVisible, uint64_t windowID);
1689 #endif
1690
1691     void processNextQueuedWheelEvent();
1692     void sendWheelEvent(const WebWheelEvent&);
1693     bool shouldProcessWheelEventNow(const WebWheelEvent&) const;
1694
1695 #if ENABLE(TOUCH_EVENTS)
1696     void updateTouchEventTracking(const WebTouchEvent&);
1697     WebCore::TrackingType touchEventTrackingType(const WebTouchEvent&) const;
1698 #endif
1699
1700 #if ENABLE(NETSCAPE_PLUGIN_API)
1701     void findPlugin(const String& mimeType, uint32_t processType, const String& urlString, const String& frameURLString, const String& pageURLString, bool allowOnlyApplicationPlugins, uint64_t& pluginProcessToken, String& newMIMEType, uint32_t& pluginLoadPolicy, String& unavailabilityDescription, bool& isUnsupported);
1702 #endif
1703
1704 #if USE(QUICK_LOOK)
1705     void didStartLoadForQuickLookDocumentInMainFrame(const String& fileName, const String& uti);
1706     void didFinishLoadForQuickLookDocumentInMainFrame(const QuickLookDocumentData&);
1707     void didRequestPasswordForQuickLookDocumentInMainFrame(const String& fileName);
1708 #endif
1709
1710 #if ENABLE(CONTENT_FILTERING)
1711     void contentFilterDidBlockLoadForFrame(const WebCore::ContentFilterUnblockHandler&, uint64_t frameID);
1712 #endif
1713
1714     API::DiagnosticLoggingClient* effectiveDiagnosticLoggingClient(WebCore::ShouldSample);
1715
1716     void dispatchActivityStateChange();
1717     void viewDidLeaveWindow();
1718     void viewDidEnterWindow();
1719
1720 #if PLATFORM(MAC)
1721     void didPerformImmediateActionHitTest(const WebHitTestResultData&, bool contentPreventsDefault, const UserData&);
1722 #endif
1723
1724     void useFixedLayoutDidChange(bool useFixedLayout) { m_useFixedLayout = useFixedLayout; }
1725     void fixedLayoutSizeDidChange(WebCore::IntSize fixedLayoutSize) { m_fixedLayoutSize = fixedLayoutSize; }
1726
1727     void imageOrMediaDocumentSizeChanged(const WebCore::IntSize&);
1728 #if ENABLE(VIDEO)
1729 #if USE(GSTREAMER)
1730     void requestInstallMissingMediaPlugins(const String& details, const String& description);
1731 #endif
1732 #endif
1733
1734     void startURLSchemeTask(URLSchemeTaskParameters&&);
1735     void stopURLSchemeTask(uint64_t handlerIdentifier, uint64_t taskIdentifier);
1736
1737     void handleAutoFillButtonClick(const UserData&);
1738
1739     void didResignInputElementStrongPasswordAppearance(const UserData&);
1740
1741     void finishInitializingWebPageAfterProcessLaunch();
1742
1743     void handleMessage(IPC::Connection&, const String& messageName, const UserData& messageBody);
1744     void handleSynchronousMessage(IPC::Connection&, const String& messageName, const UserData& messageBody, UserData& returnUserData);
1745
1746     void viewIsBecomingVisible();
1747
1748     void stopAllURLSchemeTasks();
1749
1750 #if ENABLE(ATTACHMENT_ELEMENT)
1751     void didInsertAttachment(const String& identifier, const String& source);
1752     void didRemoveAttachment(const String& identifier);
1753 #endif
1754
1755 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
1756     void startDisplayLink(unsigned observerID);
1757     void stopDisplayLink(unsigned observerID);
1758 #endif
1759
1760     void reportPageLoadResult(const WebCore::ResourceError& = { });
1761
1762     void continueNavigationInNewProcess(API::Navigation&, Ref<WebProcessProxy>&&);
1763
1764     PageClient& m_pageClient;
1765     Ref<API::PageConfiguration> m_configuration;
1766
1767     std::unique_ptr<API::LoaderClient> m_loaderClient;
1768     std::unique_ptr<API::PolicyClient> m_policyClient;
1769     std::unique_ptr<API::NavigationClient> m_navigationClient;
1770     std::unique_ptr<API::HistoryClient> m_historyClient;
1771     std::unique_ptr<API::IconLoadingClient> m_iconLoadingClient;
1772     std::unique_ptr<API::FormClient> m_formClient;
1773     std::unique_ptr<API::UIClient> m_uiClient;
1774     std::unique_ptr<API::FindClient> m_findClient;
1775     std::unique_ptr<API::FindMatchesClient> m_findMatchesClient;
1776     std::unique_ptr<API::DiagnosticLoggingClient> m_diagnosticLoggingClient;
1777 #if ENABLE(CONTEXT_MENUS)
1778     std::unique_ptr<API::ContextMenuClient> m_contextMenuClient;
1779 #endif
1780     std::unique_ptr<WebPageInjectedBundleClient> m_injectedBundleClient;
1781
1782     std::unique_ptr<WebNavigationState> m_navigationState;
1783     String m_failingProvisionalLoadURL;
1784     bool m_isLoadingAlternateHTMLStringForFailingProvisionalLoad { false };
1785
1786     std::unique_ptr<DrawingAreaProxy> m_drawingArea;
1787 #if ENABLE(ASYNC_SCROLLING) && PLATFORM(COCOA)
1788     std::unique_ptr<RemoteScrollingCoordinatorProxy> m_scrollingCoordinatorProxy;
1789 #endif
1790
1791     Ref<WebProcessProxy> m_process;
1792     Ref<WebPageGroup> m_pageGroup;
1793     Ref<WebPreferences> m_preferences;
1794
1795     WebProcessLifetimeTracker m_webProcessLifetimeTracker { *this };
1796
1797     Ref<WebUserContentControllerProxy> m_userContentController;
1798     Ref<VisitedLinkStore> m_visitedLinkStore;
1799     Ref<WebsiteDataStore> m_websiteDataStore;
1800
1801     RefPtr<WebFrameProxy> m_mainFrame;
1802     std::optional<uint64_t> m_mainFrameID;
1803     Function<void()> m_mainFrameCreationHandler;
1804     Function<void(const WebCore::GlobalWindowIdentifier&)> m_mainFrameWindowCreationHandler;
1805
1806     RefPtr<WebFrameProxy> m_focusedFrame;
1807     RefPtr<WebFrameProxy> m_frameSetLargestFrame;
1808
1809     String m_userAgent;
1810     String m_applicationNameForUserAgent;
1811     String m_customUserAgent;
1812     String m_customTextEncodingName;
1813     String m_overrideContentSecurityPolicy;
1814
1815     bool m_treatsSHA1CertificatesAsInsecure { true };
1816
1817     RefPtr<WebInspectorProxy> m_inspector;
1818
1819 #if ENABLE(FULLSCREEN_API)
1820     RefPtr<WebFullScreenManagerProxy> m_fullScreenManager;
1821     std::unique_ptr<API::FullscreenClient> m_fullscreenClient;
1822 #endif
1823
1824 #if (PLATFORM(IOS) && HAVE(AVKIT)) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
1825     RefPtr<PlaybackSessionManagerProxy> m_playbackSessionManager;
1826     RefPtr<VideoFullscreenManagerProxy> m_videoFullscreenManager;
1827 #endif
1828
1829 #if PLATFORM(IOS)
1830     VisibleContentRectUpdateInfo m_lastVisibleContentRectUpdate;
1831     uint64_t m_firstLayerTreeTransactionIdAfterDidCommitLoad { 0 };
1832     int32_t m_deviceOrientation { 0 };
1833     uint64_t m_dynamicViewportSizeUpdateLayerTreeTransactionID { 0 };
1834     uint64_t m_currentDynamicViewportSizeUpdateID { 0 };
1835     bool m_hasReceivedLayerTreeTransactionAfterDidCommitLoad { true };
1836     bool m_dynamicViewportSizeUpdateWaitingForTarget { false };
1837     bool m_dynamicViewportSizeUpdateWaitingForLayerTreeCommit { false };
1838     bool m_hasNetworkRequestsOnSuspended { false };
1839     bool m_isKeyboardAnimatingIn { false };
1840     bool m_isScrollingOrZooming { false };
1841 #endif
1842         
1843 #if PLATFORM(MAC)
1844     bool m_useSystemAppearance { false };
1845     bool m_defaultAppearance { true };
1846 #endif
1847
1848 #if ENABLE(APPLE_PAY)
1849     std::unique_ptr<WebPaymentCoordinatorProxy> m_paymentCoordinator;
1850 #endif
1851
1852     std::unique_ptr<SystemPreviewController> m_systemPreviewController;
1853
1854 #if ENABLE(WEB_AUTHN)
1855     std::unique_ptr<WebCredentialsMessengerProxy> m_credentialsMessenger;
1856 #endif
1857
1858     CallbackMap m_callbacks;
1859     HashSet<CallbackID> m_loadDependentStringCallbackIDs;
1860
1861     HashSet<WebEditCommandProxy*> m_editCommandSet;
1862
1863 #if PLATFORM(COCOA)
1864     HashSet<String> m_knownKeypressCommandNames;
1865 #endif
1866
1867     RefPtr<WebPopupMenuProxy> m_activePopupMenu;
1868 #if ENABLE(CONTEXT_MENUS)
1869     RefPtr<WebContextMenuProxy> m_activeContextMenu;
1870     ContextMenuContextData m_activeContextMenuContextData;
1871 #endif
1872     RefPtr<API::HitTestResult> m_lastMouseMoveHitTestResult;
1873
1874     RefPtr<WebOpenPanelResultListenerProxy> m_openPanelResultListener;
1875     GeolocationPermissionRequestManagerProxy m_geolocationPermissionRequestManager;
1876     NotificationPermissionRequestManagerProxy m_notificationPermissionRequestManager;
1877
1878 #if ENABLE(MEDIA_STREAM)
1879     std::unique_ptr<UserMediaPermissionRequestManagerProxy> m_userMediaPermissionRequestManager;
1880 #endif
1881
1882     WebCore::ActivityState::Flags m_activityState { WebCore::ActivityState::NoFlags };
1883     bool m_viewWasEverInWindow { false };
1884 #if PLATFORM(IOS)
1885     bool m_allowsMediaDocumentInlinePlayback { false };
1886     bool m_alwaysRunsAtForegroundPriority { false };
1887     ProcessThrottler::ForegroundActivityToken m_activityToken;
1888 #endif
1889     bool m_initialCapitalizationEnabled { false };
1890     std::optional<double> m_cpuLimit;
1891     Ref<WebBackForwardList> m_backForwardList;
1892         
1893     bool m_maintainsInactiveSelection { false };
1894
1895     bool m_waitsForPaintAfterViewDidMoveToWindow { false };
1896     bool m_shouldSkipWaitingForPaintAfterNextViewDidMoveToWindow { false };
1897
1898     String m_toolTip;
1899
1900     EditorState m_editorState;
1901     bool m_isEditable { false };
1902
1903 #if PLATFORM(COCOA)
1904     TouchBarMenuData m_touchBarMenuData;
1905 #endif
1906
1907     double m_textZoomFactor { 1 };
1908     double m_pageZoomFactor { 1 };
1909     double m_pageScaleFactor { 1 };
1910     double m_pluginZoomFactor { 1 };
1911     double m_pluginScaleFactor { 1 };
1912     double m_viewScaleFactor { 1 };
1913     float m_intrinsicDeviceScaleFactor { 1 };
1914     std::optional<float> m_customDeviceScaleFactor;
1915     float m_topContentInset { 0 };
1916
1917     LayerHostingMode m_layerHostingMode { LayerHostingMode::InProcess };
1918
1919     bool m_drawsBackground { true };
1920
1921     WebCore::Color m_underlayColor;
1922     WebCore::Color m_pageExtendedBackgroundColor;
1923
1924     bool m_useFixedLayout { false };
1925     WebCore::IntSize m_fixedLayoutSize;
1926
1927     bool m_alwaysShowsHorizontalScroller { false };
1928     bool m_alwaysShowsVerticalScroller { false };
1929
1930     WebCore::LayoutMilestones m_observedLayoutMilestones { 0 };
1931
1932     bool m_suppressScrollbarAnimations { false };
1933
1934     WebCore::Pagination::Mode m_paginationMode { WebCore::Pagination::Unpaginated };
1935     bool m_paginationBehavesLikeColumns { false };
1936     double m_pageLength { 0 };
1937     double m_gapBetweenPages { 0 };
1938     bool m_paginationLineGridEnabled { false };
1939         
1940     // If the process backing the web page is alive and kicking.
1941     bool m_isValid { true };
1942
1943     // Whether WebPageProxy::close() has been called on this page.
1944     bool m_isClosed { false };
1945
1946     // Whether it can run modal child web pages.
1947     bool m_canRunModal { false };
1948
1949     bool m_needsToFinishInitializingWebPageAfterProcessLaunch { false };
1950
1951     bool m_isInPrintingMode { false };
1952     bool m_isPerformingDOMPrintOperation { false };
1953
1954     // Synchronous navigation policy decision.
1955     RefPtr<Messages::WebPageProxy::DecidePolicyForNavigationActionSync::DelayedReply> m_syncNavigationActionPolicyReply;
1956
1957     WebCore::ResourceRequest m_decidePolicyForResponseRequest;
1958     bool m_shouldSuppressAppLinksInNextNavigationPolicyDecision { false };
1959
1960     Deque<NativeWebMouseEvent> m_mouseEventQueue;
1961     Deque<NativeWebKeyboardEvent> m_keyEventQueue;
1962     Deque<NativeWebWheelEvent> m_wheelEventQueue;
1963     Deque<std::unique_ptr<Vector<NativeWebWheelEvent>>> m_currentlyProcessedWheelEvents;
1964 #if ENABLE(MAC_GESTURE_EVENTS)
1965     Deque<NativeWebGestureEvent> m_gestureEventQueue;
1966 #endif
1967
1968 #if ENABLE(TOUCH_EVENTS)
1969     struct TouchEventTracking {
1970         WebCore::TrackingType touchForceChangedTracking { WebCore::TrackingType::NotTracking };
1971         WebCore::TrackingType touchStartTracking { WebCore::TrackingType::NotTracking };
1972         WebCore::TrackingType touchMoveTracking { WebCore::TrackingType::NotTracking };
1973         WebCore::TrackingType touchEndTracking { WebCore::TrackingType::NotTracking };
1974
1975         bool isTrackingAnything() const
1976         {
1977             return touchForceChangedTracking != WebCore::TrackingType::NotTracking
1978                 || touchStartTracking != WebCore::TrackingType::NotTracking
1979                 || touchMoveTracking != WebCore::TrackingType::NotTracking
1980                 || touchEndTracking != WebCore::TrackingType::NotTracking;
1981         }
1982
1983         void reset()
1984         {
1985             touchForceChangedTracking = WebCore::TrackingType::NotTracking;
1986             touchStartTracking = WebCore::TrackingType::NotTracking;
1987             touchMoveTracking = WebCore::TrackingType::NotTracking;
1988             touchEndTracking = WebCore::TrackingType::NotTracking;
1989         }
1990     };
1991     TouchEventTracking m_touchEventTracking;
1992 #endif
1993 #if ENABLE(TOUCH_EVENTS) && !ENABLE(IOS_TOUCH_EVENTS)
1994     Deque<QueuedTouchEvents> m_touchEventQueue;
1995 #endif
1996
1997 #if ENABLE(INPUT_TYPE_COLOR)
1998     RefPtr<WebColorPicker> m_colorPicker;
1999 #endif
2000 #if PLATFORM(COCOA)
2001     RefPtr<WebCore::ValidationBubble> m_validationBubble;
2002 #endif
2003
2004     const uint64_t m_pageID;
2005
2006     bool m_isPageSuspended { false };
2007     bool m_addsVisitedLinks { true };
2008
2009     bool m_controlledByAutomation { false };
2010
2011 #if ENABLE(REMOTE_INSPECTOR)
2012     bool m_allowsRemoteInspection { true };
2013     String m_remoteInspectionNameOverride;
2014 #endif
2015     unsigned m_inspectorFrontendCount { 0 };
2016
2017 #if PLATFORM(COCOA)
2018     bool m_isSmartInsertDeleteEnabled { false };
2019 #endif
2020
2021 #if PLATFORM(GTK)
2022     String m_accessibilityPlugID;
2023     WebCore::Color m_backgroundColor { WebCore::Color::white };
2024 #endif
2025
2026     int64_t m_spellDocumentTag { 0 }; // FIXME: use std::optional<>.
2027     bool m_hasSpellDocumentTag { false }; 
2028     unsigned m_pendingLearnOrIgnoreWordMessageCount { 0 };
2029
2030     bool m_mainFrameHasCustomContentProvider { false };
2031
2032 #if ENABLE(DRAG_SUPPORT)
2033     // Current drag destination details are delivered as an asynchronous response,
2034     // so we preserve them to be used when the next dragging delegate call is made.
2035     WebCore::DragOperation m_currentDragOperation { WebCore::DragOperationNone };
2036     bool m_currentDragIsOverFileInput { false };
2037     unsigned m_currentDragNumberOfFilesToBeAccepted { 0 };
2038     WebCore::IntRect m_currentDragCaretRect;
2039 #endif
2040
2041     PageLoadState m_pageLoadState;
2042     
2043     bool m_delegatesScrolling { false };
2044
2045     bool m_mainFrameHasHorizontalScrollbar { false };
2046     bool m_mainFrameHasVerticalScrollbar { false };
2047
2048     // Whether horizontal wheel events can be handled directly for swiping purposes.
2049     bool m_canShortCircuitHorizontalWheelEvents { true };
2050
2051     bool m_mainFrameIsPinnedToLeftSide { true };
2052     bool m_mainFrameIsPinnedToRightSide { true };
2053     bool m_mainFrameIsPinnedToTopSide { true };
2054     bool m_mainFrameIsPinnedToBottomSide { true };
2055
2056     bool m_shouldUseImplicitRubberBandControl { false };
2057     bool m_rubberBandsAtLeft { true };
2058     bool m_rubberBandsAtRight { true };
2059     bool m_rubberBandsAtTop { true };
2060     bool m_rubberBandsAtBottom { true };
2061         
2062     bool m_enableVerticalRubberBanding { true };
2063     bool m_enableHorizontalRubberBanding { true };
2064
2065     bool m_backgroundExtendsBeyondPage { false };
2066
2067     bool m_shouldRecordNavigationSnapshots { false };
2068     bool m_isShowingNavigationGestureSnapshot { false };
2069
2070     bool m_mainFramePluginHandlesPageScaleGesture { false };
2071
2072     unsigned m_pageCount { 0 };
2073
2074     WebCore::IntRect m_visibleScrollerThumbRect;
2075
2076     uint64_t m_renderTreeSize { 0 };
2077     uint64_t m_sessionRestorationRenderTreeSize { 0 };
2078     bool m_hitRenderTreeSizeThreshold { false };
2079
2080     bool m_suppressVisibilityUpdates { false };
2081     bool m_autoSizingShouldExpandToViewHeight { false };
2082     WebCore::IntSize m_viewLayoutSize;
2083     std::optional<WebCore::IntSize> m_viewportSizeForCSSViewportUnits;
2084
2085     // Visual viewports
2086     WebCore::LayoutSize m_baseLayoutViewportSize;
2087     WebCore::LayoutPoint m_minStableLayoutViewportOrigin;
2088     WebCore::LayoutPoint m_maxStableLayoutViewportOrigin;
2089
2090     float m_mediaVolume { 1 };
2091     WebCore::MediaProducer::MutedStateFlags m_mutedState { WebCore::MediaProducer::NoneMuted };
2092     bool m_mayStartMediaWhenInWindow { true };
2093     bool m_mediaCaptureEnabled { true };
2094
2095     bool m_waitingForDidUpdateActivityState { false };
2096
2097     bool m_shouldScaleViewToFitDocument { false };
2098     bool m_suppressAutomaticNavigationSnapshotting { false };
2099
2100 #if PLATFORM(COCOA)
2101     HashMap<String, String> m_temporaryPDFFiles;
2102     std::unique_ptr<WebCore::RunLoopObserver> m_activityStateChangeDispatcher;
2103
2104     std::unique_ptr<RemoteLayerTreeScrollingPerformanceData> m_scrollingPerformanceData;
2105     bool m_scrollPerformanceDataCollectionEnabled { false };
2106 #endif
2107     UserObservablePageCounter::Token m_pageIsUserObservableCount;
2108     ProcessSuppressionDisabledToken m_preventProcessSuppressionCount;
2109     HiddenPageThrottlingAutoIncreasesCounter::Token m_hiddenPageDOMTimerThrottlingAutoIncreasesCount;
2110     VisibleWebPageToken m_visiblePageToken;
2111         
2112     WebCore::ScrollPinningBehavior m_scrollPinningBehavior { WebCore::DoNotPin };
2113     std::optional<WebCore::ScrollbarOverlayStyle> m_scrollbarOverlayStyle;
2114
2115     uint64_t m_navigationID { 0 };
2116
2117     WebPreferencesStore::ValueMap m_configurationPreferenceValues;
2118     WebCore::ActivityState::Flags m_potentiallyChangedActivityStateFlags { WebCore::ActivityState::NoFlags };
2119     bool m_activityStateChangeWantsSynchronousReply { false };
2120     Vector<CallbackID> m_nextActivityStateChangeCallbacks;
2121
2122     WebCore::MediaProducer::MediaStateFlags m_mediaState { WebCore::MediaProducer::IsNotPlaying };
2123
2124     bool m_isResourceCachingDisabled { false };
2125
2126     bool m_hasHadSelectionChangesFromUserInteraction { false };
2127     bool m_needsHiddenContentEditableQuirk { false };
2128     bool m_needsPlainTextQuirk { false };
2129
2130 #if ENABLE(MEDIA_SESSION)
2131     bool m_hasMediaSessionWithActiveMediaElements { false };
2132 #endif
2133
2134 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
2135     bool m_requiresTargetMonitoring { false };
2136 #endif
2137
2138 #if PLATFORM(IOS)
2139     std::unique_ptr<NodeAssistanceArguments> m_deferredNodeAssistanceArguments;
2140     bool m_forceAlwaysUserScalable { false };
2141     WebCore::FloatSize m_viewportConfigurationViewLayoutSize;
2142     WebCore::FloatSize m_maximumUnobscuredSize;
2143 #endif
2144
2145 #if ENABLE(POINTER_LOCK)
2146     bool m_isPointerLockPending { false };
2147     bool m_isPointerLocked { false };
2148 #endif
2149
2150     bool m_isUsingHighPerformanceWebGL { false };
2151
2152     WeakPtrFactory<WebPageProxy> m_weakPtrFactory;
2153
2154     HashMap<String, Ref<WebURLSchemeHandler>> m_urlSchemeHandlersByScheme;
2155     HashMap<uint64_t, Ref<WebURLSchemeHandler>> m_urlSchemeHandlersByIdentifier;
2156         
2157 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
2158     std::unique_ptr<DisplayLink> m_displayLink;
2159 #endif
2160
2161     std::optional<MonotonicTime> m_pageLoadStart;
2162
2163     // FIXME: Support more than one suspended page per WebPageProxy,
2164     // and have a global collection of them per process pool
2165     // (e.g. for that process pool's page cache)
2166     RefPtr<SuspendedPageProxy> m_suspendedPage;
2167 };
2168
2169 } // namespace WebKit