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