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