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