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