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