Check for navigation to app-bound domain during script evaluation
[WebKit-https.git] / Source / WebKit / UIProcess / WebPageProxy.h
1 /*
2  * Copyright (C) 2010-2019 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 "Connection.h"
30 #include "ContentAsStringIncludesChildFrames.h"
31 #include "ContextMenuContextData.h"
32 #include "DownloadID.h"
33 #include "DragControllerAction.h"
34 #include "EditingRange.h"
35 #include "EditorState.h"
36 #include "FocusedElementInformation.h"
37 #include "GeolocationPermissionRequestManagerProxy.h"
38 #include "HiddenPageThrottlingAutoIncreasesCounter.h"
39 #include "LayerTreeContext.h"
40 #include "MessageSender.h"
41 #include "NotificationPermissionRequestManagerProxy.h"
42 #include "PageLoadState.h"
43 #include "PolicyDecision.h"
44 #include "ProcessTerminationReason.h"
45 #include "ProcessThrottler.h"
46 #include "SandboxExtension.h"
47 #include "ShareSheetCallbackID.h"
48 #include "ShareableBitmap.h"
49 #include "ShareableResource.h"
50 #include "SuspendedPageProxy.h"
51 #include "SyntheticEditingCommandType.h"
52 #include "SystemPreviewController.h"
53 #include "TransactionID.h"
54 #include "UserMediaPermissionRequestManagerProxy.h"
55 #include "VisibleContentRectUpdateInfo.h"
56 #include "VisibleWebPageCounter.h"
57 #include "WKBase.h"
58 #include "WKPagePrivate.h"
59 #include "WebColorPicker.h"
60 #include "WebContextMenuItemData.h"
61 #include "WebCoreArgumentCoders.h"
62 #include "WebDataListSuggestionsDropdown.h"
63 #include "WebFrameProxy.h"
64 #include "WebPageCreationParameters.h"
65 #include "WebPageDiagnosticLoggingClient.h"
66 #include "WebPageInjectedBundleClient.h"
67 #include "WebPageProxyIdentifier.h"
68 #include "WebPageProxyMessagesReplies.h"
69 #include "WebPaymentCoordinatorProxy.h"
70 #include "WebPreferences.h"
71 #include "WebPopupMenuProxy.h"
72 #include "WebUndoStepID.h"
73 #include "WebsitePoliciesData.h"
74 #include <WebCore/ActivityState.h>
75 #include <WebCore/AutoplayEvent.h>
76 #include <WebCore/Color.h>
77 #include <WebCore/DiagnosticLoggingClient.h>
78 #include <WebCore/DragActions.h>
79 #include <WebCore/EventTrackingRegions.h>
80 #include <WebCore/ExceptionDetails.h>
81 #include <WebCore/FontAttributes.h>
82 #include <WebCore/FrameLoaderTypes.h>
83 #include <WebCore/FrameView.h> // FIXME: Move LayoutViewportConstraint to its own file and stop including this.
84 #include <WebCore/GlobalFrameIdentifier.h>
85 #include <WebCore/InputMode.h>
86 #include <WebCore/LayoutPoint.h>
87 #include <WebCore/LayoutSize.h>
88 #include <WebCore/MediaPlaybackTargetContext.h>
89 #include <WebCore/MediaProducer.h>
90 #include <WebCore/PageIdentifier.h>
91 #include <WebCore/PlatformEvent.h>
92 #include <WebCore/PlatformScreen.h>
93 #include <WebCore/PlatformSpeechSynthesisUtterance.h>
94 #include <WebCore/PlatformSpeechSynthesizer.h>
95 #include <WebCore/PointerID.h>
96 #include <WebCore/RegistrableDomain.h>
97 #include <WebCore/RunJavaScriptParameters.h>
98 #include <WebCore/ScrollTypes.h>
99 #include <WebCore/SearchPopupMenu.h>
100 #include <WebCore/TextChecking.h>
101 #include <WebCore/TextGranularity.h>
102 #include <WebCore/TextManipulationController.h>
103 #include <WebCore/UserInterfaceLayoutDirection.h>
104 #include <WebCore/ViewportArguments.h>
105 #include <memory>
106 #include <wtf/CompletionHandler.h>
107 #include <wtf/HashMap.h>
108 #include <wtf/HashSet.h>
109 #include <wtf/Logger.h>
110 #include <wtf/MonotonicTime.h>
111 #include <wtf/Optional.h>
112 #include <wtf/ProcessID.h>
113 #include <wtf/Ref.h>
114 #include <wtf/RefPtr.h>
115 #include <wtf/RunLoop.h>
116 #include <wtf/URL.h>
117 #include <wtf/UniqueRef.h>
118 #include <wtf/Vector.h>
119 #include <wtf/text/WTFString.h>
120
121 #if PLATFORM(IOS_FAMILY)
122 #include "GestureTypes.h"
123 #include "WebAutocorrectionContext.h"
124 #endif
125
126 OBJC_CLASS NSView;
127 OBJC_CLASS _WKRemoteObjectRegistry;
128
129 #if ENABLE(DRAG_SUPPORT)
130 #include <WebCore/DragActions.h>
131 #endif
132
133 #if ENABLE(TOUCH_EVENTS)
134 #include "NativeWebTouchEvent.h"
135 #endif
136
137 #if PLATFORM(COCOA)
138 #include "DynamicViewportSizeUpdate.h"
139 #include "RemoteLayerTreeNode.h"
140 #endif
141
142 #if HAVE(TOUCH_BAR)
143 #include "TouchBarMenuData.h"
144 #include "TouchBarMenuItemData.h"
145 #endif
146
147 #if PLATFORM(GTK)
148 #include "ArgumentCodersGtk.h"
149 #endif
150
151 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS_FAMILY)
152 #include <WebCore/MediaPlaybackTargetPicker.h>
153 #include <WebCore/WebMediaSessionManagerClient.h>
154 #endif
155
156 #if HAVE(APP_SSO)
157 #include "SOAuthorizationLoadPolicy.h"
158 #endif
159
160 #if ENABLE(MEDIA_SESSION)
161 namespace WebCore {
162 class MediaSessionMetadata;
163 }
164 #endif
165
166 #if USE(DIRECT2D)
167 interface ID3D11Device1;
168 #endif
169
170 namespace API {
171 class Attachment;
172 class ContentWorld;
173 class ContextMenuClient;
174 class FindClient;
175 class FindMatchesClient;
176 class FormClient;
177 class FullscreenClient;
178 class HistoryClient;
179 class IconLoadingClient;
180 class InspectorClient;
181 class LoaderClient;
182 class Navigation;
183 class NavigationClient;
184 class PolicyClient;
185 class ResourceLoadClient;
186 class UIClient;
187 class URLRequest;
188 }
189
190 namespace Inspector {
191 enum class InspectorTargetType : uint8_t;
192 }
193
194 namespace IPC {
195 class Decoder;
196 class FormDataReference;
197 class SharedBufferDataReference;
198 }
199
200 namespace WebCore {
201 class AuthenticationChallenge;
202 class CertificateInfo;
203 class Cursor;
204 class DragData;
205 class FloatRect;
206 class FontAttributeChanges;
207 class FontChanges;
208 class GraphicsLayer;
209 class IntSize;
210 class ProtectionSpace;
211 class RunLoopObserver;
212 class SharedBuffer;
213 class TextIndicator;
214 class ValidationBubble;
215
216 enum SelectionDirection : uint8_t;
217
218 enum class AutoplayEvent : uint8_t;
219 enum class DOMPasteAccessResponse : uint8_t;
220 enum class LockBackForwardList : bool;
221 enum class HasInsecureContent : bool;
222 enum class NotificationDirection : uint8_t;
223 enum class RouteSharingPolicy : uint8_t;
224 enum class ShouldSample : bool;
225 enum class ShouldTreatAsContinuingLoad : bool;
226 enum class WritingDirection : uint8_t;
227
228 struct ApplicationManifest;
229 struct BackForwardItemIdentifier;
230 struct CompositionHighlight;
231 struct ContentRuleListResults;
232 struct DataListSuggestionInformation;
233 struct DictionaryPopupInfo;
234 struct DragItem;
235 struct ExceptionDetails;
236 struct FileChooserSettings;
237 struct GlobalWindowIdentifier;
238 struct LinkIcon;
239 struct MediaStreamRequest;
240 struct MockWebAuthenticationConfiguration;
241 struct PrewarmInformation;
242 struct SecurityOriginData;
243 struct ShareData;
244 struct TextAlternativeWithRange;
245 struct TextCheckingResult;
246 struct ViewportAttributes;
247 struct WindowFeatures;
248
249 template <typename> class RectEdges;
250 using FloatBoxExtent = RectEdges<float>;
251 }
252
253 #if PLATFORM(GTK)
254 typedef GtkWidget* PlatformViewWidget;
255 #endif
256
257 #if USE(LIBWPE)
258 struct wpe_view_backend;
259 #endif
260
261 #if PLATFORM(GTK) || PLATFORM(WPE)
262 typedef struct OpaqueJSContext* JSGlobalContextRef;
263 #endif
264
265 #if PLATFORM(WIN)
266 typedef HWND PlatformViewWidget;
267 #endif
268
269 namespace WebCore {
270 struct ElementContext;
271 }
272
273 namespace WebKit {
274 class DrawingAreaProxy;
275 class EditableImageController;
276 class GamepadData;
277 class NativeWebGestureEvent;
278 class NativeWebKeyboardEvent;
279 class NativeWebMouseEvent;
280 class NativeWebWheelEvent;
281 class PageClient;
282 class ProvisionalPageProxy;
283 class RemoteLayerTreeHost;
284 class RemoteLayerTreeScrollingPerformanceData;
285 class RemoteLayerTreeTransaction;
286 class RemoteScrollingCoordinatorProxy;
287 class SecKeyProxyStore;
288 class SharedBufferDataReference;
289 class UserData;
290 class ViewSnapshot;
291 class VisitedLinkStore;
292 class WebBackForwardList;
293 class WebBackForwardListItem;
294 class WebContextMenuProxy;
295 class WebEditCommandProxy;
296 class WebFullScreenManagerProxy;
297 class PlaybackSessionManagerProxy;
298 class WebNavigationState;
299 class VideoFullscreenManagerProxy;
300 class WebAuthenticatorCoordinatorProxy;
301 class WebBackForwardCache;
302 class WebKeyboardEvent;
303 class WebURLSchemeHandler;
304 class WebMouseEvent;
305 class WebOpenPanelResultListenerProxy;
306 class WebPageDebuggable;
307 class WebPageGroup;
308 class WebPageInspectorController;
309 class WebProcessProxy;
310 class WebUserContentControllerProxy;
311 class WebWheelEvent;
312 class WebsiteDataStore;
313 class WebDeviceOrientationUpdateProviderProxy;
314 class WebViewDidMoveToWindowObserver;
315
316 struct AttributedString;
317 struct WebBackForwardListCounts;
318 struct ColorSpaceData;
319 struct DataDetectionResult;
320 struct DocumentEditingContext;
321 struct DocumentEditingContextRequest;
322 struct EditingRange;
323 struct EditorState;
324 struct FocusedElementInformation;
325 struct FontInfo;
326 struct FrameInfoData;
327 struct InputMethodState;
328 struct InsertTextOptions;
329 struct InteractionInformationAtPosition;
330 struct InteractionInformationRequest;
331 struct LoadParameters;
332 struct NavigationActionData;
333 struct PlatformPopupMenuData;
334 struct PrintInfo;
335 struct PDFContextMenu;
336 struct ResourceLoadInfo;
337 struct WebAutocorrectionData;
338 struct WebHitTestResultData;
339 struct WebNavigationDataStore;
340 struct WebPopupItem;
341 struct WebSelectionData;
342 struct WebSpeechSynthesisVoice;
343 struct URLSchemeTaskParameters;
344 struct UserMessage;
345
346 enum class NegotiatedLegacyTLS : bool;
347 enum class ProcessSwapRequestedByClient;
348 enum class UndoOrRedo : bool;
349 enum class WebContentMode : uint8_t;
350
351 typedef GenericCallback<API::Data*> DataCallback;
352 typedef GenericCallback<uint64_t> UnsignedCallback;
353 typedef GenericCallback<EditingRange> EditingRangeCallback;
354 typedef GenericCallback<const String&> StringCallback;
355 typedef GenericCallback<API::SerializedScriptValue*, Optional<WebCore::ExceptionDetails>> ScriptValueCallback;
356 typedef GenericCallback<const WebCore::FontAttributes&> FontAttributesCallback;
357 typedef GenericCallback<const String&, const String&, const String&> SelectionContextCallback;
358 typedef GenericCallback<bool> BoolCallback;
359
360 #if HAVE(VISIBILITY_PROPAGATION_VIEW)
361 using LayerHostingContextID = uint32_t;
362 #endif
363
364 #if PLATFORM(GTK)
365 typedef GenericCallback<API::Error*> PrintFinishedCallback;
366 #endif
367
368 #if ENABLE(TOUCH_EVENTS)
369 struct QueuedTouchEvents {
370     QueuedTouchEvents(const NativeWebTouchEvent& event)
371         : forwardedEvent(event)
372     {
373     }
374     NativeWebTouchEvent forwardedEvent;
375     Vector<NativeWebTouchEvent> deferredTouchEvents;
376 };
377 #endif
378
379 typedef GenericCallback<const String&, bool, int32_t> ValidateCommandCallback;
380 typedef GenericCallback<const WebCore::IntRect&, const EditingRange&> RectForCharacterRangeCallback;
381
382 #if ENABLE(APPLICATION_MANIFEST)
383 typedef GenericCallback<const Optional<WebCore::ApplicationManifest>&> ApplicationManifestCallback;
384 #endif
385
386 #if PLATFORM(MAC)
387 typedef GenericCallback<const AttributedString&, const EditingRange&> AttributedStringForCharacterRangeCallback;
388 typedef GenericCallback<const FontInfo&, double, bool> FontAtSelectionCallback;
389 #endif
390
391 #if PLATFORM(IOS_FAMILY)
392 typedef GenericCallback<const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t> GestureCallback;
393 typedef GenericCallback<const WebCore::IntPoint&, uint32_t, uint32_t> TouchesCallback;
394 typedef GenericCallback<const Vector<WebCore::SelectionRect>&> SelectionRectsCallback;
395 typedef GenericCallback<const FocusedElementInformation&> FocusedElementInformationCallback;
396 struct ElementDidFocusArguments {
397     WTF_MAKE_STRUCT_FAST_ALLOCATED;
398     FocusedElementInformation information;
399     bool userIsInteracting;
400     bool blurPreviousNode;
401     OptionSet<WebCore::ActivityState::Flag> activityStateChanges;
402     RefPtr<API::Object> userData;
403 };
404 #endif
405
406 #if PLATFORM(COCOA)
407 using DrawToPDFCallback = GenericCallback<const IPC::DataReference&>;
408 typedef GenericCallback<bool, bool, String, double, double, uint64_t> NowPlayingInfoCallback;
409 #endif
410
411 using SpellDocumentTag = int64_t;
412
413 class WebPageProxy : public API::ObjectImpl<API::Object::Type::Page>
414 #if ENABLE(INPUT_TYPE_COLOR)
415     , public WebColorPicker::Client
416 #endif
417 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS_FAMILY)
418     , public WebCore::WebMediaSessionManagerClient
419 #endif
420 #if ENABLE(APPLE_PAY)
421     , public WebPaymentCoordinatorProxy::Client
422 #endif
423     , public WebPopupMenuProxy::Client
424     , public IPC::MessageReceiver
425     , public IPC::MessageSender
426 #if ENABLE(SPEECH_SYNTHESIS)
427     , public WebCore::PlatformSpeechSynthesisUtteranceClient
428     , public WebCore::PlatformSpeechSynthesizerClient
429 #endif
430     , public CanMakeWeakPtr<WebPageProxy> {
431 public:
432     static Ref<WebPageProxy> create(PageClient&, WebProcessProxy&, Ref<API::PageConfiguration>&&);
433     virtual ~WebPageProxy();
434
435     static void forMostVisibleWebPageIfAny(PAL::SessionID, const WebCore::SecurityOriginData&, CompletionHandler<void(WebPageProxy*)>&&);
436
437     const API::PageConfiguration& configuration() const;
438
439     using Identifier = WebPageProxyIdentifier;
440
441     Identifier identifier() const { return m_identifier; }
442     WebCore::PageIdentifier webPageID() const { return m_webPageID; }
443
444     PAL::SessionID sessionID() const;
445
446     WebFrameProxy* mainFrame() const { return m_mainFrame.get(); }
447     WebFrameProxy* focusedFrame() const { return m_focusedFrame.get(); }
448     WebFrameProxy* frameSetLargestFrame() const { return m_frameSetLargestFrame.get(); }
449
450     DrawingAreaProxy* drawingArea() const { return m_drawingArea.get(); }
451     DrawingAreaProxy* provisionalDrawingArea() const;
452
453     WebNavigationState& navigationState() { return *m_navigationState.get(); }
454
455     WebsiteDataStore& websiteDataStore() { return m_websiteDataStore; }
456
457     void addPreviouslyVisitedPath(const String&);
458
459 #if ENABLE(DATA_DETECTION)
460     NSArray *dataDetectionResults() { return m_dataDetectionResults.get(); }
461     void detectDataInAllFrames(WebCore::DataDetectorTypes, CompletionHandler<void(const DataDetectionResult&)>&&);
462     void removeDataDetectedLinks(CompletionHandler<void(const DataDetectionResult&)>&&);
463 #endif
464         
465 #if ENABLE(ASYNC_SCROLLING) && PLATFORM(COCOA)
466     RemoteScrollingCoordinatorProxy* scrollingCoordinatorProxy() const { return m_scrollingCoordinatorProxy.get(); }
467 #endif
468
469     WebBackForwardList& backForwardList() { return m_backForwardList; }
470
471     bool addsVisitedLinks() const { return m_addsVisitedLinks; }
472     void setAddsVisitedLinks(bool addsVisitedLinks) { m_addsVisitedLinks = addsVisitedLinks; }
473     VisitedLinkStore& visitedLinkStore() { return m_visitedLinkStore; }
474
475     void exitFullscreenImmediately();
476     void fullscreenMayReturnToInline();
477     void didEnterFullscreen();
478     void didExitFullscreen();
479
480     WebInspectorProxy* inspector() const;
481     GeolocationPermissionRequestManagerProxy& geolocationPermissionRequestManager() { return m_geolocationPermissionRequestManager; }
482
483     void resourceLoadDidSendRequest(ResourceLoadInfo&&, WebCore::ResourceRequest&&);
484     void resourceLoadDidPerformHTTPRedirection(ResourceLoadInfo&&, WebCore::ResourceResponse&&, WebCore::ResourceRequest&&);
485     void resourceLoadDidReceiveChallenge(ResourceLoadInfo&&, WebKit::AuthenticationChallengeProxy&);
486     void resourceLoadDidReceiveResponse(ResourceLoadInfo&&, WebCore::ResourceResponse&&);
487     void resourceLoadDidCompleteWithError(ResourceLoadInfo&&, WebCore::ResourceError&&);
488
489     void didChangeInspectorFrontendCount(unsigned count) { m_inspectorFrontendCount = count; }
490     unsigned inspectorFrontendCount() const { return m_inspectorFrontendCount; }
491     bool hasInspectorFrontend() const { return m_inspectorFrontendCount > 0; }
492
493     bool isControlledByAutomation() const { return m_controlledByAutomation; }
494     void setControlledByAutomation(bool);
495
496     WebPageInspectorController& inspectorController() { return *m_inspectorController; }
497
498 #if PLATFORM(IOS_FAMILY)
499     void showInspectorIndication();
500     void hideInspectorIndication();
501 #endif
502
503     void createInspectorTarget(const String& targetId, Inspector::InspectorTargetType);
504     void destroyInspectorTarget(const String& targetId);
505     void sendMessageToInspectorFrontend(const String& targetId, const String& message);
506
507     void getAllFrames(CompletionHandler<void(Vector<FrameInfoData>&&)>&&);
508
509 #if ENABLE(REMOTE_INSPECTOR)
510     void setIndicating(bool);
511     bool allowsRemoteInspection() const;
512     void setAllowsRemoteInspection(bool);
513     String remoteInspectionNameOverride() const;
514     void setRemoteInspectionNameOverride(const String&);
515     void remoteInspectorInformationDidChange();
516 #endif
517
518 #if ENABLE(FULLSCREEN_API)
519     WebFullScreenManagerProxy* fullScreenManager();
520
521     API::FullscreenClient& fullscreenClient() const { return *m_fullscreenClient; }
522     void setFullscreenClient(std::unique_ptr<API::FullscreenClient>&&);
523 #endif
524 #if (PLATFORM(IOS_FAMILY) && HAVE(AVKIT)) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
525     PlaybackSessionManagerProxy* playbackSessionManager();
526     VideoFullscreenManagerProxy* videoFullscreenManager();
527 #endif
528
529 #if PLATFORM(IOS_FAMILY)
530     bool allowsMediaDocumentInlinePlayback() const;
531     void setAllowsMediaDocumentInlinePlayback(bool);
532 #endif
533
534 #if USE(SYSTEM_PREVIEW)
535     SystemPreviewController* systemPreviewController() { return m_systemPreviewController.get(); }
536     void systemPreviewActionTriggered(const WebCore::SystemPreviewInfo&, const String&);
537 #endif
538
539 #if ENABLE(CONTEXT_MENUS)
540     API::ContextMenuClient& contextMenuClient() { return *m_contextMenuClient; }
541     void setContextMenuClient(std::unique_ptr<API::ContextMenuClient>&&);
542 #endif
543     API::FindClient& findClient() { return *m_findClient; }
544     void setFindClient(std::unique_ptr<API::FindClient>&&);
545     API::FindMatchesClient& findMatchesClient() { return *m_findMatchesClient; }
546     void setFindMatchesClient(std::unique_ptr<API::FindMatchesClient>&&);
547     API::DiagnosticLoggingClient* diagnosticLoggingClient() { return m_diagnosticLoggingClient.get(); }
548     void setDiagnosticLoggingClient(std::unique_ptr<API::DiagnosticLoggingClient>&&);
549     void setFormClient(std::unique_ptr<API::FormClient>&&);
550     void setNavigationClient(UniqueRef<API::NavigationClient>&&);
551     void setHistoryClient(UniqueRef<API::HistoryClient>&&);
552     void setLoaderClient(std::unique_ptr<API::LoaderClient>&&);
553     void setPolicyClient(std::unique_ptr<API::PolicyClient>&&);
554     void setInjectedBundleClient(const WKPageInjectedBundleClientBase*);
555     void setResourceLoadClient(std::unique_ptr<API::ResourceLoadClient>&&);
556
557     API::UIClient& uiClient() { return *m_uiClient; }
558     void setUIClient(std::unique_ptr<API::UIClient>&&);
559
560     API::IconLoadingClient& iconLoadingClient() { return *m_iconLoadingClient; }
561     void setIconLoadingClient(std::unique_ptr<API::IconLoadingClient>&&);
562
563     API::InspectorClient& inspectorClient() { return *m_inspectorClient; }
564     void setInspectorClient(std::unique_ptr<API::InspectorClient>&&);
565
566     void setPageLoadStateObserver(std::unique_ptr<PageLoadState::Observer>&&);
567
568     void initializeWebPage();
569     void setDrawingArea(std::unique_ptr<DrawingAreaProxy>&&);
570
571     WeakPtr<SecKeyProxyStore> secKeyProxyStore(const WebCore::AuthenticationChallenge&);
572         
573     void close();
574     bool tryClose();
575     bool isClosed() const { return m_isClosed; }
576
577     void setOpenedByDOM() { m_openedByDOM = true; }
578     bool openedByDOM() const { return m_openedByDOM; }
579
580     bool hasCommittedAnyProvisionalLoads() const { return m_hasCommittedAnyProvisionalLoads; }
581
582     bool preferFasterClickOverDoubleTap() const { return m_preferFasterClickOverDoubleTap; }
583
584     void setIsUsingHighPerformanceWebGL(bool value) { m_isUsingHighPerformanceWebGL = value; }
585     bool isUsingHighPerformanceWebGL() const { return m_isUsingHighPerformanceWebGL; }
586
587     void didExceedInactiveMemoryLimitWhileActive();
588     void didExceedBackgroundCPULimitWhileInForeground();
589
590     void closePage();
591
592     void addPlatformLoadParameters(LoadParameters&);
593     RefPtr<API::Navigation> loadRequest(WebCore::ResourceRequest&&, WebCore::ShouldOpenExternalURLsPolicy = WebCore::ShouldOpenExternalURLsPolicy::ShouldAllowExternalSchemes, API::Object* userData = nullptr);
594     RefPtr<API::Navigation> loadFile(const String& fileURL, const String& resourceDirectoryURL, API::Object* userData = nullptr);
595     RefPtr<API::Navigation> loadData(const IPC::DataReference&, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData = nullptr, WebCore::ShouldOpenExternalURLsPolicy = WebCore::ShouldOpenExternalURLsPolicy::ShouldNotAllow);
596     void loadAlternateHTML(const IPC::DataReference&, const String& encoding, const URL& baseURL, const URL& unreachableURL, API::Object* userData = nullptr);
597     void loadWebArchiveData(API::Data*, API::Object* userData = nullptr);
598     void navigateToPDFLinkWithSimulatedClick(const String& url, WebCore::IntPoint documentPoint, WebCore::IntPoint screenPoint);
599
600     void simulateDeviceOrientationChange(double alpha, double beta, double gamma);
601
602     void stopLoading();
603     RefPtr<API::Navigation> reload(OptionSet<WebCore::ReloadOption>);
604
605     RefPtr<API::Navigation> goForward();
606     RefPtr<API::Navigation> goBack();
607
608     RefPtr<API::Navigation> goToBackForwardItem(WebBackForwardListItem&);
609     void tryRestoreScrollPosition();
610     void didChangeBackForwardList(WebBackForwardListItem* addedItem, Vector<Ref<WebBackForwardListItem>>&& removed);
611     void willGoToBackForwardListItem(const WebCore::BackForwardItemIdentifier&, bool inBackForwardCache);
612
613     bool shouldKeepCurrentBackForwardListItemInList(WebBackForwardListItem&);
614
615     bool willHandleHorizontalScrollEvents() const;
616
617     void updateWebsitePolicies(WebsitePoliciesData&&);
618
619     bool canShowMIMEType(const String& mimeType);
620
621     String currentURL() const;
622
623     float topContentInset() const { return m_topContentInset; }
624     void setTopContentInset(float);
625
626     WebCore::Color underlayColor() const { return m_underlayColor; }
627     void setUnderlayColor(const WebCore::Color&);
628
629     // At this time, m_pageExtendedBackgroundColor can be set via pageExtendedBackgroundColorDidChange() which is a message
630     // from the UIProcess, or by didCommitLayerTree(). When PLATFORM(MAC) adopts UI side compositing, we should get rid of
631     // the message entirely.
632     WebCore::Color pageExtendedBackgroundColor() const { return m_pageExtendedBackgroundColor; }
633
634     void viewWillStartLiveResize();
635     void viewWillEndLiveResize();
636
637     void setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent&, WTF::Function<void (CallbackBase::Error)>&&);
638     
639     void clearSelection();
640     void restoreSelectionInFocusedEditableElement();
641
642     PageClient& pageClient() const;
643
644     void setViewNeedsDisplay(const WebCore::Region&);
645     void requestScroll(const WebCore::FloatPoint& scrollPosition, const WebCore::IntPoint& scrollOrigin);
646     
647     WebCore::FloatPoint viewScrollPosition() const;
648
649     void setDelegatesScrolling(bool delegatesScrolling) { m_delegatesScrolling = delegatesScrolling; }
650     bool delegatesScrolling() const { return m_delegatesScrolling; }
651
652     enum class ActivityStateChangeDispatchMode : bool { Deferrable, Immediate };
653     enum class ActivityStateChangeReplyMode : bool { Asynchronous, Synchronous };
654     void activityStateDidChange(OptionSet<WebCore::ActivityState::Flag> mayHaveChanged, ActivityStateChangeDispatchMode = ActivityStateChangeDispatchMode::Deferrable, ActivityStateChangeReplyMode = ActivityStateChangeReplyMode::Asynchronous);
655     bool isInWindow() const { return m_activityState.contains(WebCore::ActivityState::IsInWindow); }
656     void waitForDidUpdateActivityState(ActivityStateChangeID);
657     void didUpdateActivityState() { m_waitingForDidUpdateActivityState = false; }
658
659     void layerHostingModeDidChange();
660
661     WebCore::IntSize viewSize() const;
662     bool isViewVisible() const { return m_activityState.contains(WebCore::ActivityState::IsVisible); }
663     bool isViewFocused() const { return m_activityState.contains(WebCore::ActivityState::IsFocused); }
664     bool isViewWindowActive() const { return m_activityState.contains(WebCore::ActivityState::WindowIsActive); }
665
666     void addMIMETypeWithCustomContentProvider(const String& mimeType);
667
668     void selectAll();
669     void executeEditCommand(const String& commandName, const String& argument = String());
670     void validateCommand(const String& commandName, WTF::Function<void (const String&, bool, int32_t, CallbackBase::Error)>&&);
671
672     const EditorState& editorState() const { return m_editorState; }
673     bool canDelete() const { return hasSelectedRange() && isContentEditable(); }
674     bool hasSelectedRange() const { return m_editorState.selectionIsRange; }
675     bool isContentEditable() const { return m_editorState.isContentEditable; }
676
677     void increaseListLevel();
678     void decreaseListLevel();
679     void changeListType();
680
681     void setBaseWritingDirection(WebCore::WritingDirection);
682
683     Optional<WebCore::FontAttributes> cachedFontAttributesAtSelectionStart() const { return m_cachedFontAttributesAtSelectionStart; }
684
685 #if HAVE(TOUCH_BAR)
686     const TouchBarMenuData& touchBarMenuData() const { return m_touchBarMenuData; }
687 #endif
688
689     bool maintainsInactiveSelection() const;
690     void setMaintainsInactiveSelection(bool);
691     void setEditable(bool);
692     bool isEditable() const { return m_isEditable; }
693
694     void activateMediaStreamCaptureInPage();
695     bool isMediaStreamCaptureMuted() const { return m_mutedState & WebCore::MediaProducer::MediaStreamCaptureIsMuted; }
696     void setMediaStreamCaptureMuted(bool);
697     void executeEditCommand(const String& commandName, const String& argument, WTF::Function<void(CallbackBase::Error)>&&);
698         
699     void requestFontAttributesAtSelectionStart(Function<void(const WebCore::FontAttributes&, CallbackBase::Error)>&&);
700     void fontAttributesCallback(const WebCore::FontAttributes&, CallbackID);
701
702     void textInputContextsInRect(WebCore::FloatRect, CompletionHandler<void(const Vector<WebCore::ElementContext>&)>&&);
703     void focusTextInputContext(const WebCore::ElementContext&, CompletionHandler<void(bool)>&&);
704     void setCanShowPlaceholder(const WebCore::ElementContext&, bool);
705
706 #if ENABLE(UI_SIDE_COMPOSITING)
707     void updateVisibleContentRects(const VisibleContentRectUpdateInfo&);
708 #endif
709
710 #if PLATFORM(IOS_FAMILY)
711     void setShouldRevealCurrentSelectionAfterInsertion(bool);
712
713     double displayedContentScale() const { return m_lastVisibleContentRectUpdate.scale(); }
714     const WebCore::FloatRect& exposedContentRect() const { return m_lastVisibleContentRectUpdate.exposedContentRect(); }
715     const WebCore::FloatRect& unobscuredContentRect() const { return m_lastVisibleContentRectUpdate.unobscuredContentRect(); }
716     bool inStableState() const { return m_lastVisibleContentRectUpdate.inStableState(); }
717     const WebCore::FloatRect& unobscuredContentRectRespectingInputViewBounds() const { return m_lastVisibleContentRectUpdate.unobscuredContentRectRespectingInputViewBounds(); }
718     // When visual viewports are enabled, this is the layout viewport rect.
719     const WebCore::FloatRect& layoutViewportRect() const { return m_lastVisibleContentRectUpdate.layoutViewportRect(); }
720
721     void resendLastVisibleContentRects();
722
723     WebCore::FloatRect computeLayoutViewportRect(const WebCore::FloatRect& unobscuredContentRect, const WebCore::FloatRect& unobscuredContentRectRespectingInputViewBounds, const WebCore::FloatRect& currentLayoutViewportRect, double displayedContentScale, WebCore::FrameView::LayoutViewportConstraint = WebCore::FrameView::LayoutViewportConstraint::Unconstrained) const;
724
725     WebCore::FloatRect unconstrainedLayoutViewportRect() const;
726     void adjustLayersForLayoutViewport(const WebCore::FloatRect& layoutViewport);
727
728     void scrollingNodeScrollViewWillStartPanGesture();
729     void scrollingNodeScrollViewDidScroll();
730     void scrollingNodeScrollWillStartScroll();
731     void scrollingNodeScrollDidEndScroll();
732
733     void dynamicViewportSizeUpdate(const WebCore::FloatSize& viewLayoutSize, const WebCore::FloatSize& maximumUnobscuredSize, const WebCore::FloatRect& targetExposedContentRect, const WebCore::FloatRect& targetUnobscuredRect, const WebCore::FloatRect& targetUnobscuredRectInScrollViewCoordinates, const WebCore::FloatBoxExtent& unobscuredSafeAreaInsets, double targetScale, int32_t deviceOrientation, double minimumEffectiveDeviceWidth, DynamicViewportSizeUpdateID);
734
735     void setViewportConfigurationViewLayoutSize(const WebCore::FloatSize&, double scaleFactor, double minimumEffectiveDeviceWidth);
736     void setMaximumUnobscuredSize(const WebCore::FloatSize&);
737     WebCore::FloatSize maximumUnobscuredSize() const { return m_maximumUnobscuredSize; }
738     void setDeviceOrientation(int32_t);
739     int32_t deviceOrientation() const { return m_deviceOrientation; }
740     void setOverrideViewportArguments(const Optional<WebCore::ViewportArguments>&);
741     void willCommitLayerTree(TransactionID);
742
743     void selectWithGesture(const WebCore::IntPoint, WebCore::TextGranularity, uint32_t gestureType, uint32_t gestureState, bool isInteractingWithFocusedElement, WTF::Function<void(const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t, CallbackBase::Error)>&&);
744     void updateSelectionWithTouches(const WebCore::IntPoint, uint32_t touches, bool baseIsStart, WTF::Function<void (const WebCore::IntPoint&, uint32_t, uint32_t, CallbackBase::Error)>&&);
745     void selectWithTwoTouches(const WebCore::IntPoint from, const WebCore::IntPoint to, uint32_t gestureType, uint32_t gestureState, WTF::Function<void (const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t, CallbackBase::Error)>&&);
746     void extendSelection(WebCore::TextGranularity);
747     void selectWordBackward();
748     void moveSelectionByOffset(int32_t offset, WTF::Function<void (CallbackBase::Error)>&&);
749     void selectTextWithGranularityAtPoint(const WebCore::IntPoint, WebCore::TextGranularity, bool isInteractingWithFocusedElement, WTF::Function<void(CallbackBase::Error)>&&);
750     void selectPositionAtPoint(const WebCore::IntPoint, bool isInteractingWithFocusedElement, WTF::Function<void(CallbackBase::Error)>&&);
751     void selectPositionAtBoundaryWithDirection(const WebCore::IntPoint, WebCore::TextGranularity, WebCore::SelectionDirection, bool isInteractingWithFocusedElement, WTF::Function<void(CallbackBase::Error)>&&);
752     void moveSelectionAtBoundaryWithDirection(WebCore::TextGranularity, WebCore::SelectionDirection, WTF::Function<void(CallbackBase::Error)>&&);
753     void beginSelectionInDirection(WebCore::SelectionDirection, WTF::Function<void (uint64_t, CallbackBase::Error)>&&);
754     void updateSelectionWithExtentPoint(const WebCore::IntPoint, bool isInteractingWithFocusedElement, RespectSelectionAnchor, WTF::Function<void(uint64_t, CallbackBase::Error)>&&);
755     void updateSelectionWithExtentPointAndBoundary(const WebCore::IntPoint, WebCore::TextGranularity, bool isInteractingWithFocusedElement, WTF::Function<void(uint64_t, CallbackBase::Error)>&&);
756     void requestAutocorrectionData(const String& textForAutocorrection, CompletionHandler<void(WebAutocorrectionData)>&&);
757     void applyAutocorrection(const String& correction, const String& originalText, WTF::Function<void (const String&, CallbackBase::Error)>&&);
758     bool applyAutocorrection(const String& correction, const String& originalText);
759     void requestAutocorrectionContext();
760     void handleAutocorrectionContext(const WebAutocorrectionContext&);
761     void requestDictationContext(WTF::Function<void (const String&, const String&, const String&, CallbackBase::Error)>&&);
762     void replaceDictatedText(const String& oldText, const String& newText);
763     void replaceSelectedText(const String& oldText, const String& newText);
764     void didReceivePositionInformation(const InteractionInformationAtPosition&);
765     void requestPositionInformation(const InteractionInformationRequest&);
766     void startInteractionWithPositionInformation(const InteractionInformationAtPosition&);
767     void stopInteraction();
768     void performActionOnElement(uint32_t action);
769     void saveImageToLibrary(const SharedMemory::Handle& imageHandle, uint64_t imageSize);
770     void focusNextFocusedElement(bool isForward, WTF::Function<void (CallbackBase::Error)>&& = [] (auto) { });
771     void setFocusedElementValue(const String&);
772     void setFocusedElementValueAsNumber(double);
773     void setFocusedElementSelectedIndex(uint32_t index, bool allowMultipleSelection = false);
774     void applicationDidEnterBackground();
775     void applicationDidFinishSnapshottingAfterEnteringBackground();
776     void applicationWillEnterForeground();
777     bool lastObservedStateWasBackground() const { return m_lastObservedStateWasBackground; }
778     void applicationWillResignActive();
779     void applicationDidBecomeActive();
780     void applicationDidEnterBackgroundForMedia();
781     void applicationWillEnterForegroundForMedia();
782     void commitPotentialTapFailed();
783     void didNotHandleTapAsClick(const WebCore::IntPoint&);
784     void didCompleteSyntheticClick();
785     void disableDoubleTapGesturesDuringTapIfNecessary(uint64_t requestID);
786     void handleSmartMagnificationInformationForPotentialTap(uint64_t requestID, const WebCore::FloatRect& renderRect, bool fitEntireRect, double viewportMinimumScale, double viewportMaximumScale, bool nodeIsRootLevel);
787     void contentSizeCategoryDidChange(const String& contentSizeCategory);
788     void getSelectionContext(WTF::Function<void(const String&, const String&, const String&, CallbackBase::Error)>&&);
789     void handleTwoFingerTapAtPoint(const WebCore::IntPoint&, OptionSet<WebKit::WebEvent::Modifier>, uint64_t requestID);
790     void handleStylusSingleTapAtPoint(const WebCore::IntPoint&, uint64_t requestID);
791     void setForceAlwaysUserScalable(bool);
792     bool forceAlwaysUserScalable() const { return m_forceAlwaysUserScalable; }
793     double layoutSizeScaleFactor() const { return m_viewportConfigurationLayoutSizeScaleFactor; }
794     WebCore::FloatSize viewLayoutSize() const { return m_viewportConfigurationViewLayoutSize; }
795     double minimumEffectiveDeviceWidth() const { return m_viewportConfigurationMinimumEffectiveDeviceWidth; }
796     void setMinimumEffectiveDeviceWidthWithoutViewportConfigurationUpdate(double minimumEffectiveDeviceWidth) { m_viewportConfigurationMinimumEffectiveDeviceWidth = minimumEffectiveDeviceWidth; }
797     void setIsScrollingOrZooming(bool);
798     void requestRectsForGranularityWithSelectionOffset(WebCore::TextGranularity, uint32_t offset, WTF::Function<void(const Vector<WebCore::SelectionRect>&, CallbackBase::Error)>&&);
799     void requestRectsAtSelectionOffsetWithText(int32_t offset, const String&, WTF::Function<void(const Vector<WebCore::SelectionRect>&, CallbackBase::Error)>&&);
800     void autofillLoginCredentials(const String& username, const String& password);
801     void storeSelectionForAccessibility(bool);
802     void startAutoscrollAtPosition(const WebCore::FloatPoint& positionInWindow);
803     void cancelAutoscroll();
804     void hardwareKeyboardAvailabilityChanged(bool keyboardIsAttached);
805     bool isScrollingOrZooming() const { return m_isScrollingOrZooming; }
806     void requestEvasionRectsAboveSelection(CompletionHandler<void(const Vector<WebCore::FloatRect>&)>&&);
807     void updateSelectionWithDelta(int64_t locationDelta, int64_t lengthDelta, CompletionHandler<void()>&&);
808     void requestDocumentEditingContext(WebKit::DocumentEditingContextRequest, CompletionHandler<void(WebKit::DocumentEditingContext)>&&);
809     void generateSyntheticEditingCommand(SyntheticEditingCommandType);
810 #if ENABLE(DRAG_SUPPORT)
811     void didHandleDragStartRequest(bool started);
812     void didHandleAdditionalDragItemsRequest(bool added);
813     void requestDragStart(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition, WebCore::DragSourceAction allowedActions);
814     void requestAdditionalItemsForDragSession(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition, WebCore::DragSourceAction allowedActions);
815     void insertDroppedImagePlaceholders(const Vector<WebCore::IntSize>&, CompletionHandler<void(const Vector<WebCore::IntRect>&, Optional<WebCore::TextIndicatorData>)>&& reply);
816     void willReceiveEditDragSnapshot();
817     void didReceiveEditDragSnapshot(Optional<WebCore::TextIndicatorData>);
818     void didConcludeDrop();
819 #endif
820 #endif // PLATFORM(IOS_FAMILY)
821 #if ENABLE(DATA_DETECTION)
822     void setDataDetectionResult(const DataDetectionResult&);
823 #endif
824     void didCommitLayerTree(const WebKit::RemoteLayerTreeTransaction&);
825     void layerTreeCommitComplete();
826
827     bool updateLayoutViewportParameters(const WebKit::RemoteLayerTreeTransaction&);
828
829 #if PLATFORM(GTK) || PLATFORM(WPE)
830     void cancelComposition(const String& compositionString);
831     void deleteSurrounding(int64_t offset, unsigned characterCount);
832
833     void setInputMethodState(Optional<InputMethodState>&&);
834 #endif
835
836 #if PLATFORM(GTK)
837     void getCenterForZoomGesture(const WebCore::IntPoint& centerInViewCoordinates, WebCore::IntPoint& center);
838 #endif
839
840 #if PLATFORM(COCOA)
841     void windowAndViewFramesChanged(const WebCore::FloatRect& viewFrameInWindowCoordinates, const WebCore::FloatPoint& accessibilityViewCoordinates);
842     void setMainFrameIsScrollable(bool);
843
844     void sendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdentifier, const String& textInput);
845     bool shouldDelayWindowOrderingForEvent(const WebMouseEvent&);
846     bool acceptsFirstMouse(int eventNumber, const WebMouseEvent&);
847
848     void setRemoteLayerTreeRootNode(RemoteLayerTreeNode*);
849     CALayer *acceleratedCompositingRootLayer() const;
850
851     void setTextAsync(const String&);
852     void insertTextAsync(const String& text, const EditingRange& replacementRange, InsertTextOptions&&);
853     void hasMarkedText(CompletionHandler<void(bool)>&&);
854     void getMarkedRangeAsync(WTF::Function<void (EditingRange, CallbackBase::Error)>&&);
855     void getSelectedRangeAsync(WTF::Function<void (EditingRange, CallbackBase::Error)>&&);
856     void characterIndexForPointAsync(const WebCore::IntPoint&, WTF::Function<void (uint64_t, CallbackBase::Error)>&&);
857     void firstRectForCharacterRangeAsync(const EditingRange&, WTF::Function<void (const WebCore::IntRect&, const EditingRange&, CallbackBase::Error)>&&);
858     void setCompositionAsync(const String& text, const Vector<WebCore::CompositionUnderline>&, const Vector<WebCore::CompositionHighlight>&, const EditingRange& selectionRange, const EditingRange& replacementRange);
859     void confirmCompositionAsync();
860
861     void setScrollPerformanceDataCollectionEnabled(bool);
862     bool scrollPerformanceDataCollectionEnabled() const { return m_scrollPerformanceDataCollectionEnabled; }
863     RemoteLayerTreeScrollingPerformanceData* scrollingPerformanceData() { return m_scrollingPerformanceData.get(); }
864 #endif // PLATFORM(COCOA)
865
866     void changeFontAttributes(WebCore::FontAttributeChanges&&);
867     void changeFont(WebCore::FontChanges&&);
868
869 #if PLATFORM(MAC)
870     void insertDictatedTextAsync(const String& text, const EditingRange& replacementRange, const Vector<WebCore::TextAlternativeWithRange>& dictationAlternatives, bool registerUndoGroup);
871     void attributedSubstringForCharacterRangeAsync(const EditingRange&, WTF::Function<void (const AttributedString&, const EditingRange&, CallbackBase::Error)>&&);
872     void fontAtSelection(Function<void(const FontInfo&, double, bool, CallbackBase::Error)>&&);
873
874     void startWindowDrag();
875     NSWindow *platformWindow();
876     void rootViewToWindow(const WebCore::IntRect& viewRect, WebCore::IntRect& windowRect);
877
878     NSView *inspectorAttachmentView();
879     _WKRemoteObjectRegistry *remoteObjectRegistry();
880
881     CGRect boundsOfLayerInLayerBackedWindowCoordinates(CALayer *) const;
882 #endif // PLATFORM(MAC)
883
884 #if PLATFORM(GTK)
885     PlatformViewWidget viewWidget();
886     bool makeGLContextCurrent();
887     void themeDidChange();
888 #endif
889
890     const Optional<WebCore::Color>& backgroundColor() const { return m_backgroundColor; }
891     void setBackgroundColor(const Optional<WebCore::Color>&);
892
893 #if PLATFORM(WIN)
894     PlatformViewWidget viewWidget();
895 #if USE(DIRECT2D)
896     ID3D11Device1* device() const;
897     void setDevice(ID3D11Device1*);
898 #endif
899 #endif
900 #if USE(LIBWPE)
901     struct wpe_view_backend* viewBackend();
902 #endif
903
904     bool isProcessingMouseEvents() const;
905     void processNextQueuedMouseEvent();
906     void handleMouseEvent(const NativeWebMouseEvent&);
907
908     void doAfterProcessingAllPendingMouseEvents(WTF::Function<void ()>&&);
909     void didFinishProcessingAllPendingMouseEvents();
910     void flushPendingMouseEventCallbacks();
911
912     void handleWheelEvent(const NativeWebWheelEvent&);
913
914     bool isProcessingKeyboardEvents() const;
915     void handleKeyboardEvent(const NativeWebKeyboardEvent&);
916 #if PLATFORM(WIN)
917     void dispatchPendingCharEvents(const NativeWebKeyboardEvent&);
918 #endif
919
920 #if ENABLE(MAC_GESTURE_EVENTS)
921     void handleGestureEvent(const NativeWebGestureEvent&);
922 #endif
923
924 #if ENABLE(IOS_TOUCH_EVENTS)
925     void resetPotentialTapSecurityOrigin();
926     void handlePreventableTouchEvent(NativeWebTouchEvent&);
927     void handleUnpreventableTouchEvent(const NativeWebTouchEvent&);
928
929 #elif ENABLE(TOUCH_EVENTS)
930     void handleTouchEvent(const NativeWebTouchEvent&);
931 #endif
932
933 #if ENABLE(POINTER_EVENTS)
934     void cancelPointer(WebCore::PointerID, const WebCore::IntPoint&);
935     void touchWithIdentifierWasRemoved(WebCore::PointerID);
936 #endif
937
938     void scrollBy(WebCore::ScrollDirection, WebCore::ScrollGranularity);
939     void centerSelectionInVisibleArea();
940
941     const String& toolTip() const { return m_toolTip; }
942
943     const String& userAgent() const { return m_userAgent; }
944     void setApplicationNameForUserAgent(const String&);
945     const String& applicationNameForUserAgent() const { return m_applicationNameForUserAgent; }
946     void setApplicationNameForDesktopUserAgent(const String& applicationName) { m_applicationNameForDesktopUserAgent = applicationName; }
947     const String& applicationNameForDesktopUserAgent() const { return m_applicationNameForDesktopUserAgent; }
948     void setCustomUserAgent(const String&);
949     const String& customUserAgent() const { return m_customUserAgent; }
950     static String standardUserAgent(const String& applicationName = String());
951
952     bool supportsTextEncoding() const;
953     void setCustomTextEncodingName(const String&);
954     String customTextEncodingName() const { return m_customTextEncodingName; }
955
956     bool areActiveDOMObjectsAndAnimationsSuspended() const { return m_isPageSuspended; }
957     void resumeActiveDOMObjectsAndAnimations();
958     void suspendActiveDOMObjectsAndAnimations();
959
960     double estimatedProgress() const;
961
962     SessionState sessionState(WTF::Function<bool (WebBackForwardListItem&)>&& = nullptr) const;
963     RefPtr<API::Navigation> restoreFromSessionState(SessionState, bool navigate);
964
965     bool supportsTextZoom() const;
966     double textZoomFactor() const { return m_textZoomFactor; }
967     void setTextZoomFactor(double);
968     double pageZoomFactor() const;
969     void setPageZoomFactor(double);
970     void setPageAndTextZoomFactors(double pageZoomFactor, double textZoomFactor);
971
972     void scalePage(double scale, const WebCore::IntPoint& origin);
973     void scalePageInViewCoordinates(double scale, const WebCore::IntPoint& centerInViewCoordinates);
974     double pageScaleFactor() const;
975     double viewScaleFactor() const { return m_viewScaleFactor; }
976     void scaleView(double scale);
977     void setShouldScaleViewToFitDocument(bool);
978     
979     float deviceScaleFactor() const;
980     void setIntrinsicDeviceScaleFactor(float);
981     void setCustomDeviceScaleFactor(float);
982     void windowScreenDidChange(WebCore::PlatformDisplayID);
983     void accessibilitySettingsDidChange();
984
985     void setUseFixedLayout(bool);
986     void setFixedLayoutSize(const WebCore::IntSize&);
987     bool useFixedLayout() const { return m_useFixedLayout; };
988     const WebCore::IntSize& fixedLayoutSize() const { return m_fixedLayoutSize; };
989
990     void setAlwaysShowsHorizontalScroller(bool);
991     void setAlwaysShowsVerticalScroller(bool);
992     bool alwaysShowsHorizontalScroller() const { return m_alwaysShowsHorizontalScroller; }
993     bool alwaysShowsVerticalScroller() const { return m_alwaysShowsVerticalScroller; }
994
995     void listenForLayoutMilestones(OptionSet<WebCore::LayoutMilestone>);
996
997     bool hasHorizontalScrollbar() const { return m_mainFrameHasHorizontalScrollbar; }
998     bool hasVerticalScrollbar() const { return m_mainFrameHasVerticalScrollbar; }
999
1000     void setSuppressScrollbarAnimations(bool);
1001     bool areScrollbarAnimationsSuppressed() const { return m_suppressScrollbarAnimations; }
1002
1003     bool isPinnedToLeftSide() const { return m_mainFrameIsPinnedToLeftSide; }
1004     bool isPinnedToRightSide() const { return m_mainFrameIsPinnedToRightSide; }
1005     bool isPinnedToTopSide() const { return m_mainFrameIsPinnedToTopSide; }
1006     bool isPinnedToBottomSide() const { return m_mainFrameIsPinnedToBottomSide; }
1007
1008     bool rubberBandsAtLeft() const;
1009     void setRubberBandsAtLeft(bool);
1010     bool rubberBandsAtRight() const;
1011     void setRubberBandsAtRight(bool);
1012     bool rubberBandsAtTop() const;
1013     void setRubberBandsAtTop(bool);
1014     bool rubberBandsAtBottom() const;
1015     void setRubberBandsAtBottom(bool);
1016
1017     void setShouldUseImplicitRubberBandControl(bool shouldUseImplicitRubberBandControl) { m_shouldUseImplicitRubberBandControl = shouldUseImplicitRubberBandControl; }
1018     bool shouldUseImplicitRubberBandControl() const { return m_shouldUseImplicitRubberBandControl; }
1019         
1020     void setEnableVerticalRubberBanding(bool);
1021     bool verticalRubberBandingIsEnabled() const;
1022     void setEnableHorizontalRubberBanding(bool);
1023     bool horizontalRubberBandingIsEnabled() const;
1024         
1025     void setBackgroundExtendsBeyondPage(bool);
1026     bool backgroundExtendsBeyondPage() const;
1027
1028     void setPaginationMode(WebCore::Pagination::Mode);
1029     WebCore::Pagination::Mode paginationMode() const { return m_paginationMode; }
1030     void setPaginationBehavesLikeColumns(bool);
1031     bool paginationBehavesLikeColumns() const { return m_paginationBehavesLikeColumns; }
1032     void setPageLength(double);
1033     double pageLength() const { return m_pageLength; }
1034     void setGapBetweenPages(double);
1035     double gapBetweenPages() const { return m_gapBetweenPages; }
1036     void setPaginationLineGridEnabled(bool);
1037     bool paginationLineGridEnabled() const { return m_paginationLineGridEnabled; }
1038     unsigned pageCount() const { return m_pageCount; }
1039
1040     void isJITEnabled(CompletionHandler<void(bool)>&&);
1041
1042 #if PLATFORM(MAC)
1043     void setUseSystemAppearance(bool);
1044     bool useSystemAppearance() const { return m_useSystemAppearance; }
1045 #endif
1046
1047     void effectiveAppearanceDidChange();
1048     bool useDarkAppearance() const;
1049     bool useElevatedUserInterfaceLevel() const;
1050
1051 #if PLATFORM(COCOA)
1052     // Called by the web process through a message.
1053     void registerWebProcessAccessibilityToken(const IPC::DataReference&);
1054     // Called by the UI process when it is ready to send its tokens to the web process.
1055     void registerUIProcessAccessibilityTokens(const IPC::DataReference& elemenToken, const IPC::DataReference& windowToken);
1056     bool readSelectionFromPasteboard(const String& pasteboardName);
1057     String stringSelectionForPasteboard();
1058     RefPtr<WebCore::SharedBuffer> dataSelectionForPasteboard(const String& pasteboardType);
1059     void makeFirstResponder();
1060     void assistiveTechnologyMakeFirstResponder();
1061
1062     ColorSpaceData colorSpace();
1063 #endif
1064
1065 #if ENABLE(SERVICE_CONTROLS)
1066     void replaceSelectionWithPasteboardData(const Vector<String>& types, const IPC::DataReference&);
1067 #endif
1068
1069     void pageScaleFactorDidChange(double);
1070     void pluginScaleFactorDidChange(double);
1071     void pluginZoomFactorDidChange(double);
1072
1073     // Find.
1074     void findString(const String&, FindOptions, unsigned maxMatchCount, Function<void (bool, CallbackBase::Error)>&& = nullptr);
1075     void findStringMatches(const String&, FindOptions, unsigned maxMatchCount);
1076     void getImageForFindMatch(int32_t matchIndex);
1077     void selectFindMatch(int32_t matchIndex);
1078     void indicateFindMatch(int32_t matchIndex);
1079     void didGetImageForFindMatch(const ShareableBitmap::Handle& contentImageHandle, uint32_t matchIndex);
1080     void hideFindUI();
1081     void countStringMatches(const String&, FindOptions, unsigned maxMatchCount);
1082     void replaceMatches(Vector<uint32_t>&& matchIndices, const String& replacementText, bool selectionOnly, Function<void(uint64_t, CallbackBase::Error)>&&);
1083     void didCountStringMatches(const String&, uint32_t matchCount);
1084     void setTextIndicator(const WebCore::TextIndicatorData&, uint64_t /* WebCore::TextIndicatorWindowLifetime */ lifetime = 0 /* Permanent */);
1085     void setTextIndicatorAnimationProgress(float);
1086     void clearTextIndicator();
1087
1088     void findStringCallback(bool found, CallbackID);
1089     void didFindString(const String&, const Vector<WebCore::IntRect>&, uint32_t matchCount, int32_t matchIndex, bool didWrapAround);
1090     void didFailToFindString(const String&);
1091     void didFindStringMatches(const String&, const Vector<Vector<WebCore::IntRect>>& matchRects, int32_t firstIndexAfterSelection);
1092
1093     void getContentsAsString(ContentAsStringIncludesChildFrames, WTF::Function<void(const String&, CallbackBase::Error)>&&);
1094 #if PLATFORM(COCOA)
1095     void getContentsAsAttributedString(CompletionHandler<void(const AttributedString&)>&&);
1096 #endif
1097     void getBytecodeProfile(WTF::Function<void (const String&, CallbackBase::Error)>&&);
1098     void getSamplingProfilerOutput(WTF::Function<void (const String&, CallbackBase::Error)>&&);
1099
1100 #if ENABLE(MHTML)
1101     void getContentsAsMHTMLData(Function<void (API::Data*, CallbackBase::Error)>&&);
1102 #endif
1103     void getMainResourceDataOfFrame(WebFrameProxy*, Function<void (API::Data*, CallbackBase::Error)>&&);
1104     void getResourceDataFromFrame(WebFrameProxy*, API::URL*, Function<void (API::Data*, CallbackBase::Error)>&&);
1105     void getRenderTreeExternalRepresentation(WTF::Function<void (const String&, CallbackBase::Error)>&&);
1106     void getSelectionOrContentsAsString(WTF::Function<void (const String&, CallbackBase::Error)>&&);
1107     void getSelectionAsWebArchiveData(Function<void (API::Data*, CallbackBase::Error)>&&);
1108     void getSourceForFrame(WebFrameProxy*, WTF::Function<void (const String&, CallbackBase::Error)>&&);
1109     void getWebArchiveOfFrame(WebFrameProxy*, Function<void (API::Data*, CallbackBase::Error)>&&);
1110     void runJavaScriptInMainFrame(WebCore::RunJavaScriptParameters&&, WTF::Function<void (API::SerializedScriptValue*, Optional<WebCore::ExceptionDetails>, CallbackBase::Error)>&& callbackFunction);
1111     void runJavaScriptInMainFrameScriptWorld(WebCore::RunJavaScriptParameters&&, API::ContentWorld&, WTF::Function<void(API::SerializedScriptValue*, Optional<WebCore::ExceptionDetails>, CallbackBase::Error)>&& callbackFunction);
1112     // For sub frames.
1113     void runJavaScriptInFrame(WebCore::FrameIdentifier, const String& script, bool forceUserGesture, WTF::Function<void(API::SerializedScriptValue*, Optional<WebCore::ExceptionDetails>, CallbackBase::Error)>&& callbackFunction);
1114     void forceRepaint(RefPtr<VoidCallback>&&);
1115
1116     float headerHeight(WebFrameProxy&);
1117     float footerHeight(WebFrameProxy&);
1118     void drawHeader(WebFrameProxy&, WebCore::FloatRect&&);
1119     void drawFooter(WebFrameProxy&, WebCore::FloatRect&&);
1120
1121 #if PLATFORM(COCOA)
1122     // Dictionary.
1123     void performDictionaryLookupAtLocation(const WebCore::FloatPoint&);
1124     void performDictionaryLookupOfCurrentSelection();
1125 #endif
1126
1127     class PolicyDecisionSender;
1128     enum class WillContinueLoadInNewProcess : bool { No, Yes };
1129     void receivedPolicyDecision(WebCore::PolicyAction, API::Navigation*, Optional<WebsitePoliciesData>&&, Ref<PolicyDecisionSender>&&, WillContinueLoadInNewProcess = WillContinueLoadInNewProcess::No);
1130     void receivedNavigationPolicyDecision(WebCore::PolicyAction, API::Navigation*, ProcessSwapRequestedByClient, WebFrameProxy&, API::WebsitePolicies*, Ref<PolicyDecisionSender>&&);
1131
1132     void backForwardRemovedItem(const WebCore::BackForwardItemIdentifier&);
1133
1134 #if ENABLE(DRAG_SUPPORT)    
1135     // Drag and drop support.
1136     void dragEntered(WebCore::DragData&, const String& dragStorageName = String());
1137     void dragUpdated(WebCore::DragData&, const String& dragStorageName = String());
1138     void dragExited(WebCore::DragData&, const String& dragStorageName = String());
1139     void performDragOperation(WebCore::DragData&, const String& dragStorageName, SandboxExtension::Handle&&, SandboxExtension::HandleArray&&);
1140     void didPerformDragOperation(bool handled);
1141
1142     void didPerformDragControllerAction(uint64_t dragOperation, WebCore::DragHandlingMethod, bool mouseIsOverFileInput, unsigned numberOfItemsToBeAccepted, const WebCore::IntRect& insertionRect, const WebCore::IntRect& editableElementRect);
1143     void dragEnded(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition, uint64_t operation);
1144     void didStartDrag();
1145     void dragCancelled();
1146     void setDragCaretRect(const WebCore::IntRect&);
1147 #if PLATFORM(COCOA)
1148     void startDrag(const WebCore::DragItem&, const ShareableBitmap::Handle& dragImageHandle);
1149     void setPromisedDataForImage(const String& pasteboardName, const SharedMemory::Handle& imageHandle, uint64_t imageSize, const String& filename, const String& extension,
1150                          const String& title, const String& url, const String& visibleURL, const SharedMemory::Handle& archiveHandle, uint64_t archiveSize);
1151 #endif
1152 #if PLATFORM(GTK)
1153     void startDrag(WebSelectionData&&, uint64_t dragOperation, const ShareableBitmap::Handle& dragImage);
1154 #endif
1155 #endif
1156
1157     void processDidBecomeUnresponsive();
1158     void processDidBecomeResponsive();
1159     void processDidTerminate(ProcessTerminationReason);
1160     void provisionalProcessDidTerminate();
1161     void dispatchProcessDidTerminate(ProcessTerminationReason);
1162     void willChangeProcessIsResponsive();
1163     void didChangeProcessIsResponsive();
1164
1165 #if PLATFORM(IOS_FAMILY)
1166     void processWillBecomeSuspended();
1167     void processWillBecomeForeground();
1168 #endif
1169
1170 #if HAVE(VISIBILITY_PROPAGATION_VIEW)
1171     void didCreateContextForVisibilityPropagation(LayerHostingContextID);
1172     void didCreateContextInGPUProcessForVisibilityPropagation(LayerHostingContextID);
1173     LayerHostingContextID contextIDForVisibilityPropagation() const { return m_contextIDForVisibilityPropagation; }
1174 #endif
1175
1176 #if ENABLE(GPU_PROCESS)
1177     void gpuProcessCrashed();
1178 #endif
1179
1180     virtual void enterAcceleratedCompositingMode(const LayerTreeContext&);
1181     virtual void exitAcceleratedCompositingMode();
1182     virtual void updateAcceleratedCompositingMode(const LayerTreeContext&);
1183
1184     void addEditCommand(WebEditCommandProxy&);
1185     void removeEditCommand(WebEditCommandProxy&);
1186     void registerEditCommand(Ref<WebEditCommandProxy>&&, UndoOrRedo);
1187
1188     bool canUndo();
1189     bool canRedo();
1190
1191 #if PLATFORM(COCOA)
1192     void registerKeypressCommandName(const String& name) { m_knownKeypressCommandNames.add(name); }
1193     bool isValidKeypressCommandName(const String& name) const { return m_knownKeypressCommandNames.contains(name); }
1194 #endif
1195
1196     WebProcessProxy& ensureRunningProcess();
1197     WebProcessProxy& process() const { return m_process; }
1198     ProcessID processIdentifier() const;
1199
1200     WebBackForwardCache& backForwardCache() const;
1201
1202     WebPreferences& preferences() { return m_preferences; }
1203     void setPreferences(WebPreferences&);
1204
1205     WebPageGroup& pageGroup() { return m_pageGroup; }
1206
1207     bool hasRunningProcess() const;
1208     void launchInitialProcessIfNecessary();
1209
1210 #if ENABLE(DRAG_SUPPORT)
1211     WebCore::DragOperation currentDragOperation() const { return m_currentDragOperation; }
1212     WebCore::DragHandlingMethod currentDragHandlingMethod() const { return m_currentDragHandlingMethod; }
1213     bool currentDragIsOverFileInput() const { return m_currentDragIsOverFileInput; }
1214     unsigned currentDragNumberOfFilesToBeAccepted() const { return m_currentDragNumberOfFilesToBeAccepted; }
1215     WebCore::IntRect currentDragCaretRect() const { return m_currentDragCaretRect; }
1216     WebCore::IntRect currentDragCaretEditableElementRect() const { return m_currentDragCaretEditableElementRect; }
1217     void resetCurrentDragInformation();
1218     void didEndDragging();
1219 #endif
1220
1221     void preferencesDidChange();
1222
1223 #if ENABLE(CONTEXT_MENUS)
1224     // Called by the WebContextMenuProxy.
1225     void contextMenuItemSelected(const WebContextMenuItemData&);
1226     void handleContextMenuKeyEvent();
1227 #endif
1228
1229     // Called by the WebOpenPanelResultListenerProxy.
1230 #if PLATFORM(IOS_FAMILY)
1231     void didChooseFilesForOpenPanelWithDisplayStringAndIcon(const Vector<String>&, const String& displayString, const API::Data* iconData);
1232 #endif
1233     void didChooseFilesForOpenPanel(const Vector<String>&);
1234     void didCancelForOpenPanel();
1235
1236     WebPageCreationParameters creationParameters(WebProcessProxy&, DrawingAreaProxy&);
1237
1238     void handleDownloadRequest(DownloadProxy&);
1239
1240     void advanceToNextMisspelling(bool startBeforeSelection);
1241     void changeSpellingToWord(const String& word);
1242 #if USE(APPKIT)
1243     void uppercaseWord();
1244     void lowercaseWord();
1245     void capitalizeWord();
1246 #endif
1247
1248 #if PLATFORM(COCOA)
1249     bool isSmartInsertDeleteEnabled() const { return m_isSmartInsertDeleteEnabled; }
1250     void setSmartInsertDeleteEnabled(bool);
1251 #endif
1252
1253     void setCanRunModal(bool);
1254     bool canRunModal();
1255
1256     void beginPrinting(WebFrameProxy*, const PrintInfo&);
1257     void endPrinting();
1258     void computePagesForPrinting(WebFrameProxy*, const PrintInfo&, Ref<ComputedPagesCallback>&&);
1259 #if PLATFORM(COCOA)
1260     void drawRectToImage(WebFrameProxy*, const PrintInfo&, const WebCore::IntRect&, const WebCore::IntSize&, Ref<ImageCallback>&&);
1261     void drawPagesToPDF(WebFrameProxy*, const PrintInfo&, uint32_t first, uint32_t count, Ref<DataCallback>&&);
1262     void drawToPDF(WebCore::FrameIdentifier, const Optional<WebCore::FloatRect>&, DrawToPDFCallback::CallbackFunction&&);
1263     void drawToPDFCallback(const IPC::DataReference& pdfData, WebKit::CallbackID);
1264 #if PLATFORM(IOS_FAMILY)
1265     uint32_t computePagesForPrintingAndDrawToPDF(WebCore::FrameIdentifier, const PrintInfo&, DrawToPDFCallback::CallbackFunction&&);
1266 #endif
1267 #elif PLATFORM(GTK)
1268     void drawPagesForPrinting(WebFrameProxy*, const PrintInfo&, Ref<PrintFinishedCallback>&&);
1269 #endif
1270
1271     PageLoadState& pageLoadState() { return m_pageLoadState; }
1272
1273 #if PLATFORM(COCOA)
1274     void handleAlternativeTextUIResult(const String& result);
1275 #endif
1276
1277     void saveDataToFileInDownloadsFolder(String&& suggestedFilename, String&& mimeType, URL&& originatingURL, API::Data&);
1278     void savePDFToFileInDownloadsFolder(String&& suggestedFilename, URL&& originatingURL, const IPC::DataReference&);
1279 #if PLATFORM(COCOA)
1280     void savePDFToTemporaryFolderAndOpenWithNativeApplication(const String& suggestedFilename, const String& originatingURLString, const IPC::DataReference&, const String& pdfUUID);
1281     void openPDFFromTemporaryFolderWithNativeApplication(const String& pdfUUID);
1282 #endif
1283
1284 #if ENABLE(PDFKIT_PLUGIN)
1285     void showPDFContextMenu(const WebKit::PDFContextMenu&, CompletionHandler<void(Optional<int32_t>&&)>&&);
1286 #endif
1287     WebCore::IntRect visibleScrollerThumbRect() const { return m_visibleScrollerThumbRect; }
1288
1289     uint64_t renderTreeSize() const { return m_renderTreeSize; }
1290
1291     void setMediaVolume(float);
1292     void setMuted(WebCore::MediaProducer::MutedStateFlags);
1293     void setMayStartMediaWhenInWindow(bool);
1294     bool mayStartMediaWhenInWindow() const { return m_mayStartMediaWhenInWindow; }
1295     void setMediaCaptureEnabled(bool);
1296     bool mediaCaptureEnabled() const { return m_mediaCaptureEnabled; }
1297     void stopMediaCapture();
1298
1299     void stopAllMediaPlayback();
1300     void suspendAllMediaPlayback();
1301     void resumeAllMediaPlayback();
1302
1303 #if ENABLE(MEDIA_SESSION)
1304     bool hasMediaSessionWithActiveMediaElements() const { return m_hasMediaSessionWithActiveMediaElements; }
1305     void handleMediaEvent(WebCore::MediaEventType);
1306     void setVolumeOfMediaElement(double, uint64_t);
1307 #endif
1308         
1309 #if ENABLE(POINTER_LOCK)
1310     void didAllowPointerLock();
1311     void didDenyPointerLock();
1312 #endif
1313
1314     // WebPopupMenuProxy::Client
1315     NativeWebMouseEvent* currentlyProcessedMouseDownEvent() override;
1316
1317     void setSuppressVisibilityUpdates(bool flag);
1318     bool suppressVisibilityUpdates() { return m_suppressVisibilityUpdates; }
1319
1320 #if PLATFORM(IOS_FAMILY)
1321     void willStartUserTriggeredZooming();
1322
1323     void potentialTapAtPosition(const WebCore::FloatPoint&, bool shouldRequestMagnificationInformation, uint64_t& requestID);
1324     void commitPotentialTap(OptionSet<WebKit::WebEvent::Modifier>, TransactionID layerTreeTransactionIdAtLastTouchStart, WebCore::PointerID);
1325     void cancelPotentialTap();
1326     void tapHighlightAtPosition(const WebCore::FloatPoint&, uint64_t& requestID);
1327     void handleTap(const WebCore::FloatPoint&, OptionSet<WebKit::WebEvent::Modifier>, TransactionID layerTreeTransactionIdAtLastTouchStart);
1328     void didRecognizeLongPress();
1329     void handleDoubleTapForDoubleClickAtPoint(const WebCore::IntPoint&, OptionSet<WebEvent::Modifier>, TransactionID layerTreeTransactionIdAtLastTouchStart);
1330
1331     void inspectorNodeSearchMovedToPosition(const WebCore::FloatPoint&);
1332     void inspectorNodeSearchEndedAtPosition(const WebCore::FloatPoint&);
1333
1334     void blurFocusedElement();
1335     void setIsShowingInputViewForFocusedElement(bool);
1336 #endif
1337
1338     void postMessageToInjectedBundle(const String& messageName, API::Object* messageBody);
1339
1340 #if ENABLE(INPUT_TYPE_COLOR)
1341     void setColorPickerColor(const WebCore::Color&);
1342     void endColorPicker();
1343 #endif
1344
1345     bool isLayerTreeFrozenDueToSwipeAnimation() const { return m_isLayerTreeFrozenDueToSwipeAnimation; }
1346
1347     WebCore::IntSize minimumSizeForAutoLayout() const { return m_minimumSizeForAutoLayout; }
1348     void setMinimumSizeForAutoLayout(const WebCore::IntSize&);
1349
1350     bool autoSizingShouldExpandToViewHeight() const { return m_autoSizingShouldExpandToViewHeight; }
1351     void setAutoSizingShouldExpandToViewHeight(bool);
1352
1353     void setViewportSizeForCSSViewportUnits(const WebCore::IntSize&);
1354     WebCore::IntSize viewportSizeForCSSViewportUnits() const { return m_viewportSizeForCSSViewportUnits.valueOr(WebCore::IntSize()); }
1355
1356     void didReceiveAuthenticationChallengeProxy(Ref<AuthenticationChallengeProxy>&&, NegotiatedLegacyTLS);
1357     void negotiatedLegacyTLS();
1358
1359     SpellDocumentTag spellDocumentTag();
1360
1361     void didFinishCheckingText(uint64_t requestID, const Vector<WebCore::TextCheckingResult>&);
1362     void didCancelCheckingText(uint64_t requestID);
1363         
1364     void setScrollPinningBehavior(WebCore::ScrollPinningBehavior);
1365     WebCore::ScrollPinningBehavior scrollPinningBehavior() const { return m_scrollPinningBehavior; }
1366
1367     void setOverlayScrollbarStyle(Optional<WebCore::ScrollbarOverlayStyle>);
1368     Optional<WebCore::ScrollbarOverlayStyle> overlayScrollbarStyle() const { return m_scrollbarOverlayStyle; }
1369
1370     // When the state of the window changes such that the WebPage needs immediate update, the UIProcess sends a new
1371     // ActivityStateChangeID to the WebProcess through the SetActivityState message. The UIProcess will wait till it
1372     // receives a CommitLayerTree which has an ActivityStateChangeID equal to or greater than the one it sent.
1373     ActivityStateChangeID takeNextActivityStateChangeID() { return ++m_currentActivityStateChangeID; }
1374
1375     bool shouldRecordNavigationSnapshots() const { return m_shouldRecordNavigationSnapshots; }
1376     void setShouldRecordNavigationSnapshots(bool shouldRecordSnapshots) { m_shouldRecordNavigationSnapshots = shouldRecordSnapshots; }
1377     void recordAutomaticNavigationSnapshot();
1378     void suppressNextAutomaticNavigationSnapshot() { m_shouldSuppressNextAutomaticNavigationSnapshot = true; }
1379     void recordNavigationSnapshot(WebBackForwardListItem&);
1380     void requestFocusedElementInformation(Function<void(const FocusedElementInformation&, CallbackBase::Error)>&&);
1381
1382 #if PLATFORM(COCOA) || PLATFORM(GTK)
1383     RefPtr<ViewSnapshot> takeViewSnapshot(Optional<WebCore::IntRect>&&);
1384 #endif
1385
1386 #if ENABLE(WEB_CRYPTO)
1387     void wrapCryptoKey(const Vector<uint8_t>&, CompletionHandler<void(bool, Vector<uint8_t>&&)>&&);
1388     void unwrapCryptoKey(const Vector<uint8_t>&, CompletionHandler<void(bool, Vector<uint8_t>&&)>&&);
1389 #endif
1390
1391     void signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String& challengeString, const URL&, CompletionHandler<void(String)>&&);
1392
1393     void takeSnapshot(WebCore::IntRect, WebCore::IntSize bitmapSize, SnapshotOptions, WTF::Function<void (const ShareableBitmap::Handle&, CallbackBase::Error)>&&);
1394
1395     void navigationGestureDidBegin();
1396     void navigationGestureWillEnd(bool willNavigate, WebBackForwardListItem&);
1397     void navigationGestureDidEnd(bool willNavigate, WebBackForwardListItem&);
1398     void navigationGestureDidEnd();
1399     void navigationGestureSnapshotWasRemoved();
1400     void willRecordNavigationSnapshot(WebBackForwardListItem&);
1401
1402     bool isShowingNavigationGestureSnapshot() const { return m_isShowingNavigationGestureSnapshot; }
1403
1404     bool isPlayingAudio() const { return !!(m_mediaState & WebCore::MediaProducer::IsPlayingAudio); }
1405     void isPlayingMediaDidChange(WebCore::MediaProducer::MediaStateFlags, uint64_t);
1406     void updatePlayingMediaDidChange(WebCore::MediaProducer::MediaStateFlags);
1407     bool isCapturingAudio() const { return m_mediaState & WebCore::MediaProducer::AudioCaptureMask; }
1408     bool isCapturingVideo() const { return m_mediaState & WebCore::MediaProducer::VideoCaptureMask; }
1409     bool hasActiveAudioStream() const { return m_mediaState & WebCore::MediaProducer::HasActiveAudioCaptureDevice; }
1410     bool hasActiveVideoStream() const { return m_mediaState & WebCore::MediaProducer::HasActiveVideoCaptureDevice; }
1411     WebCore::MediaProducer::MediaStateFlags mediaStateFlags() const { return m_mediaState; }
1412     WebCore::MediaProducer::MutedStateFlags mutedStateFlags() const { return m_mutedState; }
1413
1414     void handleAutoplayEvent(WebCore::AutoplayEvent, OptionSet<WebCore::AutoplayEventFlags>);
1415
1416     void videoControlsManagerDidChange();
1417     bool hasActiveVideoForControlsManager() const;
1418     void requestControlledElementID() const;
1419     void handleControlledElementIDResponse(const String&) const;
1420     bool isPlayingVideoInEnhancedFullscreen() const;
1421
1422 #if PLATFORM(COCOA)
1423     void requestActiveNowPlayingSessionInfo(Ref<NowPlayingInfoCallback>&&);
1424     void nowPlayingInfoCallback(bool, bool, const String&, double, double, uint64_t, CallbackID);
1425 #endif
1426
1427 #if ENABLE(MEDIA_SESSION)
1428     void hasMediaSessionWithActiveMediaElementsDidChange(bool);
1429     void mediaSessionMetadataDidChange(const WebCore::MediaSessionMetadata&);
1430     void focusedContentMediaElementDidChange(uint64_t);
1431 #endif
1432
1433 #if PLATFORM(MAC)
1434     API::HitTestResult* lastMouseMoveHitTestResult() const { return m_lastMouseMoveHitTestResult.get(); }
1435     void performImmediateActionHitTestAtLocation(WebCore::FloatPoint);
1436
1437     void immediateActionDidUpdate();
1438     void immediateActionDidCancel();
1439     void immediateActionDidComplete();
1440
1441     NSObject *immediateActionAnimationControllerForHitTestResult(RefPtr<API::HitTestResult>, uint64_t, RefPtr<API::Object>);
1442
1443     void handleAcceptedCandidate(WebCore::TextCheckingResult);
1444     void didHandleAcceptedCandidate();
1445
1446     void setHeaderBannerHeightForTesting(int);
1447     void setFooterBannerHeightForTesting(int);
1448 #endif
1449
1450     bool scrollingUpdatesDisabledForTesting();
1451
1452     void installActivityStateChangeCompletionHandler(Function<void()>&&);
1453
1454 #if USE(UNIFIED_TEXT_CHECKING)
1455     void checkTextOfParagraph(const String& text, OptionSet<WebCore::TextCheckingType> checkingTypes, int32_t insertionPoint, CompletionHandler<void(Vector<WebCore::TextCheckingResult>&&)>&&);
1456 #endif
1457     void getGuessesForWord(const String& word, const String& context, int32_t insertionPoint, CompletionHandler<void(Vector<String>&&)>&&);
1458
1459     void setShouldDispatchFakeMouseMoveEvents(bool);
1460
1461     // Diagnostic messages logging.
1462     void logDiagnosticMessage(const String& message, const String& description, WebCore::ShouldSample);
1463     void logDiagnosticMessageWithResult(const String& message, const String& description, uint32_t result, WebCore::ShouldSample);
1464     void logDiagnosticMessageWithValue(const String& message, const String& description, double value, unsigned significantFigures, WebCore::ShouldSample);
1465     void logDiagnosticMessageWithEnhancedPrivacy(const String& message, const String& description, WebCore::ShouldSample);
1466     void logDiagnosticMessageWithValueDictionary(const String& message, const String& description, const WebCore::DiagnosticLoggingClient::ValueDictionary&, WebCore::ShouldSample);
1467
1468     // Performance logging.
1469     void logScrollingEvent(uint32_t eventType, MonotonicTime, uint64_t);
1470
1471     // Form validation messages.
1472     void showValidationMessage(const WebCore::IntRect& anchorClientRect, const String& message);
1473     void hideValidationMessage();
1474 #if PLATFORM(COCOA)
1475     WebCore::ValidationBubble* validationBubble() const { return m_validationBubble.get(); } // For testing.
1476 #endif
1477
1478 #if PLATFORM(IOS_FAMILY)
1479     void setIsKeyboardAnimatingIn(bool isKeyboardAnimatingIn) { m_isKeyboardAnimatingIn = isKeyboardAnimatingIn; }
1480
1481     void setWaitingForPostLayoutEditorStateUpdateAfterFocusingElement(bool waitingForPostLayoutEditorStateUpdateAfterFocusingElement) { m_waitingForPostLayoutEditorStateUpdateAfterFocusingElement = waitingForPostLayoutEditorStateUpdateAfterFocusingElement; }
1482     bool waitingForPostLayoutEditorStateUpdateAfterFocusingElement() const { return m_waitingForPostLayoutEditorStateUpdateAfterFocusingElement; }
1483
1484     const Function<bool()>& deviceOrientationUserPermissionHandlerForTesting() const { return m_deviceOrientationUserPermissionHandlerForTesting; };
1485     void setDeviceOrientationUserPermissionHandlerForTesting(Function<bool()>&& handler) { m_deviceOrientationUserPermissionHandlerForTesting = WTFMove(handler); }
1486 #endif
1487
1488 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS_FAMILY)
1489     void addPlaybackTargetPickerClient(uint64_t);
1490     void removePlaybackTargetPickerClient(uint64_t);
1491     void showPlaybackTargetPicker(uint64_t, const WebCore::FloatRect&, bool hasVideo);
1492     void playbackTargetPickerClientStateDidChange(uint64_t, WebCore::MediaProducer::MediaStateFlags);
1493     void setMockMediaPlaybackTargetPickerEnabled(bool);
1494     void setMockMediaPlaybackTargetPickerState(const String&, WebCore::MediaPlaybackTargetContext::State);
1495     void mockMediaPlaybackTargetPickerDismissPopup();
1496
1497     // WebMediaSessionManagerClient
1498     void setPlaybackTarget(uint64_t, Ref<WebCore::MediaPlaybackTarget>&&) final;
1499     void externalOutputDeviceAvailableDidChange(uint64_t, bool) final;
1500     void setShouldPlayToPlaybackTarget(uint64_t, bool) final;
1501     void playbackTargetPickerWasDismissed(uint64_t) final;
1502     bool alwaysOnLoggingAllowed() final { return isAlwaysOnLoggingAllowed(); }
1503 #endif
1504
1505     void didChangeBackgroundColor();
1506     void didLayoutForCustomContentProvider();
1507
1508     // For testing
1509     void clearWheelEventTestMonitor();
1510     void callAfterNextPresentationUpdate(WTF::Function<void (CallbackBase::Error)>&&);
1511
1512     void didReachLayoutMilestone(OptionSet<WebCore::LayoutMilestone>);
1513
1514     void didRestoreScrollPosition();
1515
1516     void getLoadDecisionForIcon(const WebCore::LinkIcon&, WebKit::CallbackID);
1517     void finishedLoadingIcon(WebKit::CallbackID, const IPC::SharedBufferDataReference&);
1518
1519     void setFocus(bool focused);
1520     void setWindowFrame(const WebCore::FloatRect&);
1521     void getWindowFrame(Messages::WebPageProxy::GetWindowFrameDelayedReply&&);
1522     void getWindowFrameWithCallback(Function<void(WebCore::FloatRect)>&&);
1523
1524     WebCore::UserInterfaceLayoutDirection userInterfaceLayoutDirection();
1525     void setUserInterfaceLayoutDirection(WebCore::UserInterfaceLayoutDirection);
1526
1527     bool hasHadSelectionChangesFromUserInteraction() const { return m_hasHadSelectionChangesFromUserInteraction; }
1528
1529 #if HAVE(TOUCH_BAR)
1530     bool isTouchBarUpdateSupressedForHiddenContentEditable() const { return m_isTouchBarUpdateSupressedForHiddenContentEditable; }
1531     bool isNeverRichlyEditableForTouchBar() const { return m_isNeverRichlyEditableForTouchBar; }
1532 #endif
1533
1534     bool isAlwaysOnLoggingAllowed() const;
1535
1536 #if ENABLE(GAMEPAD)
1537     void gamepadActivity(const Vector<GamepadData>&, bool shouldMakeGamepadsVisible);
1538 #endif
1539
1540     void isLoadingChanged() { activityStateDidChange(WebCore::ActivityState::IsLoading); }
1541
1542     void clearUserMediaState();
1543
1544     void setShouldSkipWaitingForPaintAfterNextViewDidMoveToWindow(bool shouldSkip) { m_shouldSkipWaitingForPaintAfterNextViewDidMoveToWindow = shouldSkip; }
1545
1546     void setURLSchemeHandlerForScheme(Ref<WebURLSchemeHandler>&&, const String& scheme);
1547     WebURLSchemeHandler* urlSchemeHandlerForScheme(const String& scheme);
1548
1549 #if PLATFORM(COCOA)
1550     void createSandboxExtensionsIfNeeded(const Vector<String>& files, SandboxExtension::Handle& fileReadHandle, SandboxExtension::HandleArray& fileUploadHandles);
1551 #endif
1552     void editorStateChanged(const EditorState&);
1553     void updateEditorState(const EditorState&);
1554     void scheduleFullEditorStateUpdate();
1555     void dispatchDidUpdateEditorState();
1556
1557 #if HAVE(TOUCH_BAR)
1558     void touchBarMenuDataRemoved();
1559     void touchBarMenuDataChanged(const TouchBarMenuData&);
1560     void touchBarMenuItemDataAdded(const TouchBarMenuItemData&);
1561     void touchBarMenuItemDataRemoved(const TouchBarMenuItemData&);
1562 #endif
1563
1564 #if ENABLE(RESOURCE_LOAD_STATISTICS)
1565     void requestStorageAccessConfirm(const WebCore::RegistrableDomain& subFrameDomain, const WebCore::RegistrableDomain& topFrameDomain, WebCore::FrameIdentifier, CompletionHandler<void(bool)>&&);
1566     void didCommitCrossSiteLoadWithDataTransferFromPrevalentResource();
1567     void getPrevalentDomains(CompletionHandler<void(Vector<WebCore::RegistrableDomain>&&)>&&);
1568     void clearPrevalentDomains();
1569 #endif
1570
1571 #if ENABLE(DEVICE_ORIENTATION)
1572     void shouldAllowDeviceOrientationAndMotionAccess(WebCore::FrameIdentifier, FrameInfoData&&, bool mayPrompt, CompletionHandler<void(WebCore::DeviceOrientationOrMotionPermissionState)>&&);
1573 #endif
1574
1575     static WebPageProxy* nonEphemeralWebPageProxy();
1576
1577 #if ENABLE(ATTACHMENT_ELEMENT)
1578     RefPtr<API::Attachment> attachmentForIdentifier(const String& identifier) const;
1579     void insertAttachment(Ref<API::Attachment>&&, Function<void(CallbackBase::Error)>&&);
1580     void updateAttachmentAttributes(const API::Attachment&, Function<void(CallbackBase::Error)>&&);
1581     void serializedAttachmentDataForIdentifiers(const Vector<String>&, CompletionHandler<void(Vector<WebCore::SerializedAttachmentData>&&)>&&);
1582     void registerAttachmentIdentifier(const String&);
1583     void didInvalidateDataForAttachment(API::Attachment&);
1584
1585     enum class ShouldUpdateAttachmentAttributes : bool { No, Yes };
1586     ShouldUpdateAttachmentAttributes willUpdateAttachmentAttributes(const API::Attachment&);
1587 #endif
1588
1589 #if ENABLE(APPLICATION_MANIFEST)
1590     void getApplicationManifest(Function<void(const Optional<WebCore::ApplicationManifest>&, CallbackBase::Error)>&&);
1591 #endif
1592
1593     WebPreferencesStore preferencesStore() const;
1594
1595     void setDefersLoadingForTesting(bool);
1596
1597     bool isPageOpenedByDOMShowingInitialEmptyDocument() const;
1598
1599     WebCore::IntRect syncRootViewToScreen(const WebCore::IntRect& viewRect);
1600
1601 #if ENABLE(DATALIST_ELEMENT)
1602     void didSelectOption(const String&);
1603     void didCloseSuggestions();
1604 #endif
1605
1606     void updateCurrentModifierState();
1607
1608 #if HAVE(PENCILKIT)
1609     EditableImageController& editableImageController() { return *m_editableImageController; }
1610 #endif
1611
1612     ProvisionalPageProxy* provisionalPageProxy() const { return m_provisionalPage.get(); }
1613     void commitProvisionalPage(WebCore::FrameIdentifier, uint64_t navigationID, const String& mimeType, bool frameHasCustomContentProvider, uint32_t frameLoadType, const WebCore::CertificateInfo&, bool usedLegacyTLS, bool containsPluginDocument, Optional<WebCore::HasInsecureContent> forcedHasInsecureContent, const UserData&);
1614
1615     // Logic shared between the WebPageProxy and the ProvisionalPageProxy.
1616     void didStartProvisionalLoadForFrameShared(Ref<WebProcessProxy>&&, WebCore::FrameIdentifier, uint64_t navigationID, URL&&, URL&& unreachableURL, const UserData&);
1617     void didFailProvisionalLoadForFrameShared(Ref<WebProcessProxy>&&, WebCore::FrameIdentifier, FrameInfoData&& frameSecurityOrigin, uint64_t navigationID, const String& provisionalURL, const WebCore::ResourceError&, WebCore::WillContinueLoading, const UserData&);
1618     void didReceiveServerRedirectForProvisionalLoadForFrameShared(Ref<WebProcessProxy>&&, WebCore::FrameIdentifier, uint64_t navigationID, WebCore::ResourceRequest&&, const UserData&);
1619     void didPerformServerRedirectShared(Ref<WebProcessProxy>&&, const String& sourceURLString, const String& destinationURLString, WebCore::FrameIdentifier);
1620     void didPerformClientRedirectShared(Ref<WebProcessProxy>&&, const String& sourceURLString, const String& destinationURLString, WebCore::FrameIdentifier);
1621     void didNavigateWithNavigationDataShared(Ref<WebProcessProxy>&&, const WebNavigationDataStore&, WebCore::FrameIdentifier);
1622     void didChangeProvisionalURLForFrameShared(Ref<WebProcessProxy>&&, WebCore::FrameIdentifier, uint64_t navigationID, URL&&);
1623     void decidePolicyForNavigationActionAsyncShared(Ref<WebProcessProxy>&&, WebCore::PageIdentifier, WebCore::FrameIdentifier, FrameInfoData&&, WebCore::PolicyCheckIdentifier, uint64_t navigationID, NavigationActionData&&, FrameInfoData&& originatingFrameInfo, Optional<WebPageProxyIdentifier> originatingPageID, const WebCore::ResourceRequest& originalRequest, WebCore::ResourceRequest&&, IPC::FormDataReference&& requestBody, WebCore::ResourceResponse&& redirectResponse, const UserData&, uint64_t listenerID);
1624     void decidePolicyForResponseShared(Ref<WebProcessProxy>&&, WebCore::PageIdentifier, WebCore::FrameIdentifier, FrameInfoData&&, WebCore::PolicyCheckIdentifier, uint64_t navigationID, const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, bool canShowMIMEType, const String& downloadAttribute, uint64_t listenerID, const UserData&);
1625     void startURLSchemeTaskShared(Ref<WebProcessProxy>&&, WebCore::PageIdentifier, URLSchemeTaskParameters&&);
1626     void loadDataWithNavigationShared(Ref<WebProcessProxy>&&, WebCore::PageIdentifier, API::Navigation&, const IPC::DataReference&, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData, WebCore::ShouldTreatAsContinuingLoad, NavigatingToAppBoundDomain, NavigatedAwayFromAppBoundDomain, Optional<WebsitePoliciesData>&& = WTF::nullopt, WebCore::ShouldOpenExternalURLsPolicy = WebCore::ShouldOpenExternalURLsPolicy::ShouldNotAllow);
1627     void loadRequestWithNavigationShared(Ref<WebProcessProxy>&&, WebCore::PageIdentifier, API::Navigation&, WebCore::ResourceRequest&&, WebCore::ShouldOpenExternalURLsPolicy, API::Object* userData, WebCore::ShouldTreatAsContinuingLoad, NavigatingToAppBoundDomain, NavigatedAwayFromAppBoundDomain, Optional<WebsitePoliciesData>&& = WTF::nullopt);
1628     void backForwardGoToItemShared(Ref<WebProcessProxy>&&, const WebCore::BackForwardItemIdentifier&, CompletionHandler<void(SandboxExtension::Handle&&, const WebBackForwardListCounts&)>&&);
1629     void decidePolicyForNavigationActionSyncShared(Ref<WebProcessProxy>&&, WebCore::FrameIdentifier, bool isMainFrame, FrameInfoData&&, WebCore::PolicyCheckIdentifier, uint64_t navigationID, NavigationActionData&&, FrameInfoData&& originatingFrameInfo, Optional<WebPageProxyIdentifier> originatingPageID, const WebCore::ResourceRequest& originalRequest, WebCore::ResourceRequest&&, IPC::FormDataReference&& requestBody, WebCore::ResourceResponse&& redirectResponse, const UserData&, Messages::WebPageProxy::DecidePolicyForNavigationActionSyncDelayedReply&&);
1630 #if USE(QUICK_LOOK)
1631     void requestPasswordForQuickLookDocumentInMainFrameShared(const String& fileName, CompletionHandler<void(const String&)>&&);
1632 #endif
1633 #if ENABLE(CONTENT_FILTERING)
1634     void contentFilterDidBlockLoadForFrameShared(Ref<WebProcessProxy>&&, const WebCore::ContentFilterUnblockHandler&, WebCore::FrameIdentifier);
1635 #endif
1636
1637     void dumpAdClickAttribution(CompletionHandler<void(const String&)>&&);
1638     void clearAdClickAttribution(CompletionHandler<void()>&&);
1639     void setAdClickAttributionOverrideTimerForTesting(bool value, CompletionHandler<void()>&&);
1640     void setAdClickAttributionConversionURLForTesting(const URL&, CompletionHandler<void()>&&);
1641     void markAdClickAttributionsAsExpiredForTesting(CompletionHandler<void()>&&);
1642
1643 #if ENABLE(SPEECH_SYNTHESIS)
1644     void speechSynthesisVoiceList(CompletionHandler<void(Vector<WebSpeechSynthesisVoice>&&)>&&);
1645     void speechSynthesisSpeak(const String&, const String&, float volume, float rate, float pitch, MonotonicTime startTime, const String& voiceURI, const String& voiceName, const String& voiceLang, bool localService, bool defaultVoice, CompletionHandler<void()>&&);
1646     void speechSynthesisSetFinishedCallback(CompletionHandler<void()>&&);
1647     void speechSynthesisCancel();
1648     void speechSynthesisPause(CompletionHandler<void()>&&);
1649     void speechSynthesisResume(CompletionHandler<void()>&&);
1650 #endif
1651
1652     void configureLoggingChannel(const String&, WTFLogChannelState, WTFLogLevel);
1653
1654     void addObserver(WebViewDidMoveToWindowObserver&);
1655     void removeObserver(WebViewDidMoveToWindowObserver&);
1656     void webViewDidMoveToWindow();
1657
1658 #if HAVE(APP_SSO)
1659     void setShouldSuppressSOAuthorizationInAllNavigationPolicyDecision() { m_shouldSuppressSOAuthorizationInAllNavigationPolicyDecision = true; }
1660     void setShouldSuppressSOAuthorizationInNextNavigationPolicyDecision() { m_shouldSuppressSOAuthorizationInNextNavigationPolicyDecision = true; }
1661     void decidePolicyForSOAuthorizationLoad(const String&, CompletionHandler<void(SOAuthorizationLoadPolicy)>&&);
1662 #endif
1663
1664     Logger& logger();
1665
1666     // IPC::MessageReceiver
1667     // Implemented in generated WebPageProxyMessageReceiver.cpp
1668     void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override;
1669     void didReceiveSyncMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&) override;
1670
1671     void requestStorageSpace(WebCore::FrameIdentifier, const String& originIdentifier, const String& databaseName, const String& displayName, uint64_t currentQuota, uint64_t currentOriginUsage, uint64_t currentDatabaseUsage, uint64_t expectedUsage, WTF::CompletionHandler<void(uint64_t)>&&);
1672
1673     URL currentResourceDirectoryURL() const;
1674
1675 #if ENABLE(MEDIA_STREAM)
1676     void setMockCaptureDevicesEnabledOverride(Optional<bool>);
1677 #endif
1678
1679     void maybeInitializeSandboxExtensionHandle(WebProcessProxy&, const URL&, const URL& resourceDirectoryURL, SandboxExtension::Handle&, bool checkAssumedReadAccessToResourceURL = true);
1680
1681 #if ENABLE(WEB_AUTHN)
1682     void setMockWebAuthenticationConfiguration(WebCore::MockWebAuthenticationConfiguration&&);
1683 #endif
1684
1685     using TextManipulationItemCallback = WTF::Function<void (WebCore::TextManipulationController::ItemIdentifier, const Vector<WebCore::TextManipulationController::ManipulationToken>&)>;
1686     void startTextManipulations(const Vector<WebCore::TextManipulationController::ExclusionRule>&, TextManipulationItemCallback&&, WTF::CompletionHandler<void()>&&);
1687     void didFindTextManipulationItem(WebCore::TextManipulationController::ItemIdentifier, const Vector<WebCore::TextManipulationController::ManipulationToken>&);
1688     void completeTextManipulation(WebCore::TextManipulationController::ItemIdentifier, const Vector<WebCore::TextManipulationController::ManipulationToken>&,
1689         WTF::Function<void (WebCore::TextManipulationController::ManipulationResult)>&&);
1690
1691     const String& overriddenMediaType() const { return m_overriddenMediaType; }
1692     void setOverriddenMediaType(const String&);
1693
1694     void getProcessDisplayName(CompletionHandler<void(String&&)>&&);
1695
1696     void setOrientationForMediaCapture(uint64_t);
1697
1698     bool isHandlingPreventableTouchStart() const { return m_handlingPreventableTouchStartCount; }
1699
1700     bool hasQueuedKeyEvent() const;
1701     const NativeWebKeyboardEvent& firstQueuedKeyEvent() const;
1702
1703 #if PLATFORM(IOS)
1704     void grantAccessToAssetServices();
1705     void revokeAccessToAssetServices();
1706 #endif
1707
1708     void setIsNavigatingToAppBoundDomainTesting(bool, CompletionHandler<void()>&&);
1709
1710 private:
1711     WebPageProxy(PageClient&, WebProcessProxy&, Ref<API::PageConfiguration>&&);
1712     void platformInitialize();
1713
1714     void notifyProcessPoolToPrewarm();
1715     bool shouldUseBackForwardCache() const;
1716
1717     bool shouldUseForegroundPriorityForClientNavigation() const;
1718
1719     RefPtr<API::Navigation> goToBackForwardItem(WebBackForwardListItem&, WebCore::FrameLoadType);
1720
1721     void updateActivityState(OptionSet<WebCore::ActivityState::Flag> flagsToUpdate = WebCore::ActivityState::allFlags());
1722     void updateThrottleState();
1723     void updateHiddenPageThrottlingAutoIncreases();
1724
1725     bool suspendCurrentPageIfPossible(API::Navigation&, Optional<WebCore::FrameIdentifier> mainFrameID, ProcessSwapRequestedByClient, ShouldDelayClosingUntilEnteringAcceleratedCompositingMode);
1726
1727     enum class ResetStateReason {
1728         PageInvalidated,
1729         WebProcessExited,
1730         NavigationSwap,
1731     };
1732     void resetState(ResetStateReason);
1733     void resetStateAfterProcessExited(ProcessTerminationReason);
1734
1735     void setUserAgent(String&&);
1736
1737     // IPC::MessageSender
1738     bool sendMessage(std::unique_ptr<IPC::Encoder>, OptionSet<IPC::SendOption>, Optional<std::pair<CompletionHandler<void(IPC::Decoder*)>, uint64_t>>&&) override;
1739     IPC::Connection* messageSenderConnection() const override;
1740     uint64_t messageSenderDestinationID() const override;
1741
1742     // WebPopupMenuProxy::Client
1743     void valueChangedForPopupMenu(WebPopupMenuProxy*, int32_t newSelectedIndex) override;
1744     void setTextFromItemForPopupMenu(WebPopupMenuProxy*, int32_t index) override;
1745 #if PLATFORM(GTK)
1746     void failedToShowPopupMenu() override;
1747 #endif
1748
1749 #if ENABLE(POINTER_LOCK)
1750     void requestPointerLock();
1751     void requestPointerUnlock();
1752 #endif
1753
1754     void didCreateMainFrame(WebCore::FrameIdentifier);
1755     void didCreateSubframe(WebCore::FrameIdentifier);
1756     void didCreateWindow(WebCore::FrameIdentifier, WebCore::GlobalWindowIdentifier&&);
1757
1758     void didStartProvisionalLoadForFrame(WebCore::FrameIdentifier, uint64_t navigationID, URL&&, URL&& unreachableURL, const UserData&);
1759     void didReceiveServerRedirectForProvisionalLoadForFrame(WebCore::FrameIdentifier, uint64_t navigationID, WebCore::ResourceRequest&&, const UserData&);
1760     void willPerformClientRedirectForFrame(WebCore::FrameIdentifier, const String& url, double delay, WebCore::LockBackForwardList);
1761     void didCancelClientRedirectForFrame(WebCore::FrameIdentifier);
1762     void didChangeProvisionalURLForFrame(WebCore::FrameIdentifier, uint64_t navigationID, URL&&);
1763     void didFailProvisionalLoadForFrame(WebCore::FrameIdentifier, FrameInfoData&&, uint64_t navigationID, const String& provisionalURL, const WebCore::ResourceError&, WebCore::WillContinueLoading, const UserData&);
1764     void didCommitLoadForFrame(WebCore::FrameIdentifier, uint64_t navigationID, const String& mimeType, bool frameHasCustomContentProvider, uint32_t frameLoadType, const WebCore::CertificateInfo&, bool usedLegacyTLS, bool containsPluginDocument, Optional<WebCore::HasInsecureContent> forcedHasInsecureContent, const UserData&);
1765     void didFinishDocumentLoadForFrame(WebCore::FrameIdentifier, uint64_t navigationID, const UserData&);
1766     void didFinishLoadForFrame(WebCore::FrameIdentifier, uint64_t navigationID, const UserData&);
1767     void didFailLoadForFrame(WebCore::FrameIdentifier, uint64_t navigationID, const WebCore::ResourceError&, const UserData&);
1768     void didSameDocumentNavigationForFrame(WebCore::FrameIdentifier, uint64_t navigationID, uint32_t sameDocumentNavigationType, URL&&, const UserData&);
1769     void didChangeMainDocument(WebCore::FrameIdentifier);
1770     void didExplicitOpenForFrame(WebCore::FrameIdentifier, URL&&, String&& mimeType);
1771
1772     void didReceiveTitleForFrame(WebCore::FrameIdentifier, const String&, const UserData&);
1773     void didFirstLayoutForFrame(WebCore::FrameIdentifier, const UserData&);
1774     void didFirstVisuallyNonEmptyLayoutForFrame(WebCore::FrameIdentifier, const UserData&);
1775     void didDisplayInsecureContentForFrame(WebCore::FrameIdentifier, const UserData&);
1776     void didRunInsecureContentForFrame(WebCore::FrameIdentifier, const UserData&);
1777     void didDetectXSSForFrame(WebCore::FrameIdentifier, const UserData&);
1778     void mainFramePluginHandlesPageScaleGestureDidChange(bool);
1779     void frameDidBecomeFrameSet(WebCore::FrameIdentifier, bool);
1780     void didStartProgress();
1781     void didChangeProgress(double);
1782     void didFinishProgress();
1783     void setNetworkRequestsInProgress(bool);
1784
1785     void preconnectTo(const URL&);
1786
1787     void hasInsecureContent(CompletionHandler<void(WebCore::HasInsecureContent, WebCore::UsedLegacyTLS)>&&);
1788
1789     void didDestroyNavigation(uint64_t navigationID);
1790
1791     void decidePolicyForNavigationAction(Ref<WebProcessProxy>&&, WebFrameProxy&, FrameInfoData&&, uint64_t navigationID, NavigationActionData&&, FrameInfoData&& originatingFrameInfo,
1792         Optional<WebPageProxyIdentifier> originatingPageID, const WebCore::ResourceRequest& originalRequest, WebCore::ResourceRequest&&, IPC::FormDataReference&& requestBody,
1793         WebCore::ResourceResponse&& redirectResponse, const UserData&, Ref<PolicyDecisionSender>&&);
1794     void decidePolicyForNavigationActionAsync(WebCore::FrameIdentifier, FrameInfoData&&, WebCore::PolicyCheckIdentifier, uint64_t navigationID, NavigationActionData&&, FrameInfoData&& originatingFrameInfo,
1795         Optional<WebPageProxyIdentifier> originatingPageID, const WebCore::ResourceRequest& originalRequest, WebCore::ResourceRequest&&, IPC::FormDataReference&& requestBody,
1796         WebCore::ResourceResponse&& redirectResponse, const UserData&, uint64_t listenerID);
1797     void decidePolicyForNavigationActionSync(WebCore::FrameIdentifier, bool isMainFrame, FrameInfoData&&, WebCore::PolicyCheckIdentifier, uint64_t navigationID, NavigationActionData&&, FrameInfoData&& originatingFrameInfo,
1798         Optional<WebPageProxyIdentifier> originatingPageID, const WebCore::ResourceRequest& originalRequest, WebCore::ResourceRequest&&, IPC::FormDataReference&& requestBody,
1799         WebCore::ResourceResponse&& redirectResponse, const UserData&, Messages::WebPageProxy::DecidePolicyForNavigationActionSyncDelayedReply&&);
1800     void decidePolicyForNewWindowAction(WebCore::FrameIdentifier, FrameInfoData&&, WebCore::PolicyCheckIdentifier, NavigationActionData&&,
1801         WebCore::ResourceRequest&&, const String& frameName, uint64_t listenerID, const UserData&);
1802     void decidePolicyForResponse(WebCore::FrameIdentifier, FrameInfoData&&, WebCore::PolicyCheckIdentifier, uint64_t navigationID,
1803         const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, bool canShowMIMEType, const String& downloadAttribute, uint64_t listenerID, const UserData&);
1804     void unableToImplementPolicy(WebCore::FrameIdentifier, const WebCore::ResourceError&, const UserData&);
1805     void beginSafeBrowsingCheck(const URL&, bool, WebFramePolicyListenerProxy&);
1806
1807     WebContentMode effectiveContentModeAfterAdjustingPolicies(API::WebsitePolicies&, const WebCore::ResourceRequest&);
1808
1809     void willSubmitForm(WebCore::FrameIdentifier, WebCore::FrameIdentifier sourceFrameID, const Vector<std::pair<String, String>>& textFieldValues, uint64_t listenerID, const UserData&);
1810
1811     void contentRuleListNotification(URL&&, WebCore::ContentRuleListResults&&);
1812
1813     // History client
1814     void didNavigateWithNavigationData(const WebNavigationDataStore&, WebCore::FrameIdentifier);
1815     void didPerformClientRedirect(const String& sourceURLString, const String& destinationURLString, WebCore::FrameIdentifier);
1816     void didPerformServerRedirect(const String& sourceURLString, const String& destinationURLString, WebCore::FrameIdentifier);
1817     void didUpdateHistoryTitle(const String& title, const String& url, WebCore::FrameIdentifier);
1818
1819     // UI client
1820     void createNewPage(FrameInfoData&&, Optional<WebPageProxyIdentifier> originatingPageID, WebCore::ResourceRequest&&, WebCore::WindowFeatures&&, NavigationActionData&&, Messages::WebPageProxy::CreateNewPageDelayedReply&&);
1821     void showPage();
1822     void runJavaScriptAlert(WebCore::FrameIdentifier, WebKit::FrameInfoData&&, const String&, Messages::WebPageProxy::RunJavaScriptAlertDelayedReply&&);
1823     void runJavaScriptConfirm(WebCore::FrameIdentifier, WebKit::FrameInfoData&&, const String&, Messages::WebPageProxy::RunJavaScriptConfirmDelayedReply&&);
1824     void runJavaScriptPrompt(WebCore::FrameIdentifier, WebKit::FrameInfoData&&, const String&, const String&, Messages::WebPageProxy::RunJavaScriptPromptDelayedReply&&);
1825     void setStatusText(const String&);
1826     void mouseDidMoveOverElement(WebHitTestResultData&&, uint32_t modifiers, UserData&&);
1827
1828 #if ENABLE(NETSCAPE_PLUGIN_API)
1829     void unavailablePluginButtonClicked(uint32_t opaquePluginUnavailabilityReason, const String& mimeType, const String& pluginURLString, const String& pluginsPageURLString, const String& frameURLString, const String& pageURLString);
1830 #endif // ENABLE(NETSCAPE_PLUGIN_API)
1831 #if ENABLE(WEBGL)
1832     void webGLPolicyForURL(URL&&, Messages::WebPageProxy::WebGLPolicyForURLDelayedReply&&);
1833     void resolveWebGLPolicyForURL(URL&&, Messages::WebPageProxy::ResolveWebGLPolicyForURLDelayedReply&&);
1834 #endif // ENABLE(WEBGL)
1835     void setToolbarsAreVisible(bool toolbarsAreVisible);
1836     void getToolbarsAreVisible(Messages::WebPageProxy::GetToolbarsAreVisibleDelayedReply&&);
1837     void setMenuBarIsVisible(bool menuBarIsVisible);
1838     void getMenuBarIsVisible(Messages::WebPageProxy::GetMenuBarIsVisibleDelayedReply&&);
1839     void setStatusBarIsVisible(bool statusBarIsVisible);
1840     void getStatusBarIsVisible(Messages::WebPageProxy::GetStatusBarIsVisibleDelayedReply&&);
1841     void getIsViewVisible(bool&);
1842     void setIsResizable(bool isResizable);
1843     void screenToRootView(const WebCore::IntPoint& screenPoint, Messages::WebPageProxy::ScreenToRootViewDelayedReply&&);
1844     void rootViewToScreen(const WebCore::IntRect& viewRect, Messages::WebPageProxy::RootViewToScreenDelayedReply&&);
1845     void accessibilityScreenToRootView(const WebCore::IntPoint& screenPoint, CompletionHandler<void(WebCore::IntPoint)>&&);
1846     void rootViewToAccessibilityScreen(const WebCore::IntRect& viewRect, CompletionHandler<void(WebCore::IntRect)>&&);
1847     void runBeforeUnloadConfirmPanel(WebCore::FrameIdentifier, FrameInfoData&&, const String& message, Messages::WebPageProxy::RunBeforeUnloadConfirmPanelDelayedReply&&);
1848     void didChangeViewportProperties(const WebCore::ViewportAttributes&);
1849     void pageDidScroll();
1850     void runOpenPanel(WebCore::FrameIdentifier, FrameInfoData&&, const WebCore::FileChooserSettings&);
1851     void showShareSheet(const WebCore::ShareDataWithParsedURL&, ShareSheetCallbackID);
1852     void printFrame(WebCore::FrameIdentifier, CompletionHandler<void()>&&);
1853     void exceededDatabaseQuota(WebCore::FrameIdentifier, const String& originIdentifier, const String& databaseName, const String& displayName, uint64_t currentQuota, uint64_t currentOriginUsage, uint64_t currentDatabaseUsage, uint64_t expectedUsage, Messages::WebPageProxy::ExceededDatabaseQuotaDelayedReply&&);
1854     void reachedApplicationCacheOriginQuota(const String& originIdentifier, uint64_t currentQuota, uint64_t totalBytesNeeded, Messages::WebPageProxy::ReachedApplicationCacheOriginQuotaDelayedReply&&);
1855
1856     void requestGeolocationPermissionForFrame(uint64_t geolocationID, FrameInfoData&&);
1857     void revokeGeolocationAuthorizationToken(const String& authorizationToken);
1858
1859 #if PLATFORM(GTK) || PLATFORM(WPE)
1860     void sendMessageToWebView(UserMessage&&);
1861     void sendMessageToWebViewWithReply(UserMessage&&, CompletionHandler<void(UserMessage&&)>&&);
1862 #endif
1863
1864 #if ENABLE(MEDIA_STREAM)
1865     UserMediaPermissionRequestManagerProxy& userMediaPermissionRequestManager();
1866 #endif
1867     void requestUserMediaPermissionForFrame(uint64_t userMediaID, WebCore::FrameIdentifier, const WebCore::SecurityOriginData& userMediaDocumentOriginIdentifier, const WebCore::SecurityOriginData& topLevelDocumentOriginIdentifier, WebCore::MediaStreamRequest&&);
1868     void enumerateMediaDevicesForFrame(WebCore::FrameIdentifier, const WebCore::SecurityOriginData& userMediaDocumentOriginData, const WebCore::SecurityOriginData& topLevelDocumentOriginData, CompletionHandler<void(const Vector<WebCore::CaptureDevice>&, const String&)>&&);
1869     void beginMonitoringCaptureDevices();
1870
1871     void runModal();
1872     void notifyScrollerThumbIsVisibleInRect(const WebCore::IntRect&);
1873     void recommendedScrollbarStyleDidChange(int32_t newStyle);
1874     void didChangeScrollbarsForMainFrame(bool hasHorizontalScrollbar, bool hasVerticalScrollbar);
1875     void didChangeScrollOffsetPinningForMainFrame(bool pinnedToLeftSide, bool pinnedToRightSide, bool pinnedToTopSide, bool pinnedToBottomSide);
1876     void didChangePageCount(unsigned);
1877     void pageExtendedBackgroundColorDidChange(const WebCore::Color&);
1878 #if ENABLE(NETSCAPE_PLUGIN_API)
1879     void didFailToInitializePlugin(const String& mimeType, const String& frameURLString, const String& pageURLString);
1880     void didBlockInsecurePluginVersion(const String& mimeType, const String& pluginURLString, const String& frameURLString, const String& pageURLString, bool replacementObscured);
1881 #endif // ENABLE(NETSCAPE_PLUGIN_API)
1882     void setCanShortCircuitHorizontalWheelEvents(bool canShortCircuitHorizontalWheelEvents) { m_canShortCircuitHorizontalWheelEvents = canShortCircuitHorizontalWheelEvents; }
1883
1884     enum class ProcessLaunchReason {
1885         InitialProcess,
1886         ProcessSwap,
1887         Crash
1888     };
1889
1890     void launchProcess(const WebCore::RegistrableDomain&, ProcessLaunchReason);
1891     void swapToProvisionalPage(std::unique_ptr<ProvisionalPageProxy>);
1892     void didFailToSuspendAfterProcessSwap();
1893     void didSuspendAfterProcessSwap();
1894     void finishAttachingToWebProcess(ProcessLaunchReason);
1895
1896     RefPtr<API::Navigation> launchProcessForReload();
1897     RefPtr<API::Navigation> launchProcessWithItem(WebBackForwardListItem&);
1898
1899     void requestNotificationPermission(uint64_t notificationID, const String& originString);
1900     void showNotification(const String& title, const String& body, const String& iconURL, const String& tag, const String& lang, WebCore::NotificationDirection, const String& originString, uint64_t notificationID);
1901     void cancelNotification(uint64_t notificationID);
1902     void clearNotifications(const Vector<uint64_t>& notificationIDs);
1903     void didDestroyNotification(uint64_t notificationID);
1904
1905     void didChangeContentSize(const WebCore::IntSize&);
1906     void didChangeIntrinsicContentSize(const WebCore::IntSize&);
1907
1908 #if ENABLE(INPUT_TYPE_COLOR)
1909     void showColorPicker(const WebCore::Color& initialColor, const WebCore::IntRect&, Vector<WebCore::Color>&&);
1910     void didChooseColor(const WebCore::Color&) override;
1911     void didEndColorPicker() override;
1912 #endif
1913
1914 #if ENABLE(DATALIST_ELEMENT)
1915     void showDataListSuggestions(WebCore::DataListSuggestionInformation&&);
1916     void handleKeydownInDataList(const String&);
1917     void endDataListSuggestions();
1918 #endif
1919
1920     void closeOverlayedViews();
1921
1922     void compositionWasCanceled();
1923     void setHasHadSelectionChangesFromUserInteraction(bool);
1924
1925 #if HAVE(TOUCH_BAR)
1926     void setIsTouchBarUpdateSupressedForHiddenContentEditable(bool);
1927     void setIsNeverRichlyEditableForTouchBar(bool);
1928 #endif
1929
1930     void requestDOMPasteAccess(const WebCore::IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&);
1931
1932     // Back/Forward list management
1933     void backForwardAddItem(BackForwardListItemState&&);
1934     void backForwardGoToItem(const WebCore::BackForwardItemIdentifier&, CompletionHandler<void(SandboxExtension::Handle&&, const WebBackForwardListCounts&)>&&);
1935     void backForwardItemAtIndex(int32_t index, CompletionHandler<void(Optional<WebCore::BackForwardItemIdentifier>&&)>&&);
1936     void backForwardListCounts(Messages::WebPageProxy::BackForwardListCountsDelayedReply&&);
1937     void backForwardClear();
1938
1939     // Undo management
1940     void registerEditCommandForUndo(WebUndoStepID commandID, const String& label);
1941     void registerInsertionUndoGrouping();
1942     void clearAllEditCommands();
1943     void canUndoRedo(UndoOrRedo, CompletionHandler<void(bool)>&&);
1944     void executeUndoRedo(UndoOrRedo, CompletionHandler<void()>&&);
1945
1946     // Keyboard handling
1947 #if PLATFORM(COCOA)
1948     void executeSavedCommandBySelector(const String& selector, CompletionHandler<void(bool)>&&);
1949 #endif
1950
1951 #if PLATFORM(GTK)
1952     void getEditorCommandsForKeyEvent(const AtomString&, Vector<String>&);
1953 #endif
1954
1955 #if USE(ATK)
1956     void bindAccessibilityTree(const String&);
1957     void showEmojiPicker(const WebCore::IntRect&, CompletionHandler<void(String)>&&);
1958 #endif
1959
1960     // Popup Menu.
1961     void showPopupMenu(const WebCore::IntRect& rect, uint64_t textDirection, const Vector<WebPopupItem>& items, int32_t selectedIndex, const PlatformPopupMenuData&);
1962     void hidePopupMenu();
1963
1964 #if ENABLE(CONTEXT_MENUS)
1965     void showContextMenu(ContextMenuContextData&&, const UserData&);
1966 #endif
1967
1968 #if ENABLE(TELEPHONE_NUMBER_DETECTION)
1969 #if PLATFORM(MAC)
1970     void showTelephoneNumberMenu(const String& telephoneNumber, const WebCore::IntPoint&);
1971 #endif
1972 #endif
1973
1974     // Search popup results
1975     void saveRecentSearches(const String&, const Vector<WebCore::RecentSearch>&);
1976     void loadRecentSearches(const String&, CompletionHandler<void(Vector<WebCore::RecentSearch>&&)>&&);
1977
1978 #if PLATFORM(COCOA)
1979     // Speech.
1980     void getIsSpeaking(CompletionHandler<void(bool)>&&);
1981     void speak(const String&);
1982     void stopSpeaking();
1983
1984     // Spotlight.
1985     void searchWithSpotlight(const String&);
1986         
1987     void searchTheWeb(const String&);
1988
1989     // Dictionary.
1990     void didPerformDictionaryLookup(const WebCore::DictionaryPopupInfo&);
1991 #endif
1992
1993 #if PLATFORM(MAC)
1994     bool appleMailPaginationQuirkEnabled();
1995 #endif
1996
1997 #if PLATFORM(MAC)
1998     // FIXME: Need to support iOS too, but there is no isAppleMail for iOS.
1999     bool appleMailLinesClampEnabled();
2000 #endif
2001
2002     // Spelling and grammar.
2003     void checkSpellingOfString(const String& text, CompletionHandler<void(int32_t misspellingLocation, int32_t misspellingLength)>&&);
2004     void checkGrammarOfString(const String& text, CompletionHandler<void(Vector<WebCore::GrammarDetail>&&, int32_t badGrammarLocation, int32_t badGrammarLength)>&&);
2005     void spellingUIIsShowing(CompletionHandler<void(bool)>&&);
2006     void updateSpellingUIWithMisspelledWord(const String& misspelledWord);
2007     void updateSpellingUIWithGrammarString(const String& badGrammarPhrase, const WebCore::GrammarDetail&);
2008     void learnWord(const String& word);
2009     void ignoreWord(const String& word);
2010     void requestCheckingOfString(uint64_t requestID, const WebCore::TextCheckingRequestData&, int32_t insertionPoint);
2011
2012     void takeFocus(uint32_t direction);
2013     void setToolTip(const String&);
2014     void setCursor(const WebCore::Cursor&);
2015     void setCursorHiddenUntilMouseMoves(bool);
2016
2017     void didReceiveEvent(uint32_t opaqueType, bool handled);
2018
2019     void voidCallback(CallbackID);
2020     void dataCallback(const IPC::SharedBufferDataReference&, CallbackID);
2021     void imageCallback(const ShareableBitmap::Handle&, CallbackID);
2022     void boolCallback(bool result, CallbackID);
2023     void stringCallback(const String&, CallbackID);
2024     void invalidateStringCallback(CallbackID);
2025     void scriptValueCallback(const IPC::DataReference&, Optional<WebCore::ExceptionDetails>, CallbackID);
2026     void computedPagesCallback(const Vector<WebCore::IntRect>&, double totalScaleFactorForPrinting, const WebCore::FloatBoxExtent& computedPageMargin, CallbackID);
2027     void validateCommandCallback(const String&, bool, int, CallbackID);
2028     void unsignedCallback(uint64_t, CallbackID);
2029     void editingRangeCallback(const EditingRange&, CallbackID);
2030 #if ENABLE(APPLICATION_MANIFEST)
2031     void applicationManifestCallback(const Optional<WebCore::ApplicationManifest>&, CallbackID);
2032 #endif
2033     void rectForCharacterRangeCallback(const WebCore::IntRect&, const EditingRange&, CallbackID);
2034 #if PLATFORM(MAC)
2035     void attributedStringForCharacterRangeCallback(const AttributedString&, const EditingRange&, CallbackID);
2036     void fontAtSelectionCallback(const FontInfo&, double, bool, CallbackID);
2037 #endif
2038 #if PLATFORM(IOS_FAMILY)
2039     void gestureCallback(const WebCore::IntPoint&, uint32_t gestureType, uint32_t gestureState, uint32_t flags, CallbackID);
2040     void touchesCallback(const WebCore::IntPoint&, uint32_t touches, uint32_t flags, CallbackID);
2041     void selectionContextCallback(const String& selectedText, const String& beforeText, const String& afterText, CallbackID);
2042     void interpretKeyEvent(const EditorState&, bool isCharEvent, CompletionHandler<void(bool)>&&);
2043     void showPlaybackTargetPicker(bool hasVideo, const WebCore::IntRect& elementRect, WebCore::RouteSharingPolicy, const String&);
2044     void selectionRectsCallback(const Vector<WebCore::SelectionRect>&, CallbackID);
2045
2046     void updateStringForFind(const String&);
2047 #endif
2048 #if PLATFORM(GTK)
2049     void printFinishedCallback(const WebCore::ResourceError&, CallbackID);
2050 #endif
2051
2052     void focusedFrameChanged(const Optional<WebCore::FrameIdentifier>&);
2053     void frameSetLargestFrameChanged(const Optional<WebCore::FrameIdentifier>&);
2054
2055     void didFinishLoadingDataForCustomContentProvider(const String& suggestedFilename, const IPC::DataReference&);
2056
2057 #if PLATFORM(COCOA)
2058     void pluginFocusOrWindowFocusChanged(uint64_t pluginComplexTextInputIdentifier, bool pluginHasFocusAndWindowHasFocus);
2059     void setPluginComplexTextInputState(uint64_t pluginComplexTextInputIdentifier, uint64_t complexTextInputState);
2060 #endif
2061
2062 #if USE(AUTOMATIC_TEXT_REPLACEMENT)
2063     void toggleSmartInsertDelete();
2064     void toggleAutomaticQuoteSubstitution();
2065     void toggleAutomaticLinkDetection();
2066     void toggleAutomaticDashSubstitution();
2067     void toggleAutomaticTextReplacement();
2068 #endif
2069
2070 #if PLATFORM(MAC)
2071     void substitutionsPanelIsShowing(CompletionHandler<void(bool)>&&);
2072     void showCorrectionPanel(int32_t panelType, const WebCore::FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, const Vector<String>& alternativeReplacementStrings);
2073     void dismissCorrectionPanel(int32_t reason);
2074     void dismissCorrectionPanelSoon(int32_t reason, CompletionHandler<void(String)>&&);
2075     void recordAutocorrectionResponse(int32_t responseType, const String& replacedString, const String& replacementString);
2076
2077 #if USE(DICTATION_ALTERNATIVES)
2078     void showDictationAlternativeUI(const WebCore::FloatRect& boundingBoxOfDictatedText, uint64_t dictationContext);
2079     void removeDictationAlternatives(uint64_t dictationContext);
2080     void dictationAlternatives(uint64_t dictationContext, CompletionHandler<void(Vector<String>&&)>&&);
2081 #endif
2082
2083     void setEditableElementIsFocused(bool);
2084 #endif // PLATFORM(MAC)
2085
2086 #if PLATFORM(IOS_FAMILY)
2087     WebCore::FloatSize screenSize();
2088     WebCore::FloatSize availableScreenSize();
2089     WebCore::FloatSize overrideScreenSize();
2090     float textAutosizingWidth();
2091
2092     void couldNotRestorePageState();
2093     void restorePageState(Optional<WebCore::FloatPoint> scrollPosition, const WebCore::FloatPoint& scrollOrigin, const WebCore::FloatBoxExtent& obscuredInsetsOnSave, double scale);
2094     void restorePageCenterAndScale(Optional<WebCore::FloatPoint>, double scale);
2095
2096     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, bool nodeHasBuiltInClickHandling);
2097
2098     void elementDidFocus(const FocusedElementInformation&, bool userIsInteracting, bool blurPreviousNode, OptionSet<WebCore::ActivityState::Flag> activityStateChanges, const UserData&);
2099     void elementDidBlur();
2100     void updateInputContextAfterBlurringAndRefocusingElement();
2101     void focusedElementDidChangeInputMode(WebCore::InputMode);
2102     void didReleaseAllTouchPoints();
2103     void didUpdateEditorState();
2104
2105     void showInspectorHighlight(const WebCore::Highlight&);
2106     void hideInspectorHighlight();
2107
2108     void enableInspectorNodeSearch();
2109     void disableInspectorNodeSearch();
2110     void focusedElementInformationCallback(const FocusedElementInformation&, CallbackID);
2111 #else
2112     void didReleaseAllTouchPoints() { }
2113 #endif // PLATFORM(IOS_FAMILY)
2114
2115 #if ENABLE(DATA_DETECTION)
2116     RetainPtr<NSArray> m_dataDetectionResults;
2117 #endif
2118
2119     void clearLoadDependentCallbacks();
2120
2121     void performDragControllerAction(DragControllerAction, WebCore::DragData&, const String& dragStorageName, SandboxExtension::Handle&&, SandboxExtension::HandleArray&&);
2122
2123     void updateBackingStoreDiscardableState();
2124
2125     void setRenderTreeSize(uint64_t treeSize) { m_renderTreeSize = treeSize; }
2126
2127 #if PLATFORM(X11)
2128     void createPluginContainer(CompletionHandler<void(uint64_t)>&&);
2129     void windowedPluginGeometryDidChange(const WebCore::IntRect& frameRect, const WebCore::IntRect& clipRect, uint64_t windowID);
2130     void windowedPluginVisibilityDidChange(bool isVisible, uint64_t windowID);
2131 #endif
2132
2133     void processNextQueuedWheelEvent();
2134     void sendWheelEvent(const WebWheelEvent&);
2135     bool shouldProcessWheelEventNow(const WebWheelEvent&) const;
2136
2137 #if ENABLE(TOUCH_EVENTS)
2138     void updateTouchEventTracking(const WebTouchEvent&);
2139     WebCore::TrackingType touchEventTrackingType(const WebTouchEvent&) const;
2140 #endif
2141
2142 #if ENABLE(NETSCAPE_PLUGIN_API)
2143     void findPlugin(const String& mimeType, uint32_t processType, const String& urlString, const String& frameURLString, const String& pageURLString, bool allowOnlyApplicationPlugins, Messages::WebPageProxy::FindPluginDelayedReply&&);
2144 #endif
2145
2146 #if USE(QUICK_LOOK)
2147     void didStartLoadForQuickLookDocumentInMainFrame(const String& fileName, const String& uti);
2148     void didFinishLoadForQuickLookDocumentInMainFrame(const ShareableResource::Handle&);
2149     void requestPasswordForQuickLookDocumentInMainFrame(const String& fileName, CompletionHandler<void(const String&)>&&);
2150 #endif
2151
2152 #if ENABLE(CONTENT_FILTERING)
2153     void contentFilterDidBlockLoadForFrame(const WebCore::ContentFilterUnblockHandler&, WebCore::FrameIdentifier);
2154 #endif
2155
2156     void tryReloadAfterProcessTermination();
2157     void resetRecentCrashCountSoon();
2158     void resetRecentCrashCount();
2159
2160     API::DiagnosticLoggingClient* effectiveDiagnosticLoggingClient(WebCore::ShouldSample);
2161
2162     void dispatchActivityStateChange();
2163     void viewDidLeaveWindow();
2164     void viewDidEnterWindow();
2165
2166 #if PLATFORM(MAC)
2167     void didPerformImmediateActionHitTest(const WebHitTestResultData&, bool contentPreventsDefault, const UserData&);
2168 #endif
2169
2170     void useFixedLayoutDidChange(bool useFixedLayout) { m_useFixedLayout = useFixedLayout; }
2171     void fixedLayoutSizeDidChange(WebCore::IntSize fixedLayoutSize) { m_fixedLayoutSize = fixedLayoutSize; }
2172
2173     void imageOrMediaDocumentSizeChanged(const WebCore::IntSize&);
2174 #if ENABLE(VIDEO) && USE(GSTREAMER)
2175     void requestInstallMissingMediaPlugins(const String& details, const String& description);
2176 #endif
2177
2178     void startURLSchemeTask(URLSchemeTaskParameters&&);
2179     void stopURLSchemeTask(uint64_t handlerIdentifier, uint64_t taskIdentifier);
2180     void loadSynchronousURLSchemeTask(URLSchemeTaskParameters&&, Messages::WebPageProxy::LoadSynchronousURLSchemeTaskDelayedReply&&);
2181
2182     bool checkURLReceivedFromCurrentOrPreviousWebProcess(WebProcessProxy&, const String&);
2183     bool checkURLReceivedFromCurrentOrPreviousWebProcess(WebProcessProxy&, const URL&);
2184     void willAcquireUniversalFileReadSandboxExtension(WebProcessProxy&);
2185
2186     void handleAutoFillButtonClick(const UserData&);
2187
2188     void didResignInputElementStrongPasswordAppearance(const UserData&);
2189
2190     void handleMessage(IPC::Connection&, const String& messageName, const UserData& messageBody);
2191     void handleSynchronousMessage(IPC::Connection&, const String& messageName, const UserData& messageBody, CompletionHandler<void(UserData&&)>&&);
2192
2193     void viewIsBecomingVisible();
2194
2195     void stopAllURLSchemeTasks(WebProcessProxy* = nullptr);
2196
2197 #if ENABLE(ATTACHMENT_ELEMENT)
2198     void registerAttachmentIdentifierFromData(const String&, const String& contentType, const String& preferredFileName, const IPC::SharedBufferDataReference&);
2199     void registerAttachmentIdentifierFromFilePath(const String&, const String& contentType, const String& filePath);
2200     void registerAttachmentsFromSerializedData(Vector<WebCore::SerializedAttachmentData>&&);
2201     void cloneAttachmentData(const String& fromIdentifier, const String& toIdentifier);
2202
2203     void platformRegisterAttachment(Ref<API::Attachment>&&, const String& preferredFileName, const IPC::SharedBufferDataReference&);
2204     void platformRegisterAttachment(Ref<API::Attachment>&&, const String& filePath);
2205     void platformCloneAttachment(Ref<API::Attachment>&& fromAttachment, Ref<API::Attachment>&& toAttachment);
2206
2207     void didInsertAttachmentWithIdentifier(const String& identifier, const String& source, bool hasEnclosingImage);
2208     void didRemoveAttachmentWithIdentifier(const String& identifier);
2209     void didRemoveAttachment(API::Attachment&);
2210     Ref<API::Attachment> ensureAttachment(const String& identifier);
2211     void invalidateAllAttachments();
2212 #endif
2213
2214     void reportPageLoadResult(const WebCore::ResourceError& = { });
2215
2216     void continueNavigationInNewProcess(API::Navigation&, std::unique_ptr<SuspendedPageProxy>&&, Ref<WebProcessProxy>&&, ProcessSwapRequestedByClient, Optional<WebsitePoliciesData>&&);
2217
2218     void setNeedsFontAttributes(bool);
2219     void updateFontAttributesAfterEditorStateChange();
2220
2221     void didAttachToRunningProcess();
2222
2223 #if ENABLE(RESOURCE_LOAD_STATISTICS)
2224     void logFrameNavigation(const WebFrameProxy&, const URL& pageURL, const WebCore::ResourceRequest&, const URL& redirectURL, bool wasPotentiallyInitiatedByUser);
2225 #endif
2226
2227     // WebPaymentCoordinatorProxy::Client
2228 #if ENABLE(APPLE_PAY)
2229     IPC::Connection* paymentCoordinatorConnection(const WebPaymentCoordinatorProxy&) final;
2230     const String& paymentCoordinatorBoundInterfaceIdentifier(const WebPaymentCoordinatorProxy&) final;
2231     const String& paymentCoordinatorSourceApplicationBundleIdentifier(const WebPaymentCoordinatorProxy&) final;
2232     const String& paymentCoordinatorSourceApplicationSecondaryIdentifier(const WebPaymentCoordinatorProxy&) final;
2233     void paymentCoordinatorAddMessageReceiver(WebPaymentCoordinatorProxy&, const IPC::StringReference&, IPC::MessageReceiver&) final;
2234     void paymentCoordinatorRemoveMessageReceiver(WebPaymentCoordinatorProxy&, const IPC::StringReference&) final;
2235 #endif
2236 #if ENABLE(APPLE_PAY) && PLATFORM(IOS_FAMILY)
2237     UIViewController *paymentCoordinatorPresentingViewController(const WebPaymentCoordinatorProxy&) final;
2238     const String& paymentCoordinatorCTDataConnectionServiceType(const WebPaymentCoordinatorProxy&) final;
2239     std::unique_ptr<PaymentAuthorizationPresenter> paymentCoordinatorAuthorizationPresenter(WebPaymentCoordinatorProxy&, PKPaymentRequest *) final;
2240 #endif
2241 #if ENABLE(APPLE_PAY) && PLATFORM(MAC)
2242     NSWindow *paymentCoordinatorPresentingWindow(const WebPaymentCoordinatorProxy&) final;
2243 #endif
2244
2245 #if ENABLE(SPEECH_SYNTHESIS)
2246     void didStartSpeaking(WebCore::PlatformSpeechSynthesisUtterance&) override;
2247     void didFinishSpeaking(WebCore::PlatformSpeechSynthesisUtterance&) override;
2248     void didPauseSpeaking(WebCore::PlatformSpeechSynthesisUtterance&) override;
2249     void didResumeSpeaking(WebCore::PlatformSpeechSynthesisUtterance&) override;
2250     void speakingErrorOccurred(WebCore::PlatformSpeechSynthesisUtterance&) override;
2251     void boundaryEventOccurred(WebCore::PlatformSpeechSynthesisUtterance&, WebCore::SpeechBoundary, unsigned charIndex) override;
2252     void voicesDidChange() override;
2253
2254     struct SpeechSynthesisData;
2255     SpeechSynthesisData& speechSynthesisData();
2256     void resetSpeechSynthesizer();
2257 #endif
2258
2259 #if PLATFORM(IOS_FAMILY)
2260     static bool isInHardwareKeyboardMode();
2261     void clearAudibleActivity();
2262 #endif
2263
2264     void tryCloseTimedOut();
2265     void makeStorageSpaceRequest(WebCore::FrameIdentifier, const String& originIdentifier, const String& databaseName, const String& displayName, uint64_t currentQuota, uint64_t currentOriginUsage, uint64_t currentDatabaseUsage, uint64_t expectedUsage, CompletionHandler<void(uint64_t)>&&);
2266         
2267     bool isAppBoundDomain(const WebCore::RegistrableDomain&) const;
2268     bool isAppBoundDomain(const URL&) const;
2269     void setIsNavigatingToAppBoundDomain(bool isMainFrame, const URL&);
2270     NavigatingToAppBoundDomain isNavigatingToAppBoundDomain() const { return m_isNavigatingToAppBoundDomain; }
2271     NavigatedAwayFromAppBoundDomain hasNavigatedAwayFromAppBoundDomain() const { return m_hasNavigatedAwayFromAppBoundDomain; }
2272         
2273     const Identifier m_identifier;
2274     WebCore::PageIdentifier m_webPageID;
2275     WeakPtr<PageClient> m_pageClient;
2276     Ref<API::PageConfiguration> m_configuration;
2277
2278     std::unique_ptr<API::LoaderClient> m_loaderClient;
2279     std::unique_ptr<API::PolicyClient> m_policyClient;
2280     UniqueRef<API::NavigationClient> m_navigationClient;
2281     UniqueRef<API::HistoryClient> m_historyClient;
2282     std::unique_ptr<API::IconLoadingClient> m_iconLoadingClient;
2283     std::unique_ptr<API::FormClient> m_formClient;
2284     std::unique_ptr<API::UIClient> m_uiClient;
2285     std::unique_ptr<API::FindClient> m_findClient;
2286     std::unique_ptr<API::FindMatchesClient> m_findMatchesClient;
2287     std::unique_ptr<API::DiagnosticLoggingClient> m_diagnosticLoggingClient;
2288     std::unique_ptr<API::ResourceLoadClient> m_resourceLoadClient;
2289 #if ENABLE(CONTEXT_MENUS)
2290     std::unique_ptr<API::ContextMenuClient> m_contextMenuClient;
2291 #endif
2292     std::unique_ptr<API::InspectorClient> m_inspectorClient;
2293     std::unique_ptr<WebPageInjectedBundleClient> m_injectedBundleClient;
2294     std::unique_ptr<PageLoadState::Observer> m_pageLoadStateObserver;
2295
2296     std::unique_ptr<WebNavigationState> m_navigationState;
2297     String m_failingProvisionalLoadURL;
2298     bool m_isLoadingAlternateHTMLStringForFailingProvisionalLoad { false };
2299
2300     std::unique_ptr<DrawingAreaProxy> m_drawingArea;
2301 #if PLATFORM(COCOA)
2302     std::unique_ptr<RemoteLayerTreeHost> m_frozenRemoteLayerTreeHost;
2303 #if ENABLE(ASYNC_SCROLLING)
2304     std::unique_ptr<RemoteScrollingCoordinatorProxy> m_scrollingCoordinatorProxy;
2305 #endif
2306 #endif
2307     Ref<WebProcessProxy> m_process;
2308     Ref<WebPageGroup> m_pageGroup;
2309     Ref<WebPreferences> m_preferences;
2310
2311     Ref<WebUserContentControllerProxy> m_userContentController;
2312     Ref<VisitedLinkStore> m_visitedLinkStore;
2313     Ref<WebsiteDataStore> m_websiteDataStore;
2314
2315     RefPtr<WebFrameProxy> m_mainFrame;
2316
2317     RefPtr<WebFrameProxy> m_focusedFrame;
2318     RefPtr<WebFrameProxy> m_frameSetLargestFrame;
2319
2320     String m_userAgent;
2321     String m_applicationNameForUserAgent;
2322     String m_applicationNameForDesktopUserAgent;
2323     String m_customUserAgent;
2324     String m_customTextEncodingName;
2325     String m_overrideContentSecurityPolicy;
2326
2327     RefPtr<WebInspectorProxy> m_inspector;
2328
2329 #if ENABLE(FULLSCREEN_API)
2330     std::unique_ptr<WebFullScreenManagerProxy> m_fullScreenManager;
2331     std::unique_ptr<API::FullscreenClient> m_fullscreenClient;
2332 #endif
2333
2334 #if (PLATFORM(IOS_FAMILY) && HAVE(AVKIT)) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
2335     RefPtr<PlaybackSessionManagerProxy> m_playbackSessionManager;
2336     RefPtr<VideoFullscreenManagerProxy> m_videoFullscreenManager;
2337 #endif
2338
2339 #if PLATFORM(IOS_FAMILY)
2340     Optional<WebCore::InputMode> m_pendingInputModeChange;
2341     TransactionID m_firstLayerTreeTransactionIdAfterDidCommitLoad;
2342     int32_t m_deviceOrientation { 0 };
2343     bool m_hasReceivedLayerTreeTransactionAfterDidCommitLoad { true };
2344     bool m_hasNetworkRequestsOnSuspended { false };
2345     bool m_isKeyboardAnimatingIn { false };
2346     bool m_isScrollingOrZooming { false };
2347 #endif
2348
2349 #if ENABLE(UI_SIDE_COMPOSITING)
2350     VisibleContentRectUpdateInfo m_lastVisibleContentRectUpdate;
2351 #endif
2352
2353 #if PLATFORM(MAC)
2354     bool m_useSystemAppearance { false };
2355 #endif
2356
2357 #if ENABLE(APPLE_PAY)
2358     std::unique_ptr<WebPaymentCoordinatorProxy> m_paymentCoordinator;
2359 #endif
2360
2361 #if USE(SYSTEM_PREVIEW)
2362     std::unique_ptr<SystemPreviewController> m_systemPreviewController;
2363 #endif
2364
2365 #if ENABLE(WEB_AUTHN)
2366     std::unique_ptr<WebAuthenticatorCoordinatorProxy> m_credentialsMessenger;
2367 #endif
2368
2369     CallbackMap m_callbacks;
2370     HashSet<CallbackID> m_loadDependentStringCallbackIDs;
2371
2372     HashSet<WebEditCommandProxy*> m_editCommandSet;
2373
2374 #if PLATFORM(COCOA)
2375     HashSet<String> m_knownKeypressCommandNames;
2376 #endif
2377
2378     RefPtr<WebPopupMenuProxy> m_activePopupMenu;
2379 #if ENABLE(CONTEXT_MENUS)
2380     RefPtr<WebContextMenuProxy> m_activeContextMenu;
2381     ContextMenuContextData m_activeContextMenuContextData;
2382 #endif
2383     RefPtr<API::HitTestResult> m_lastMouseMoveHitTestResult;
2384
2385     RefPtr<WebOpenPanelResultListenerProxy> m_openPanelResultListener;
2386     GeolocationPermissionRequestManagerProxy m_geolocationPermissionRequestManager;
2387     NotificationPermissionRequestManagerProxy m_notificationPermissionRequestManager;
2388
2389 #if ENABLE(MEDIA_STREAM)
2390     std::unique_ptr<UserMediaPermissionRequestManagerProxy> m_userMediaPermissionRequestManager;
2391 #endif
2392
2393     OptionSet<WebCore::ActivityState::Flag> m_activityState;
2394     bool m_viewWasEverInWindow { false };
2395 #if PLATFORM(IOS_FAMILY)
2396     bool m_allowsMediaDocumentInlinePlayback { false };
2397     bool m_alwaysRunsAtForegroundPriority { false };
2398     std::unique_ptr<ProcessThrottler::ForegroundActivity> m_isVisibleActivity;
2399     std::unique_ptr<ProcessThrottler::ForegroundActivity> m_isAudibleActivity;
2400     std::unique_ptr<ProcessThrottler::ForegroundActivity> m_isCapturingActivity;
2401     std::unique_ptr<ProcessThrottler::ForegroundActivity> m_alwaysRunsAtForegroundPriorityActivity;
2402     RunLoop::Timer<WebPageProxy> m_audibleActivityTimer;
2403 #endif
2404     bool m_initialCapitalizationEnabled { false };
2405     Optional<double> m_cpuLimit;
2406     Ref<WebBackForwardList> m_backForwardList;
2407         
2408     bool m_maintainsInactiveSelection { false };
2409
2410     bool m_waitsForPaintAfterViewDidMoveToWindow { false };
2411     bool m_shouldSkipWaitingForPaintAfterNextViewDidMoveToWindow { false };
2412
2413     String m_toolTip;
2414
2415     EditorState m_editorState;
2416     bool m_isEditable { false };
2417
2418 #if HAVE(TOUCH_BAR)
2419     TouchBarMenuData m_touchBarMenuData;
2420 #endif
2421
2422     double m_textZoomFactor { 1 };
2423     double m_pageZoomFactor { 1 };
2424     double m_pageScaleFactor { 1 };
2425     double m_pluginZoomFactor { 1 };
2426     double m_pluginScaleFactor { 1 };
2427     double m_viewScaleFactor { 1 };
2428     float m_intrinsicDeviceScaleFactor { 1 };
2429     Optional<float> m_customDeviceScaleFactor;
2430     float m_topContentInset { 0 };
2431
2432     LayerHostingMode m_layerHostingMode { LayerHostingMode::InProcess };
2433
2434     WebCore::Color m_underlayColor;
2435     WebCore::Color m_pageExtendedBackgroundColor;
2436
2437     bool m_useFixedLayout { false };
2438     WebCore::IntSize m_fixedLayoutSize;
2439
2440     bool m_alwaysShowsHorizontalScroller { false };
2441     bool m_alwaysShowsVerticalScroller { false };
2442
2443     OptionSet<WebCore::LayoutMilestone> m_observedLayoutMilestones;
2444
2445     bool m_suppressScrollbarAnimations { false };
2446
2447     WebCore::Pagination::Mode m_paginationMode { WebCore::Pagination::Unpaginated };
2448     bool m_paginationBehavesLikeColumns { false };
2449     double m_pageLength { 0 };
2450     double m_gapBetweenPages { 0 };
2451     bool m_paginationLineGridEnabled { false };
2452         
2453     // If the process backing the web page is alive and kicking.
2454     bool m_hasRunningProcess { false };
2455
2456     // Whether WebPageProxy::close() has been called on this page.
2457     bool m_isClosed { false };
2458
2459     // Whether it can run modal child web pages.
2460     bool m_canRunModal { false };
2461
2462     bool m_isInPrintingMode { false };
2463     bool m_isPerformingDOMPrintOperation { false };
2464
2465     WebCore::ResourceRequest m_decidePolicyForResponseRequest;
2466     bool m_shouldSuppressAppLinksInNextNavigationPolicyDecision { false };
2467
2468 #if HAVE(APP_SSO)
2469     bool m_shouldSuppressSOAuthorizationInNextNavigationPolicyDecision { false };
2470     bool m_shouldSuppressSOAuthorizationInAllNavigationPolicyDecision { false };
2471 #endif
2472
2473     Deque<NativeWebMouseEvent> m_mouseEventQueue;
2474     Deque<NativeWebKeyboardEvent> m_keyEventQueue;
2475     Deque<NativeWebWheelEvent> m_wheelEventQueue;
2476     Deque<std::unique_ptr<Vector<NativeWebWheelEvent>>> m_currentlyProcessedWheelEvents;
2477 #if ENABLE(MAC_GESTURE_EVENTS)
2478     Deque<NativeWebGestureEvent> m_gestureEventQueue;
2479 #endif
2480     Vector<WTF::Function<void ()>> m_callbackHandlersAfterProcessingPendingMouseEvents;
2481
2482 #if ENABLE(TOUCH_EVENTS)
2483     struct TouchEventTracking {
2484         WebCore::TrackingType touchForceChangedTracking { WebCore::TrackingType::NotTracking };
2485         WebCore::TrackingType touchStartTracking { WebCore::TrackingType::NotTracking };
2486         WebCore::TrackingType touchMoveTracking { WebCore::TrackingType::NotTracking };
2487         WebCore::TrackingType touchEndTracking { WebCore::TrackingType::NotTracking };
2488
2489         bool isTrackingAnything() const
2490         {
2491             return touchForceChangedTracking != WebCore::TrackingType::NotTracking
2492                 || touchStartTracking != WebCore::TrackingType::NotTracking
2493                 || touchMoveTracking != WebCore::TrackingType::NotTracking
2494                 || touchEndTracking != WebCore::TrackingType::NotTracking;
2495         }
2496
2497         void reset()
2498         {
2499             touchForceChangedTracking = WebCore::TrackingType::NotTracking;
2500             touchStartTracking = WebCore::TrackingType::NotTracking;
2501             touchMoveTracking = WebCore::TrackingType::NotTracking;
2502             touchEndTracking = WebCore::TrackingType::NotTracking;
2503         }
2504     };
2505     TouchEventTracking m_touchAndPointerEventTracking;
2506 #endif
2507 #if ENABLE(TOUCH_EVENTS) && !ENABLE(IOS_TOUCH_EVENTS)
2508     Deque<QueuedTouchEvents> m_touchEventQueue;
2509 #endif
2510
2511     bool m_handledSynchronousTouchEventWhileDispatchingPreventableTouchStart { false };
2512     uint64_t m_handlingPreventableTouchStartCount { 0 };
2513
2514 #if ENABLE(INPUT_TYPE_COLOR)
2515     RefPtr<WebColorPicker> m_colorPicker;
2516 #endif
2517 #if ENABLE(DATALIST_ELEMENT)
2518     RefPtr<WebDataListSuggestionsDropdown> m_dataListSuggestionsDropdown;
2519 #endif
2520 #if PLATFORM(COCOA)
2521     RefPtr<WebCore::ValidationBubble> m_validationBubble;
2522 #endif
2523
2524     bool m_isPageSuspended { false };
2525     bool m_addsVisitedLinks { true };
2526
2527     bool m_controlledByAutomation { false };
2528
2529     unsigned m_inspectorFrontendCount { 0 };
2530
2531 #if PLATFORM(COCOA)
2532     bool m_isSmartInsertDeleteEnabled { false };
2533 #endif
2534
2535     Optional<WebCore::Color> m_backgroundColor;
2536
2537     unsigned m_pendingLearnOrIgnoreWordMessageCount { 0 };
2538
2539     bool m_mainFrameHasCustomContentProvider { false };
2540
2541 #if ENABLE(DRAG_SUPPORT)
2542     // Current drag destination details are delivered as an asynchronous response,
2543     // so we preserve them to be used when the next dragging delegate call is made.
2544     WebCore::DragOperation m_currentDragOperation { WebCore::DragOperationNone };
2545     WebCore::DragHandlingMethod m_currentDragHandlingMethod { WebCore::DragHandlingMethod::None };
2546     bool m_currentDragIsOverFileInput { false };
2547     unsigned m_currentDragNumberOfFilesToBeAccepted { 0 };
2548     WebCore::IntRect m_currentDragCaretRect;
2549     WebCore::IntRect m_currentDragCaretEditableElementRect;
2550 #endif
2551
2552     PageLoadState m_pageLoadState;
2553     
2554     bool m_delegatesScrolling { false };
2555
2556     bool m_mainFrameHasHorizontalScrollbar { false };
2557     bool m_mainFrameHasVerticalScrollbar { false };
2558
2559     // Whether horizontal wheel events can be handled directly for swiping purposes.
2560     bool m_canShortCircuitHorizontalWheelEvents { true };
2561
2562     bool m_mainFrameIsPinnedToLeftSide { true };
2563     bool m_mainFrameIsPinnedToRightSide { true };
2564     bool m_mainFrameIsPinnedToTopSide { true };
2565     bool m_mainFrameIsPinnedToBottomSide { true };
2566
2567     bool m_shouldUseImplicitRubberBandControl { false };
2568     bool m_rubberBandsAtLeft { true };
2569     bool m_rubberBandsAtRight { true };
2570     bool m_rubberBandsAtTop { true };
2571     bool m_rubberBandsAtBottom { true };
2572         
2573     bool m_enableVerticalRubberBanding { true };
2574     bool m_enableHorizontalRubberBanding { true };
2575
2576     bool m_backgroundExtendsBeyondPage { true };
2577
2578     bool m_shouldRecordNavigationSnapshots { false };
2579     bool m_isShowingNavigationGestureSnapshot { false };
2580
2581     bool m_mainFramePluginHandlesPageScaleGesture { false };
2582
2583     unsigned m_pageCount { 0 };
2584
2585     WebCore::IntRect m_visibleScrollerThumbRect;
2586
2587     uint64_t m_renderTreeSize { 0 };
2588     uint64_t m_sessionRestorationRenderTreeSize { 0 };
2589     bool m_hitRenderTreeSizeThreshold { false };
2590
2591     bool m_suppressVisibilityUpdates { false };
2592     bool m_autoSizingShouldExpandToViewHeight { false };
2593     WebCore::IntSize m_minimumSizeForAutoLayout;
2594     Optional<WebCore::IntSize> m_viewportSizeForCSSViewportUnits;
2595
2596     // Visual viewports
2597     WebCore::LayoutSize m_baseLayoutViewportSize;
2598     WebCore::LayoutPoint m_minStableLayoutViewportOrigin;
2599     WebCore::LayoutPoint m_maxStableLayoutViewportOrigin;
2600
2601     float m_mediaVolume { 1 };
2602     WebCore::MediaProducer::MutedStateFlags m_mutedState { WebCore::MediaProducer::NoneMuted };
2603     bool m_mayStartMediaWhenInWindow { true };
2604     bool m_mediaPlaybackIsSuspended { false };
2605     bool m_mediaCaptureEnabled { true };
2606
2607     bool m_waitingForDidUpdateActivityState { false };
2608
2609     bool m_shouldScaleViewToFitDocument { false };
2610     bool m_shouldSuppressNextAutomaticNavigationSnapshot { false };
2611
2612 #if PLATFORM(COCOA)
2613     using TemporaryPDFFileMap = HashMap<String, String>;
2614     TemporaryPDFFileMap m_temporaryPDFFiles;
2615     std::unique_ptr<WebCore::RunLoopObserver> m_activityStateChangeDispatcher;
2616
2617     std::unique_ptr<RemoteLayerTreeScrollingPerformanceData> m_scrollingPerformanceData;
2618     bool m_scrollPerformanceDataCollectionEnabled { false };
2619 #endif
2620     UserObservablePageCounter::Token m_pageIsUserObservableCount;
2621     ProcessSuppressionDisabledToken m_preventProcessSuppressionCount;
2622     HiddenPageThrottlingAutoIncreasesCounter::Token m_hiddenPageDOMTimerThrottlingAutoIncreasesCount;
2623     VisibleWebPageToken m_visiblePageToken;
2624         
2625     WebCore::ScrollPinningBehavior m_scrollPinningBehavior { WebCore::DoNotPin };
2626     Optional<WebCore::ScrollbarOverlayStyle> m_scrollbarOverlayStyle;
2627
2628     ActivityStateChangeID m_currentActivityStateChangeID { ActivityStateChangeAsynchronous };
2629
2630     WebPreferencesStore::ValueMap m_configurationPreferenceValues;
2631     OptionSet<WebCore::ActivityState::Flag> m_potentiallyChangedActivityStateFlags;
2632     bool m_activityStateChangeWantsSynchronousReply { false };
2633     Vector<CallbackID> m_nextActivityStateChangeCallbacks;
2634
2635     WebCore::MediaProducer::MediaStateFlags m_mediaState { WebCore::MediaProducer::IsNotPlaying };
2636
2637     bool m_hasHadSelectionChangesFromUserInteraction { false };
2638
2639 #if HAVE(TOUCH_BAR)
2640     bool m_isTouchBarUpdateSupressedForHiddenContentEditable { false };
2641     bool m_isNeverRichlyEditableForTouchBar { false };
2642 #endif
2643
2644 #if ENABLE(MEDIA_SESSION)
2645     bool m_hasMediaSessionWithActiveMediaElements { false };
2646 #endif
2647
2648 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS_FAMILY)
2649     bool m_requiresTargetMonitoring { false };
2650 #endif
2651
2652 #if ENABLE(META_VIEWPORT)
2653     bool m_forceAlwaysUserScalable { false };
2654     WebCore::FloatSize m_viewportConfigurationViewLayoutSize;
2655     double m_viewportConfigurationLayoutSizeScaleFactor { 1 };
2656     double m_viewportConfigurationMinimumEffectiveDeviceWidth { 0 };
2657     Optional<WebCore::ViewportArguments> m_overrideViewportArguments;
2658 #endif
2659
2660 #if PLATFORM(IOS_FAMILY)
2661     Function<bool()> m_deviceOrientationUserPermissionHandlerForTesting;
2662     std::unique_ptr<ElementDidFocusArguments> m_deferredElementDidFocusArguments;
2663     bool m_waitingForPostLayoutEditorStateUpdateAfterFocusingElement { false };
2664     WebCore::FloatSize m_maximumUnobscuredSize;
2665     bool m_lastObservedStateWasBackground { false };
2666 #endif
2667
2668     Optional<WebCore::FontAttributes> m_cachedFontAttributesAtSelectionStart;
2669
2670 #if ENABLE(POINTER_LOCK)
2671     bool m_isPointerLockPending { false };
2672     bool m_isPointerLocked { false };
2673 #endif
2674
2675     bool m_isUsingHighPerformanceWebGL { false };
2676     bool m_openedByDOM { false };
2677     bool m_hasCommittedAnyProvisionalLoads { false };
2678     bool m_preferFasterClickOverDoubleTap { false };
2679
2680     HashMap<String, Ref<WebURLSchemeHandler>> m_urlSchemeHandlersByScheme;
2681     HashMap<uint64_t, Ref<WebURLSchemeHandler>> m_urlSchemeHandlersByIdentifier;
2682
2683 #if ENABLE(ATTACHMENT_ELEMENT)
2684     using IdentifierToAttachmentMap = HashMap<String, Ref<API::Attachment>>;
2685     IdentifierToAttachmentMap m_attachmentIdentifierToAttachmentMap;
2686 #endif
2687
2688     const std::unique_ptr<WebPageInspectorController> m_inspectorController;
2689 #if ENABLE(REMOTE_INSPECTOR)
2690     std::unique_ptr<WebPageDebuggable> m_inspectorDebuggable;
2691 #endif
2692
2693     Optional<SpellDocumentTag> m_spellDocumentTag;
2694
2695     Optional<MonotonicTime> m_pageLoadStart;
2696     HashSet<String> m_previouslyVisitedPaths;
2697
2698     RunLoop::Timer<WebPageProxy> m_resetRecentCrashCountTimer;
2699     unsigned m_recentCrashCount { 0 };
2700
2701     bool m_needsFontAttributes { false };
2702     bool m_mayHaveUniversalFileReadSandboxExtension { false };
2703
2704     RunLoop::Timer<WebPageProxy> m_tryCloseTimeoutTimer;
2705
2706     std::unique_ptr<ProvisionalPageProxy> m_provisionalPage;
2707     std::unique_ptr<SuspendedPageProxy> m_suspendedPageKeptToPreventFlashing;
2708     WeakPtr<SuspendedPageProxy> m_lastSuspendedPage;
2709
2710     TextManipulationItemCallback m_textManipulationItemCallback;
2711
2712 #if HAVE(PENCILKIT)
2713     std::unique_ptr<EditableImageController> m_editableImageController;
2714 #endif
2715
2716 #if HAVE(VISIBILITY_PROPAGATION_VIEW)
2717     LayerHostingContextID m_contextIDForVisibilityPropagation { 0 };
2718 #endif
2719
2720     HashMap<WebViewDidMoveToWindowObserver*, WeakPtr<WebViewDidMoveToWindowObserver>> m_webViewDidMoveToWindowObservers;
2721
2722     mutable RefPtr<Logger> m_logger;
2723
2724 #if ENABLE(SPEECH_SYNTHESIS)
2725     struct SpeechSynthesisData {
2726         std::unique_ptr<WebCore::PlatformSpeechSynthesizer> synthesizer;
2727         RefPtr<WebCore::PlatformSpeechSynthesisUtterance> utterance;
2728         CompletionHandler<void()> speakingStartedCompletionHandler;
2729         CompletionHandler<void()> speakingFinishedCompletionHandler;
2730         CompletionHandler<void()> speakingPausedCompletionHandler;
2731         CompletionHandler<void()> speakingResumedCompletionHandler;
2732     };
2733     Optional<SpeechSynthesisData> m_speechSynthesisData;
2734 #endif
2735 #if USE(DIRECT2D)
2736     COMPtr<ID3D11Device1> m_device;
2737 #endif
2738     bool m_isQuotaIncreaseDenied { false };
2739     bool m_isLayerTreeFrozenDueToSwipeAnimation { false };
2740     
2741     String m_overriddenMediaType;
2742
2743     struct InjectedBundleMessage {
2744         String messageName;
2745         RefPtr<API::Object> messageBody;
2746     };
2747     Vector<InjectedBundleMessage> m_pendingInjectedBundleMessages;
2748         
2749 #if PLATFORM(IOS_FAMILY) && ENABLE(DEVICE_ORIENTATION)
2750     std::unique_ptr<WebDeviceOrientationUpdateProviderProxy> m_webDeviceOrientationUpdateProviderProxy;
2751 #endif
2752
2753 #if ENABLE(RESOURCE_LOAD_STATISTICS)
2754     MonotonicTime m_didFinishDocumentLoadForMainFrameTimestamp;
2755 #endif
2756         
2757     NavigatingToAppBoundDomain m_isNavigatingToAppBoundDomain { NavigatingToAppBoundDomain::No };
2758     NavigatedAwayFromAppBoundDomain m_hasNavigatedAwayFromAppBoundDomain { NavigatedAwayFromAppBoundDomain::No };
2759 };
2760
2761 } // namespace WebKit