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