18b2016e03562b025bc6166837356f4aabf0dc5c
[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 #endif
753
754 #if PLATFORM(GTK)
755     void setInputMethodState(bool enabled);
756 #endif
757
758 #if PLATFORM (GTK) && HAVE(GTK_GESTURES)
759     void getCenterForZoomGesture(const WebCore::IntPoint& centerInViewCoordinates, WebCore::IntPoint& center);
760 #endif
761
762 #if PLATFORM(COCOA)
763     void windowAndViewFramesChanged(const WebCore::FloatRect& viewFrameInWindowCoordinates, const WebCore::FloatPoint& accessibilityViewCoordinates);
764     void setMainFrameIsScrollable(bool);
765
766     void sendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdentifier, const String& textInput);
767     bool shouldDelayWindowOrderingForEvent(const WebMouseEvent&);
768     bool acceptsFirstMouse(int eventNumber, const WebMouseEvent&);
769
770     void setRemoteLayerTreeRootNode(RemoteLayerTreeNode*);
771     CALayer *acceleratedCompositingRootLayer() const;
772
773     void setTextAsync(const String&);
774     void insertTextAsync(const String& text, const EditingRange& replacementRange, InsertTextOptions&&);
775     void hasMarkedText(CompletionHandler<void(bool)>&&);
776     void getMarkedRangeAsync(WTF::Function<void (EditingRange, CallbackBase::Error)>&&);
777     void getSelectedRangeAsync(WTF::Function<void (EditingRange, CallbackBase::Error)>&&);
778     void characterIndexForPointAsync(const WebCore::IntPoint&, WTF::Function<void (uint64_t, CallbackBase::Error)>&&);
779     void firstRectForCharacterRangeAsync(const EditingRange&, WTF::Function<void (const WebCore::IntRect&, const EditingRange&, CallbackBase::Error)>&&);
780     void setCompositionAsync(const String& text, const Vector<WebCore::CompositionUnderline>& underlines, const EditingRange& selectionRange, const EditingRange& replacementRange);
781     void confirmCompositionAsync();
782
783     void setScrollPerformanceDataCollectionEnabled(bool);
784     bool scrollPerformanceDataCollectionEnabled() const { return m_scrollPerformanceDataCollectionEnabled; }
785     RemoteLayerTreeScrollingPerformanceData* scrollingPerformanceData() { return m_scrollingPerformanceData.get(); }
786 #endif // PLATFORM(COCOA)
787
788     void changeFontAttributes(WebCore::FontAttributeChanges&&);
789     void changeFont(WebCore::FontChanges&&);
790
791 #if PLATFORM(MAC)
792     void insertDictatedTextAsync(const String& text, const EditingRange& replacementRange, const Vector<WebCore::TextAlternativeWithRange>& dictationAlternatives, bool registerUndoGroup);
793     void attributedSubstringForCharacterRangeAsync(const EditingRange&, WTF::Function<void (const AttributedString&, const EditingRange&, CallbackBase::Error)>&&);
794     void fontAtSelection(WTF::Function<void (const String&, double, bool, CallbackBase::Error)>&&);
795
796     void startWindowDrag();
797     NSWindow *platformWindow();
798     void rootViewToWindow(const WebCore::IntRect& viewRect, WebCore::IntRect& windowRect);
799
800     NSView *inspectorAttachmentView();
801     _WKRemoteObjectRegistry *remoteObjectRegistry();
802
803     CGRect boundsOfLayerInLayerBackedWindowCoordinates(CALayer *) const;
804 #endif // PLATFORM(MAC)
805
806 #if PLATFORM(GTK)
807     PlatformViewWidget viewWidget();
808     bool makeGLContextCurrent();
809 #endif
810
811     const Optional<WebCore::Color>& backgroundColor() const { return m_backgroundColor; }
812     void setBackgroundColor(const Optional<WebCore::Color>&);
813
814 #if PLATFORM(WIN)
815     PlatformViewWidget viewWidget();
816 #endif
817 #if PLATFORM(WPE)
818     struct wpe_view_backend* viewBackend();
819 #endif
820
821     bool isProcessingMouseEvents() const;
822     void processNextQueuedMouseEvent();
823     void handleMouseEvent(const NativeWebMouseEvent&);
824
825     void handleWheelEvent(const NativeWebWheelEvent&);
826
827     bool isProcessingKeyboardEvents() const;
828     void handleKeyboardEvent(const NativeWebKeyboardEvent&);
829
830 #if ENABLE(MAC_GESTURE_EVENTS)
831     void handleGestureEvent(const NativeWebGestureEvent&);
832 #endif
833
834 #if ENABLE(IOS_TOUCH_EVENTS)
835     void handleTouchEventSynchronously(NativeWebTouchEvent&);
836     void handleTouchEventAsynchronously(const NativeWebTouchEvent&);
837
838 #elif ENABLE(TOUCH_EVENTS)
839     void handleTouchEvent(const NativeWebTouchEvent&);
840 #endif
841
842 #if ENABLE(POINTER_EVENTS)
843     void cancelPointer(WebCore::PointerID, const WebCore::IntPoint&);
844     void touchWithIdentifierWasRemoved(WebCore::PointerID);
845 #endif
846
847     void scrollBy(WebCore::ScrollDirection, WebCore::ScrollGranularity);
848     void centerSelectionInVisibleArea();
849
850     const String& toolTip() const { return m_toolTip; }
851
852     const String& userAgent() const { return m_userAgent; }
853     void setApplicationNameForUserAgent(const String&);
854     const String& applicationNameForUserAgent() const { return m_applicationNameForUserAgent; }
855     void setApplicationNameForDesktopUserAgent(const String& applicationName) { m_applicationNameForDesktopUserAgent = applicationName; }
856     const String& applicationNameForDesktopUserAgent() const { return m_applicationNameForDesktopUserAgent; }
857     void setCustomUserAgent(const String&);
858     const String& customUserAgent() const { return m_customUserAgent; }
859     static String standardUserAgent(const String& applicationName = String());
860
861     bool supportsTextEncoding() const;
862     void setCustomTextEncodingName(const String&);
863     String customTextEncodingName() const { return m_customTextEncodingName; }
864
865     bool areActiveDOMObjectsAndAnimationsSuspended() const { return m_isPageSuspended; }
866     void resumeActiveDOMObjectsAndAnimations();
867     void suspendActiveDOMObjectsAndAnimations();
868
869     double estimatedProgress() const;
870
871     SessionState sessionState(WTF::Function<bool (WebBackForwardListItem&)>&& = nullptr) const;
872     RefPtr<API::Navigation> restoreFromSessionState(SessionState, bool navigate);
873
874     bool supportsTextZoom() const;
875     double textZoomFactor() const { return m_textZoomFactor; }
876     void setTextZoomFactor(double);
877     double pageZoomFactor() const;
878     void setPageZoomFactor(double);
879     void setPageAndTextZoomFactors(double pageZoomFactor, double textZoomFactor);
880
881     void scalePage(double scale, const WebCore::IntPoint& origin);
882     void scalePageInViewCoordinates(double scale, const WebCore::IntPoint& centerInViewCoordinates);
883     double pageScaleFactor() const;
884     double viewScaleFactor() const { return m_viewScaleFactor; }
885     void scaleView(double scale);
886     void setShouldScaleViewToFitDocument(bool);
887     
888     float deviceScaleFactor() const;
889     void setIntrinsicDeviceScaleFactor(float);
890     void setCustomDeviceScaleFactor(float);
891     void windowScreenDidChange(WebCore::PlatformDisplayID);
892     void accessibilitySettingsDidChange();
893
894     void setUseFixedLayout(bool);
895     void setFixedLayoutSize(const WebCore::IntSize&);
896     bool useFixedLayout() const { return m_useFixedLayout; };
897     const WebCore::IntSize& fixedLayoutSize() const { return m_fixedLayoutSize; };
898
899     void setAlwaysShowsHorizontalScroller(bool);
900     void setAlwaysShowsVerticalScroller(bool);
901     bool alwaysShowsHorizontalScroller() const { return m_alwaysShowsHorizontalScroller; }
902     bool alwaysShowsVerticalScroller() const { return m_alwaysShowsVerticalScroller; }
903
904     void listenForLayoutMilestones(OptionSet<WebCore::LayoutMilestone>);
905
906     bool hasHorizontalScrollbar() const { return m_mainFrameHasHorizontalScrollbar; }
907     bool hasVerticalScrollbar() const { return m_mainFrameHasVerticalScrollbar; }
908
909     void setSuppressScrollbarAnimations(bool);
910     bool areScrollbarAnimationsSuppressed() const { return m_suppressScrollbarAnimations; }
911
912     bool isPinnedToLeftSide() const { return m_mainFrameIsPinnedToLeftSide; }
913     bool isPinnedToRightSide() const { return m_mainFrameIsPinnedToRightSide; }
914     bool isPinnedToTopSide() const { return m_mainFrameIsPinnedToTopSide; }
915     bool isPinnedToBottomSide() const { return m_mainFrameIsPinnedToBottomSide; }
916
917     bool rubberBandsAtLeft() const;
918     void setRubberBandsAtLeft(bool);
919     bool rubberBandsAtRight() const;
920     void setRubberBandsAtRight(bool);
921     bool rubberBandsAtTop() const;
922     void setRubberBandsAtTop(bool);
923     bool rubberBandsAtBottom() const;
924     void setRubberBandsAtBottom(bool);
925
926     void setShouldUseImplicitRubberBandControl(bool shouldUseImplicitRubberBandControl) { m_shouldUseImplicitRubberBandControl = shouldUseImplicitRubberBandControl; }
927     bool shouldUseImplicitRubberBandControl() const { return m_shouldUseImplicitRubberBandControl; }
928         
929     void setEnableVerticalRubberBanding(bool);
930     bool verticalRubberBandingIsEnabled() const;
931     void setEnableHorizontalRubberBanding(bool);
932     bool horizontalRubberBandingIsEnabled() const;
933         
934     void setBackgroundExtendsBeyondPage(bool);
935     bool backgroundExtendsBeyondPage() const;
936
937     void setPaginationMode(WebCore::Pagination::Mode);
938     WebCore::Pagination::Mode paginationMode() const { return m_paginationMode; }
939     void setPaginationBehavesLikeColumns(bool);
940     bool paginationBehavesLikeColumns() const { return m_paginationBehavesLikeColumns; }
941     void setPageLength(double);
942     double pageLength() const { return m_pageLength; }
943     void setGapBetweenPages(double);
944     double gapBetweenPages() const { return m_gapBetweenPages; }
945     void setPaginationLineGridEnabled(bool);
946     bool paginationLineGridEnabled() const { return m_paginationLineGridEnabled; }
947     unsigned pageCount() const { return m_pageCount; }
948
949     void isJITEnabled(CompletionHandler<void(bool)>&&);
950
951 #if PLATFORM(MAC)
952     void setUseSystemAppearance(bool);
953     bool useSystemAppearance() const { return m_useSystemAppearance; }
954 #endif
955
956     void effectiveAppearanceDidChange();
957     bool useDarkAppearance() const;
958     bool useInactiveAppearance() const;
959
960 #if PLATFORM(COCOA)
961     // Called by the web process through a message.
962     void registerWebProcessAccessibilityToken(const IPC::DataReference&);
963     // Called by the UI process when it is ready to send its tokens to the web process.
964     void registerUIProcessAccessibilityTokens(const IPC::DataReference& elemenToken, const IPC::DataReference& windowToken);
965     bool readSelectionFromPasteboard(const String& pasteboardName);
966     String stringSelectionForPasteboard();
967     RefPtr<WebCore::SharedBuffer> dataSelectionForPasteboard(const String& pasteboardType);
968     void makeFirstResponder();
969     void assistiveTechnologyMakeFirstResponder();
970
971     ColorSpaceData colorSpace();
972 #endif
973
974 #if ENABLE(SERVICE_CONTROLS)
975     void replaceSelectionWithPasteboardData(const Vector<String>& types, const IPC::DataReference&);
976 #endif
977
978     void pageScaleFactorDidChange(double);
979     void pluginScaleFactorDidChange(double);
980     void pluginZoomFactorDidChange(double);
981
982     // Find.
983     void findString(const String&, FindOptions, unsigned maxMatchCount);
984     void findStringMatches(const String&, FindOptions, unsigned maxMatchCount);
985     void getImageForFindMatch(int32_t matchIndex);
986     void selectFindMatch(int32_t matchIndex);
987     void didGetImageForFindMatch(const ShareableBitmap::Handle& contentImageHandle, uint32_t matchIndex);
988     void hideFindUI();
989     void countStringMatches(const String&, FindOptions, unsigned maxMatchCount);
990     void replaceMatches(Vector<uint32_t>&& matchIndices, const String& replacementText, bool selectionOnly, Function<void(uint64_t, CallbackBase::Error)>&&);
991     void didCountStringMatches(const String&, uint32_t matchCount);
992     void setTextIndicator(const WebCore::TextIndicatorData&, uint64_t /* WebCore::TextIndicatorWindowLifetime */ lifetime = 0 /* Permanent */);
993     void setTextIndicatorAnimationProgress(float);
994     void clearTextIndicator();
995     void didFindString(const String&, const Vector<WebCore::IntRect>&, uint32_t matchCount, int32_t matchIndex, bool didWrapAround);
996     void didFailToFindString(const String&);
997     void didFindStringMatches(const String&, const Vector<Vector<WebCore::IntRect>>& matchRects, int32_t firstIndexAfterSelection);
998
999     void getContentsAsString(WTF::Function<void (const String&, CallbackBase::Error)>&&);
1000 #if PLATFORM(COCOA)
1001     void getContentsAsAttributedString(CompletionHandler<void(const AttributedString&)>&&);
1002 #endif
1003     void getBytecodeProfile(WTF::Function<void (const String&, CallbackBase::Error)>&&);
1004     void getSamplingProfilerOutput(WTF::Function<void (const String&, CallbackBase::Error)>&&);
1005
1006 #if ENABLE(MHTML)
1007     void getContentsAsMHTMLData(Function<void (API::Data*, CallbackBase::Error)>&&);
1008 #endif
1009     void getMainResourceDataOfFrame(WebFrameProxy*, Function<void (API::Data*, CallbackBase::Error)>&&);
1010     void getResourceDataFromFrame(WebFrameProxy*, API::URL*, Function<void (API::Data*, CallbackBase::Error)>&&);
1011     void getRenderTreeExternalRepresentation(WTF::Function<void (const String&, CallbackBase::Error)>&&);
1012     void getSelectionOrContentsAsString(WTF::Function<void (const String&, CallbackBase::Error)>&&);
1013     void getSelectionAsWebArchiveData(Function<void (API::Data*, CallbackBase::Error)>&&);
1014     void getSourceForFrame(WebFrameProxy*, WTF::Function<void (const String&, CallbackBase::Error)>&&);
1015     void getWebArchiveOfFrame(WebFrameProxy*, Function<void (API::Data*, CallbackBase::Error)>&&);
1016     void runJavaScriptInMainFrame(const String&, bool, WTF::Function<void (API::SerializedScriptValue*, bool hadException, const WebCore::ExceptionDetails&, CallbackBase::Error)>&& callbackFunction);
1017     void runJavaScriptInMainFrameScriptWorld(const String&, bool, const Optional<String>& worldName, WTF::Function<void(API::SerializedScriptValue*, bool hadException, const WebCore::ExceptionDetails&, CallbackBase::Error)>&& callbackFunction);
1018     // For sub frames.
1019     void runJavaScriptInFrame(uint64_t frameID, const String& script, bool forceUserGesture, WTF::Function<void(API::SerializedScriptValue*, bool hadException, const WebCore::ExceptionDetails&, CallbackBase::Error)>&& callbackFunction);
1020     void forceRepaint(RefPtr<VoidCallback>&&);
1021
1022     float headerHeight(WebFrameProxy&);
1023     float footerHeight(WebFrameProxy&);
1024     void drawHeader(WebFrameProxy&, WebCore::FloatRect&&);
1025     void drawFooter(WebFrameProxy&, WebCore::FloatRect&&);
1026
1027 #if PLATFORM(COCOA)
1028     // Dictionary.
1029     void performDictionaryLookupAtLocation(const WebCore::FloatPoint&);
1030     void performDictionaryLookupOfCurrentSelection();
1031 #endif
1032
1033     class PolicyDecisionSender;
1034     enum class WillContinueLoadInNewProcess : bool { No, Yes };
1035     void receivedPolicyDecision(WebCore::PolicyAction, API::Navigation*, Optional<WebsitePoliciesData>&&, Ref<PolicyDecisionSender>&&, WillContinueLoadInNewProcess = WillContinueLoadInNewProcess::No);
1036     void receivedNavigationPolicyDecision(WebCore::PolicyAction, API::Navigation*, ProcessSwapRequestedByClient, WebFrameProxy&, API::WebsitePolicies*, Ref<PolicyDecisionSender>&&);
1037
1038     void backForwardRemovedItem(const WebCore::BackForwardItemIdentifier&);
1039
1040 #if ENABLE(DRAG_SUPPORT)    
1041     // Drag and drop support.
1042     void dragEntered(WebCore::DragData&, const String& dragStorageName = String());
1043     void dragUpdated(WebCore::DragData&, const String& dragStorageName = String());
1044     void dragExited(WebCore::DragData&, const String& dragStorageName = String());
1045     void performDragOperation(WebCore::DragData&, const String& dragStorageName, SandboxExtension::Handle&&, SandboxExtension::HandleArray&&);
1046     void didPerformDragOperation(bool handled);
1047
1048     void didPerformDragControllerAction(uint64_t dragOperation, WebCore::DragHandlingMethod, bool mouseIsOverFileInput, unsigned numberOfItemsToBeAccepted, const WebCore::IntRect& insertionRect, const WebCore::IntRect& editableElementRect);
1049     void dragEnded(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition, uint64_t operation);
1050     void didStartDrag();
1051     void dragCancelled();
1052     void setDragCaretRect(const WebCore::IntRect&);
1053 #if PLATFORM(COCOA)
1054     void startDrag(const WebCore::DragItem&, const ShareableBitmap::Handle& dragImageHandle);
1055     void setPromisedDataForImage(const String& pasteboardName, const SharedMemory::Handle& imageHandle, uint64_t imageSize, const String& filename, const String& extension,
1056                          const String& title, const String& url, const String& visibleURL, const SharedMemory::Handle& archiveHandle, uint64_t archiveSize);
1057 #endif
1058 #if PLATFORM(GTK)
1059     void startDrag(WebSelectionData&&, uint64_t dragOperation, const ShareableBitmap::Handle& dragImage);
1060 #endif
1061 #endif
1062
1063     void processDidBecomeUnresponsive();
1064     void processDidBecomeResponsive();
1065     void processDidTerminate(ProcessTerminationReason);
1066     void provisionalProcessDidTerminate();
1067     void dispatchProcessDidTerminate(ProcessTerminationReason);
1068     void willChangeProcessIsResponsive();
1069     void didChangeProcessIsResponsive();
1070
1071 #if PLATFORM(IOS_FAMILY)
1072     void processWillBecomeSuspended();
1073     void processWillBecomeForeground();
1074 #endif
1075
1076 #if HAVE(VISIBILITY_PROPAGATION_VIEW)
1077     void didCreateContextForVisibilityPropagation(LayerHostingContextID);
1078     LayerHostingContextID contextIDForVisibilityPropagation() const { return m_contextIDForVisibilityPropagation; }
1079 #endif
1080
1081     virtual void enterAcceleratedCompositingMode(const LayerTreeContext&);
1082     virtual void exitAcceleratedCompositingMode();
1083     virtual void updateAcceleratedCompositingMode(const LayerTreeContext&);
1084
1085     void addEditCommand(WebEditCommandProxy&);
1086     void removeEditCommand(WebEditCommandProxy&);
1087     void registerEditCommand(Ref<WebEditCommandProxy>&&, UndoOrRedo);
1088
1089     bool canUndo();
1090     bool canRedo();
1091
1092 #if PLATFORM(COCOA)
1093     void registerKeypressCommandName(const String& name) { m_knownKeypressCommandNames.add(name); }
1094     bool isValidKeypressCommandName(const String& name) const { return m_knownKeypressCommandNames.contains(name); }
1095 #endif
1096
1097     WebProcessProxy& ensureRunningProcess();
1098     WebProcessProxy& process() { return m_process; }
1099     ProcessID processIdentifier() const;
1100
1101     WebPreferences& preferences() { return m_preferences; }
1102     void setPreferences(WebPreferences&);
1103
1104     WebPageGroup& pageGroup() { return m_pageGroup; }
1105
1106     bool hasRunningProcess() const;
1107     void launchInitialProcessIfNecessary();
1108
1109 #if ENABLE(DRAG_SUPPORT)
1110     WebCore::DragOperation currentDragOperation() const { return m_currentDragOperation; }
1111     WebCore::DragHandlingMethod currentDragHandlingMethod() const { return m_currentDragHandlingMethod; }
1112     bool currentDragIsOverFileInput() const { return m_currentDragIsOverFileInput; }
1113     unsigned currentDragNumberOfFilesToBeAccepted() const { return m_currentDragNumberOfFilesToBeAccepted; }
1114     WebCore::IntRect currentDragCaretRect() const { return m_currentDragCaretRect; }
1115     WebCore::IntRect currentDragCaretEditableElementRect() const { return m_currentDragCaretEditableElementRect; }
1116     void resetCurrentDragInformation();
1117     void didEndDragging();
1118 #endif
1119
1120     void preferencesDidChange();
1121
1122 #if ENABLE(CONTEXT_MENUS)
1123     // Called by the WebContextMenuProxy.
1124     void contextMenuItemSelected(const WebContextMenuItemData&);
1125     void handleContextMenuKeyEvent();
1126 #endif
1127
1128     // Called by the WebOpenPanelResultListenerProxy.
1129 #if PLATFORM(IOS_FAMILY)
1130     void didChooseFilesForOpenPanelWithDisplayStringAndIcon(const Vector<String>&, const String& displayString, const API::Data* iconData);
1131 #endif
1132     void didChooseFilesForOpenPanel(const Vector<String>&);
1133     void didCancelForOpenPanel();
1134
1135     WebPageCreationParameters creationParameters(WebProcessProxy&, DrawingAreaProxy&);
1136
1137     void handleDownloadRequest(DownloadProxy&);
1138
1139     void advanceToNextMisspelling(bool startBeforeSelection);
1140     void changeSpellingToWord(const String& word);
1141 #if USE(APPKIT)
1142     void uppercaseWord();
1143     void lowercaseWord();
1144     void capitalizeWord();
1145 #endif
1146
1147 #if PLATFORM(COCOA)
1148     bool isSmartInsertDeleteEnabled() const { return m_isSmartInsertDeleteEnabled; }
1149     void setSmartInsertDeleteEnabled(bool);
1150 #endif
1151
1152     void setCanRunModal(bool);
1153     bool canRunModal();
1154
1155     void beginPrinting(WebFrameProxy*, const PrintInfo&);
1156     void endPrinting();
1157     void computePagesForPrinting(WebFrameProxy*, const PrintInfo&, Ref<ComputedPagesCallback>&&);
1158 #if PLATFORM(COCOA)
1159     void drawRectToImage(WebFrameProxy*, const PrintInfo&, const WebCore::IntRect&, const WebCore::IntSize&, Ref<ImageCallback>&&);
1160     void drawPagesToPDF(WebFrameProxy*, const PrintInfo&, uint32_t first, uint32_t count, Ref<DataCallback>&&);
1161 #if PLATFORM(IOS_FAMILY)
1162     uint32_t computePagesForPrintingAndDrawToPDF(uint64_t frameID, const PrintInfo&, DrawToPDFCallback::CallbackFunction&&);
1163     void drawToPDFCallback(const IPC::DataReference& pdfData, WebKit::CallbackID);
1164 #endif
1165 #elif PLATFORM(GTK)
1166     void drawPagesForPrinting(WebFrameProxy*, const PrintInfo&, Ref<PrintFinishedCallback>&&);
1167 #endif
1168
1169     PageLoadState& pageLoadState() { return m_pageLoadState; }
1170
1171 #if PLATFORM(COCOA)
1172     void handleAlternativeTextUIResult(const String& result);
1173 #endif
1174
1175     void saveDataToFileInDownloadsFolder(String&& suggestedFilename, String&& mimeType, URL&& originatingURL, API::Data&);
1176     void savePDFToFileInDownloadsFolder(String&& suggestedFilename, URL&& originatingURL, const IPC::DataReference&);
1177 #if PLATFORM(COCOA)
1178     void savePDFToTemporaryFolderAndOpenWithNativeApplicationRaw(const String& suggestedFilename, const String& originatingURLString, const uint8_t* data, unsigned long size, const String& pdfUUID);
1179     void savePDFToTemporaryFolderAndOpenWithNativeApplication(const String& suggestedFilename, const String& originatingURLString, const IPC::DataReference&, const String& pdfUUID);
1180     void openPDFFromTemporaryFolderWithNativeApplication(const String& pdfUUID);
1181 #endif
1182
1183 #if ENABLE(PDFKIT_PLUGIN)
1184     void showPDFContextMenu(const WebKit::PDFContextMenu&, CompletionHandler<void(Optional<int32_t>&&)>&&);
1185 #endif
1186     WebCore::IntRect visibleScrollerThumbRect() const { return m_visibleScrollerThumbRect; }
1187
1188     uint64_t renderTreeSize() const { return m_renderTreeSize; }
1189
1190     void setMediaVolume(float);
1191     void setMuted(WebCore::MediaProducer::MutedStateFlags);
1192     void setMayStartMediaWhenInWindow(bool);
1193     bool mayStartMediaWhenInWindow() const { return m_mayStartMediaWhenInWindow; }
1194     void setMediaCaptureEnabled(bool);
1195     bool mediaCaptureEnabled() const { return m_mediaCaptureEnabled; }
1196     void stopMediaCapture();
1197
1198     void stopAllMediaPlayback();
1199     void suspendAllMediaPlayback();
1200     void resumeAllMediaPlayback();
1201
1202 #if ENABLE(MEDIA_SESSION)
1203     bool hasMediaSessionWithActiveMediaElements() const { return m_hasMediaSessionWithActiveMediaElements; }
1204     void handleMediaEvent(WebCore::MediaEventType);
1205     void setVolumeOfMediaElement(double, uint64_t);
1206 #endif
1207         
1208 #if ENABLE(POINTER_LOCK)
1209     void didAllowPointerLock();
1210     void didDenyPointerLock();
1211 #endif
1212
1213     // WebPopupMenuProxy::Client
1214     NativeWebMouseEvent* currentlyProcessedMouseDownEvent() override;
1215
1216     void setSuppressVisibilityUpdates(bool flag);
1217     bool suppressVisibilityUpdates() { return m_suppressVisibilityUpdates; }
1218
1219 #if PLATFORM(IOS_FAMILY)
1220     void willStartUserTriggeredZooming();
1221
1222     void potentialTapAtPosition(const WebCore::FloatPoint&, bool shouldRequestMagnificationInformation, uint64_t& requestID);
1223     void commitPotentialTap(OptionSet<WebKit::WebEvent::Modifier>, uint64_t layerTreeTransactionIdAtLastTouchStart, WebCore::PointerID);
1224     void cancelPotentialTap();
1225     void tapHighlightAtPosition(const WebCore::FloatPoint&, uint64_t& requestID);
1226     void handleTap(const WebCore::FloatPoint&, OptionSet<WebKit::WebEvent::Modifier>, uint64_t layerTreeTransactionIdAtLastTouchStart);
1227     void didRecognizeLongPress();
1228
1229     void inspectorNodeSearchMovedToPosition(const WebCore::FloatPoint&);
1230     void inspectorNodeSearchEndedAtPosition(const WebCore::FloatPoint&);
1231
1232     void blurFocusedElement();
1233     void setIsShowingInputViewForFocusedElement(bool);
1234 #endif
1235
1236     void postMessageToInjectedBundle(const String& messageName, API::Object* messageBody);
1237
1238 #if ENABLE(INPUT_TYPE_COLOR)
1239     void setColorPickerColor(const WebCore::Color&);
1240     void endColorPicker();
1241 #endif
1242
1243     WebCore::IntSize viewLayoutSize() const { return m_viewLayoutSize; }
1244     void setViewLayoutSize(const WebCore::IntSize&);
1245
1246     bool autoSizingShouldExpandToViewHeight() const { return m_autoSizingShouldExpandToViewHeight; }
1247     void setAutoSizingShouldExpandToViewHeight(bool);
1248
1249     void setViewportSizeForCSSViewportUnits(const WebCore::IntSize&);
1250     WebCore::IntSize viewportSizeForCSSViewportUnits() const { return m_viewportSizeForCSSViewportUnits.valueOr(WebCore::IntSize()); }
1251
1252     void didReceiveAuthenticationChallengeProxy(uint64_t frameID, Ref<AuthenticationChallengeProxy>&&);
1253
1254     SpellDocumentTag spellDocumentTag();
1255
1256     void didFinishCheckingText(uint64_t requestID, const Vector<WebCore::TextCheckingResult>&);
1257     void didCancelCheckingText(uint64_t requestID);
1258
1259     void connectionWillOpen(IPC::Connection&);
1260     void webProcessWillShutDown();
1261
1262     void didSaveToPageCache();
1263         
1264     void setScrollPinningBehavior(WebCore::ScrollPinningBehavior);
1265     WebCore::ScrollPinningBehavior scrollPinningBehavior() const { return m_scrollPinningBehavior; }
1266
1267     void setOverlayScrollbarStyle(Optional<WebCore::ScrollbarOverlayStyle>);
1268     Optional<WebCore::ScrollbarOverlayStyle> overlayScrollbarStyle() const { return m_scrollbarOverlayStyle; }
1269
1270     // When the state of the window changes such that the WebPage needs immediate update, the UIProcess sends a new
1271     // ActivityStateChangeID to the WebProcess through the SetActivityState message. The UIProcess will wait till it
1272     // receives a CommitLayerTree which has an ActivityStateChangeID equal to or greater than the one it sent.
1273     ActivityStateChangeID takeNextActivityStateChangeID() { return ++m_currentActivityStateChangeID; }
1274
1275     bool shouldRecordNavigationSnapshots() const { return m_shouldRecordNavigationSnapshots; }
1276     void setShouldRecordNavigationSnapshots(bool shouldRecordSnapshots) { m_shouldRecordNavigationSnapshots = shouldRecordSnapshots; }
1277     void recordAutomaticNavigationSnapshot();
1278     void suppressNextAutomaticNavigationSnapshot() { m_shouldSuppressNextAutomaticNavigationSnapshot = true; }
1279     void recordNavigationSnapshot(WebBackForwardListItem&);
1280     void requestFocusedElementInformation(Function<void(const FocusedElementInformation&, CallbackBase::Error)>&&);
1281
1282 #if PLATFORM(COCOA) || PLATFORM(GTK)
1283     RefPtr<ViewSnapshot> takeViewSnapshot();
1284 #endif
1285
1286 #if ENABLE(WEB_CRYPTO)
1287     void wrapCryptoKey(const Vector<uint8_t>&, CompletionHandler<void(bool, Vector<uint8_t>&&)>&&);
1288     void unwrapCryptoKey(const Vector<uint8_t>&, CompletionHandler<void(bool, Vector<uint8_t>&&)>&&);
1289 #endif
1290
1291     void signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String& challengeString, const URL&, CompletionHandler<void(String)>&&);
1292
1293     void takeSnapshot(WebCore::IntRect, WebCore::IntSize bitmapSize, SnapshotOptions, WTF::Function<void (const ShareableBitmap::Handle&, CallbackBase::Error)>&&);
1294
1295     void navigationGestureDidBegin();
1296     void navigationGestureWillEnd(bool willNavigate, WebBackForwardListItem&);
1297     void navigationGestureDidEnd(bool willNavigate, WebBackForwardListItem&);
1298     void navigationGestureDidEnd();
1299     void navigationGestureSnapshotWasRemoved();
1300     void willRecordNavigationSnapshot(WebBackForwardListItem&);
1301
1302     bool isShowingNavigationGestureSnapshot() const { return m_isShowingNavigationGestureSnapshot; }
1303
1304     bool isPlayingAudio() const { return !!(m_mediaState & WebCore::MediaProducer::IsPlayingAudio); }
1305     void isPlayingMediaDidChange(WebCore::MediaProducer::MediaStateFlags, uint64_t);
1306     void updatePlayingMediaDidChange(WebCore::MediaProducer::MediaStateFlags);
1307     bool isCapturingAudio() const { return m_mediaState & WebCore::MediaProducer::AudioCaptureMask; }
1308     bool isCapturingVideo() const { return m_mediaState & WebCore::MediaProducer::VideoCaptureMask; }
1309     bool hasActiveAudioStream() const { return m_mediaState & WebCore::MediaProducer::HasActiveAudioCaptureDevice; }
1310     bool hasActiveVideoStream() const { return m_mediaState & WebCore::MediaProducer::HasActiveVideoCaptureDevice; }
1311     WebCore::MediaProducer::MediaStateFlags mediaStateFlags() const { return m_mediaState; }
1312     void handleAutoplayEvent(WebCore::AutoplayEvent, OptionSet<WebCore::AutoplayEventFlags>);
1313
1314     void videoControlsManagerDidChange();
1315     bool hasActiveVideoForControlsManager() const;
1316     void requestControlledElementID() const;
1317     void handleControlledElementIDResponse(const String&) const;
1318     bool isPlayingVideoInEnhancedFullscreen() const;
1319
1320 #if PLATFORM(COCOA)
1321     void requestActiveNowPlayingSessionInfo(Ref<NowPlayingInfoCallback>&&);
1322     void nowPlayingInfoCallback(bool, bool, const String&, double, double, uint64_t, CallbackID);
1323 #endif
1324
1325 #if ENABLE(MEDIA_SESSION)
1326     void hasMediaSessionWithActiveMediaElementsDidChange(bool);
1327     void mediaSessionMetadataDidChange(const WebCore::MediaSessionMetadata&);
1328     void focusedContentMediaElementDidChange(uint64_t);
1329 #endif
1330
1331 #if PLATFORM(MAC)
1332     API::HitTestResult* lastMouseMoveHitTestResult() const { return m_lastMouseMoveHitTestResult.get(); }
1333     void performImmediateActionHitTestAtLocation(WebCore::FloatPoint);
1334
1335     void immediateActionDidUpdate();
1336     void immediateActionDidCancel();
1337     void immediateActionDidComplete();
1338
1339     NSObject *immediateActionAnimationControllerForHitTestResult(RefPtr<API::HitTestResult>, uint64_t, RefPtr<API::Object>);
1340
1341     void handleAcceptedCandidate(WebCore::TextCheckingResult);
1342     void didHandleAcceptedCandidate();
1343
1344     void setHeaderBannerHeightForTesting(int);
1345     void setFooterBannerHeightForTesting(int);
1346 #endif
1347
1348     bool scrollingUpdatesDisabledForTesting();
1349
1350     void installActivityStateChangeCompletionHandler(Function<void()>&&);
1351
1352 #if USE(UNIFIED_TEXT_CHECKING)
1353     void checkTextOfParagraph(const String& text, OptionSet<WebCore::TextCheckingType> checkingTypes, int32_t insertionPoint, CompletionHandler<void(Vector<WebCore::TextCheckingResult>&&)>&&);
1354 #endif
1355     void getGuessesForWord(const String& word, const String& context, int32_t insertionPoint, CompletionHandler<void(Vector<String>&&)>&&);
1356
1357     void setShouldDispatchFakeMouseMoveEvents(bool);
1358
1359     // Diagnostic messages logging.
1360     void logDiagnosticMessage(const String& message, const String& description, WebCore::ShouldSample);
1361     void logDiagnosticMessageWithResult(const String& message, const String& description, uint32_t result, WebCore::ShouldSample);
1362     void logDiagnosticMessageWithValue(const String& message, const String& description, double value, unsigned significantFigures, WebCore::ShouldSample);
1363     void logDiagnosticMessageWithEnhancedPrivacy(const String& message, const String& description, WebCore::ShouldSample);
1364     void logDiagnosticMessageWithValueDictionary(const String& message, const String& description, const WebCore::DiagnosticLoggingClient::ValueDictionary&, WebCore::ShouldSample);
1365
1366     // Performance logging.
1367     void logScrollingEvent(uint32_t eventType, MonotonicTime, uint64_t);
1368
1369     // Form validation messages.
1370     void showValidationMessage(const WebCore::IntRect& anchorClientRect, const String& message);
1371     void hideValidationMessage();
1372 #if PLATFORM(COCOA)
1373     WebCore::ValidationBubble* validationBubble() const { return m_validationBubble.get(); } // For testing.
1374 #endif
1375
1376 #if PLATFORM(IOS_FAMILY)
1377     void setIsKeyboardAnimatingIn(bool isKeyboardAnimatingIn) { m_isKeyboardAnimatingIn = isKeyboardAnimatingIn; }
1378 #endif
1379
1380 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS_FAMILY)
1381     void addPlaybackTargetPickerClient(uint64_t);
1382     void removePlaybackTargetPickerClient(uint64_t);
1383     void showPlaybackTargetPicker(uint64_t, const WebCore::FloatRect&, bool hasVideo);
1384     void playbackTargetPickerClientStateDidChange(uint64_t, WebCore::MediaProducer::MediaStateFlags);
1385     void setMockMediaPlaybackTargetPickerEnabled(bool);
1386     void setMockMediaPlaybackTargetPickerState(const String&, WebCore::MediaPlaybackTargetContext::State);
1387
1388     // WebMediaSessionManagerClient
1389     void setPlaybackTarget(uint64_t, Ref<WebCore::MediaPlaybackTarget>&&) override;
1390     void externalOutputDeviceAvailableDidChange(uint64_t, bool) override;
1391     void setShouldPlayToPlaybackTarget(uint64_t, bool) override;
1392 #endif
1393
1394     void didChangeBackgroundColor();
1395     void didLayoutForCustomContentProvider();
1396
1397     // For testing
1398     void clearWheelEventTestTrigger();
1399     void callAfterNextPresentationUpdate(WTF::Function<void (CallbackBase::Error)>&&);
1400
1401     void didReachLayoutMilestone(OptionSet<WebCore::LayoutMilestone>);
1402
1403     void didRestoreScrollPosition();
1404
1405     void getLoadDecisionForIcon(const WebCore::LinkIcon&, WebKit::CallbackID);
1406     void finishedLoadingIcon(WebKit::CallbackID, const IPC::DataReference&);
1407
1408     void setFocus(bool focused);
1409     void setWindowFrame(const WebCore::FloatRect&);
1410     void getWindowFrame(Messages::WebPageProxy::GetWindowFrame::DelayedReply&&);
1411     void getWindowFrameWithCallback(Function<void(WebCore::FloatRect)>&&);
1412
1413     bool isResourceCachingDisabled() const { return m_isResourceCachingDisabled; }
1414     void setResourceCachingDisabled(bool);
1415
1416     WebCore::UserInterfaceLayoutDirection userInterfaceLayoutDirection();
1417     void setUserInterfaceLayoutDirection(WebCore::UserInterfaceLayoutDirection);
1418
1419     bool hasHadSelectionChangesFromUserInteraction() const { return m_hasHadSelectionChangesFromUserInteraction; }
1420     bool isTouchBarUpdateSupressedForHiddenContentEditable() const { return m_isTouchBarUpdateSupressedForHiddenContentEditable; }
1421     bool isNeverRichlyEditableForTouchBar() const { return m_isNeverRichlyEditableForTouchBar; }
1422
1423     bool isAlwaysOnLoggingAllowed() const;
1424
1425 #if ENABLE(GAMEPAD)
1426     void gamepadActivity(const Vector<GamepadData>&, bool shouldMakeGamepadsVisible);
1427 #endif
1428
1429     void isLoadingChanged() { activityStateDidChange(WebCore::ActivityState::IsLoading); }
1430
1431     void clearUserMediaState();
1432
1433     void setShouldSkipWaitingForPaintAfterNextViewDidMoveToWindow(bool shouldSkip) { m_shouldSkipWaitingForPaintAfterNextViewDidMoveToWindow = shouldSkip; }
1434
1435     void setURLSchemeHandlerForScheme(Ref<WebURLSchemeHandler>&&, const String& scheme);
1436     WebURLSchemeHandler* urlSchemeHandlerForScheme(const String& scheme);
1437
1438 #if PLATFORM(COCOA)
1439     void createSandboxExtensionsIfNeeded(const Vector<String>& files, SandboxExtension::Handle& fileReadHandle, SandboxExtension::HandleArray& fileUploadHandles);
1440 #endif
1441     void editorStateChanged(const EditorState&);
1442     void updateEditorState(const EditorState&);
1443     void scheduleFullEditorStateUpdate();
1444     void dispatchDidReceiveEditorStateAfterFocus();
1445
1446 #if PLATFORM(COCOA)
1447     void touchBarMenuDataRemoved();
1448     void touchBarMenuDataChanged(const TouchBarMenuData&);
1449     void touchBarMenuItemDataAdded(const TouchBarMenuItemData&);
1450     void touchBarMenuItemDataRemoved(const TouchBarMenuItemData&);
1451 #endif
1452
1453 #if ENABLE(RESOURCE_LOAD_STATISTICS)
1454     void requestStorageAccessConfirm(const WebCore::RegistrableDomain& subFrameDomain, const WebCore::RegistrableDomain& topFrameDomain, uint64_t frameID, CompletionHandler<void(bool)>&&);
1455     void didCommitCrossSiteLoadWithDataTransferFromPrevalentResource();
1456 #endif
1457
1458 #if ENABLE(DEVICE_ORIENTATION)
1459     void shouldAllowDeviceOrientationAndMotionAccess(uint64_t frameID, WebCore::SecurityOriginData&&, bool mayPrompt, CompletionHandler<void(WebCore::DeviceOrientationOrMotionPermissionState)>&&);
1460 #endif
1461
1462     static WebPageProxy* nonEphemeralWebPageProxy();
1463
1464 #if ENABLE(ATTACHMENT_ELEMENT)
1465     RefPtr<API::Attachment> attachmentForIdentifier(const String& identifier) const;
1466     void insertAttachment(Ref<API::Attachment>&&, Function<void(CallbackBase::Error)>&&);
1467     void updateAttachmentAttributes(const API::Attachment&, Function<void(CallbackBase::Error)>&&);
1468     void serializedAttachmentDataForIdentifiers(const Vector<String>&, CompletionHandler<void(Vector<WebCore::SerializedAttachmentData>&&)>&&);
1469     void registerAttachmentIdentifier(const String&);
1470     void didInvalidateDataForAttachment(API::Attachment&);
1471
1472     enum class ShouldUpdateAttachmentAttributes : bool { No, Yes };
1473     ShouldUpdateAttachmentAttributes willUpdateAttachmentAttributes(const API::Attachment&);
1474 #endif
1475
1476 #if ENABLE(APPLICATION_MANIFEST)
1477     void getApplicationManifest(Function<void(const Optional<WebCore::ApplicationManifest>&, CallbackBase::Error)>&&);
1478 #endif
1479
1480     WebPreferencesStore preferencesStore() const;
1481
1482     void setDefersLoadingForTesting(bool);
1483
1484     bool isPageOpenedByDOMShowingInitialEmptyDocument() const;
1485
1486     WebCore::IntRect syncRootViewToScreen(const WebCore::IntRect& viewRect);
1487
1488 #if ENABLE(DATALIST_ELEMENT)
1489     void didSelectOption(const String&);
1490     void didCloseSuggestions();
1491 #endif
1492
1493     void updateCurrentModifierState();
1494
1495 #if HAVE(PENCILKIT)
1496     EditableImageController& editableImageController() { return *m_editableImageController; }
1497 #endif
1498
1499     ProvisionalPageProxy* provisionalPageProxy() const { return m_provisionalPage.get(); }
1500     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&);
1501
1502     // Logic shared between the WebPageProxy and the ProvisionalPageProxy.
1503     void didStartProvisionalLoadForFrameShared(Ref<WebProcessProxy>&&, uint64_t frameID, uint64_t navigationID, URL&&, URL&& unreachableURL, const UserData&);
1504     void didFailProvisionalLoadForFrameShared(Ref<WebProcessProxy>&&, uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, uint64_t navigationID, const String& provisionalURL, const WebCore::ResourceError&, WebCore::WillContinueLoading, const UserData&);
1505     void didReceiveServerRedirectForProvisionalLoadForFrameShared(Ref<WebProcessProxy>&&, uint64_t frameID, uint64_t navigationID, WebCore::ResourceRequest&&, const UserData&);
1506     void didPerformServerRedirectShared(Ref<WebProcessProxy>&&, const String& sourceURLString, const String& destinationURLString, uint64_t frameID);
1507     void didPerformClientRedirectShared(Ref<WebProcessProxy>&&, const String& sourceURLString, const String& destinationURLString, uint64_t frameID);
1508     void didNavigateWithNavigationDataShared(Ref<WebProcessProxy>&&, const WebNavigationDataStore&, uint64_t frameID);
1509     void didChangeProvisionalURLForFrameShared(Ref<WebProcessProxy>&&, uint64_t frameID, uint64_t navigationID, URL&&);
1510     void decidePolicyForNavigationActionAsyncShared(Ref<WebProcessProxy>&&, uint64_t frameID, WebCore::SecurityOriginData&& frameSecurityOrigin, WebCore::PolicyCheckIdentifier,
1511         uint64_t navigationID, NavigationActionData&&, FrameInfoData&&, Optional<WebCore::PageIdentifier> originatingPageID, const WebCore::ResourceRequest& originalRequest, WebCore::ResourceRequest&&,
1512         IPC::FormDataReference&& requestBody, WebCore::ResourceResponse&& redirectResponse, const UserData&, uint64_t listenerID);
1513     void decidePolicyForResponseShared(Ref<WebProcessProxy>&&, uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, WebCore::PolicyCheckIdentifier,
1514         uint64_t navigationID, const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, bool canShowMIMEType, const String& downloadAttribute, uint64_t listenerID, const UserData&);
1515     void startURLSchemeTaskShared(Ref<WebProcessProxy>&&, URLSchemeTaskParameters&&);
1516     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);
1517     void loadRequestWithNavigationShared(Ref<WebProcessProxy>&&, API::Navigation&, WebCore::ResourceRequest&&, WebCore::ShouldOpenExternalURLsPolicy, API::Object* userData, WebCore::ShouldTreatAsContinuingLoad, Optional<WebsitePoliciesData>&& = WTF::nullopt);
1518     void backForwardGoToItemShared(Ref<WebProcessProxy>&&, const WebCore::BackForwardItemIdentifier&, CompletionHandler<void(SandboxExtension::Handle&&)>&&);
1519     void decidePolicyForNavigationActionSyncShared(Ref<WebProcessProxy>&&, uint64_t frameID, bool isMainFrame, WebCore::SecurityOriginData&&, WebCore::PolicyCheckIdentifier, uint64_t navigationID, NavigationActionData&&,
1520         FrameInfoData&&, Optional<WebCore::PageIdentifier> originatingPageID, const WebCore::ResourceRequest& originalRequest, WebCore::ResourceRequest&&, IPC::FormDataReference&& requestBody,
1521         WebCore::ResourceResponse&& redirectResponse, const UserData&, Messages::WebPageProxy::DecidePolicyForNavigationActionSync::DelayedReply&&);
1522 #if USE(QUICK_LOOK)
1523     void didRequestPasswordForQuickLookDocumentInMainFrameShared(Ref<WebProcessProxy>&&, const String& fileName);
1524 #endif
1525 #if ENABLE(CONTENT_FILTERING)
1526     void contentFilterDidBlockLoadForFrameShared(Ref<WebProcessProxy>&&, const WebCore::ContentFilterUnblockHandler&, uint64_t frameID);
1527 #endif
1528
1529     void dumpAdClickAttribution(CompletionHandler<void(const String&)>&&);
1530     void clearAdClickAttribution(CompletionHandler<void()>&&);
1531     void setAdClickAttributionOverrideTimerForTesting(bool value, CompletionHandler<void()>&&);
1532     void setAdClickAttributionConversionURLForTesting(const URL&, CompletionHandler<void()>&&);
1533     void markAdClickAttributionsAsExpiredForTesting(CompletionHandler<void()>&&);
1534
1535 #if ENABLE(SPEECH_SYNTHESIS)
1536     void speechSynthesisVoiceList(CompletionHandler<void(Vector<WebSpeechSynthesisVoice>&&)>&&);
1537     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()>&&);
1538     void speechSynthesisCancel();
1539     void speechSynthesisPause(CompletionHandler<void()>&&);
1540     void speechSynthesisResume(CompletionHandler<void()>&&);
1541 #endif
1542
1543     void configureLoggingChannel(const String&, WTFLogChannelState, WTFLogLevel);
1544
1545     void addObserver(WebViewDidMoveToWindowObserver&);
1546     void removeObserver(WebViewDidMoveToWindowObserver&);
1547     void webViewDidMoveToWindow();
1548
1549 #if HAVE(APP_SSO)
1550     void setShouldSuppressSOAuthorizationInAllNavigationPolicyDecision() { m_shouldSuppressSOAuthorizationInAllNavigationPolicyDecision = true; }
1551     void setShouldSuppressSOAuthorizationInNextNavigationPolicyDecision() { m_shouldSuppressSOAuthorizationInNextNavigationPolicyDecision = true; }
1552 #endif
1553
1554     Logger& logger();
1555
1556     // IPC::MessageReceiver
1557     // Implemented in generated WebPageProxyMessageReceiver.cpp
1558     void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override;
1559     void didReceiveSyncMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&) override;
1560
1561     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)>&&);
1562
1563 private:
1564     WebPageProxy(PageClient&, WebProcessProxy&, WebCore::PageIdentifier, Ref<API::PageConfiguration>&&);
1565     void platformInitialize();
1566
1567     void notifyProcessPoolToPrewarm();
1568
1569     RefPtr<API::Navigation> goToBackForwardItem(WebBackForwardListItem&, WebCore::FrameLoadType);
1570
1571     void updateActivityState(OptionSet<WebCore::ActivityState::Flag> flagsToUpdate = WebCore::ActivityState::allFlags());
1572     void updateThrottleState();
1573     void updateHiddenPageThrottlingAutoIncreases();
1574
1575     bool suspendCurrentPageIfPossible(API::Navigation&, Optional<uint64_t> mainFrameID, ProcessSwapRequestedByClient, ShouldDelayClosingUntilEnteringAcceleratedCompositingMode);
1576
1577     enum class ResetStateReason {
1578         PageInvalidated,
1579         WebProcessExited,
1580         NavigationSwap,
1581     };
1582     void resetState(ResetStateReason);
1583     void resetStateAfterProcessExited(ProcessTerminationReason);
1584
1585     void setUserAgent(String&&);
1586
1587     // IPC::MessageSender
1588     bool sendMessage(std::unique_ptr<IPC::Encoder>, OptionSet<IPC::SendOption>) override;
1589     IPC::Connection* messageSenderConnection() const override;
1590     uint64_t messageSenderDestinationID() const override;
1591
1592     // WebPopupMenuProxy::Client
1593     void valueChangedForPopupMenu(WebPopupMenuProxy*, int32_t newSelectedIndex) override;
1594     void setTextFromItemForPopupMenu(WebPopupMenuProxy*, int32_t index) override;
1595 #if PLATFORM(GTK)
1596     void failedToShowPopupMenu() override;
1597 #endif
1598
1599 #if ENABLE(POINTER_LOCK)
1600     void requestPointerLock();
1601     void requestPointerUnlock();
1602 #endif
1603
1604     void didCreateMainFrame(uint64_t frameID);
1605     void didCreateSubframe(uint64_t frameID);
1606     void didCreateWindow(uint64_t frameID, WebCore::GlobalWindowIdentifier&&);
1607
1608     void didStartProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, URL&&, URL&& unreachableURL, const UserData&);
1609     void didReceiveServerRedirectForProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, WebCore::ResourceRequest&&, const UserData&);
1610     void willPerformClientRedirectForFrame(uint64_t frameID, const String& url, double delay, WebCore::LockBackForwardList);
1611     void didCancelClientRedirectForFrame(uint64_t frameID);
1612     void didChangeProvisionalURLForFrame(uint64_t frameID, uint64_t navigationID, URL&&);
1613     void didFailProvisionalLoadForFrame(uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, uint64_t navigationID, const String& provisionalURL, const WebCore::ResourceError&, WebCore::WillContinueLoading, const UserData&);
1614     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&);
1615     void didFinishDocumentLoadForFrame(uint64_t frameID, uint64_t navigationID, const UserData&);
1616     void didFinishLoadForFrame(uint64_t frameID, uint64_t navigationID, const UserData&);
1617     void didFailLoadForFrame(uint64_t frameID, uint64_t navigationID, const WebCore::ResourceError&, const UserData&);
1618     void didSameDocumentNavigationForFrame(uint64_t frameID, uint64_t navigationID, uint32_t sameDocumentNavigationType, URL&&, const UserData&);
1619     void didChangeMainDocument(uint64_t frameID);
1620     void didExplicitOpenForFrame(uint64_t frameID, URL&&);
1621
1622     void didReceiveTitleForFrame(uint64_t frameID, const String&, const UserData&);
1623     void didFirstLayoutForFrame(uint64_t frameID, const UserData&);
1624     void didFirstVisuallyNonEmptyLayoutForFrame(uint64_t frameID, const UserData&);
1625     void didDisplayInsecureContentForFrame(uint64_t frameID, const UserData&);
1626     void didRunInsecureContentForFrame(uint64_t frameID, const UserData&);
1627     void didDetectXSSForFrame(uint64_t frameID, const UserData&);
1628     void mainFramePluginHandlesPageScaleGestureDidChange(bool);
1629     void frameDidBecomeFrameSet(uint64_t frameID, bool);
1630     void didStartProgress();
1631     void didChangeProgress(double);
1632     void didFinishProgress();
1633     void setNetworkRequestsInProgress(bool);
1634
1635     void hasInsecureContent(CompletionHandler<void(WebCore::HasInsecureContent)>&&);
1636
1637     void didDestroyNavigation(uint64_t navigationID);
1638
1639     void decidePolicyForNavigationAction(Ref<WebProcessProxy>&&, WebFrameProxy&, WebCore::SecurityOriginData&&, uint64_t navigationID, NavigationActionData&&,
1640         FrameInfoData&&, Optional<WebCore::PageIdentifier> originatingPageID, const WebCore::ResourceRequest& originalRequest, WebCore::ResourceRequest&&, IPC::FormDataReference&& requestBody,
1641         WebCore::ResourceResponse&& redirectResponse, const UserData&, Ref<PolicyDecisionSender>&&);
1642     void decidePolicyForNavigationActionAsync(uint64_t frameID, WebCore::SecurityOriginData&&, WebCore::PolicyCheckIdentifier, uint64_t navigationID, NavigationActionData&&,
1643         FrameInfoData&&, Optional<WebCore::PageIdentifier> originatingPageID, const WebCore::ResourceRequest& originalRequest, WebCore::ResourceRequest&&, IPC::FormDataReference&& requestBody,
1644         WebCore::ResourceResponse&& redirectResponse, const UserData&, uint64_t listenerID);
1645     void decidePolicyForNavigationActionSync(uint64_t frameID, bool isMainFrame, WebCore::SecurityOriginData&&, WebCore::PolicyCheckIdentifier, uint64_t navigationID, NavigationActionData&&,
1646         FrameInfoData&&, Optional<WebCore::PageIdentifier> originatingPageID, const WebCore::ResourceRequest& originalRequest, WebCore::ResourceRequest&&, IPC::FormDataReference&& requestBody,
1647         WebCore::ResourceResponse&& redirectResponse, const UserData&, Messages::WebPageProxy::DecidePolicyForNavigationActionSync::DelayedReply&&);
1648     void decidePolicyForNewWindowAction(uint64_t frameID, const WebCore::SecurityOriginData&, WebCore::PolicyCheckIdentifier, NavigationActionData&&,
1649         WebCore::ResourceRequest&&, const String& frameName, uint64_t listenerID, const UserData&);
1650     void decidePolicyForResponse(uint64_t frameID, const WebCore::SecurityOriginData&, WebCore::PolicyCheckIdentifier, uint64_t navigationID,
1651         const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, bool canShowMIMEType, const String& downloadAttribute, uint64_t listenerID, const UserData&);
1652     void unableToImplementPolicy(uint64_t frameID, const WebCore::ResourceError&, const UserData&);
1653     void beginSafeBrowsingCheck(const URL&, bool, WebFramePolicyListenerProxy&);
1654
1655     WebContentMode effectiveContentModeAfterAdjustingPolicies(API::WebsitePolicies&, const WebCore::ResourceRequest&);
1656
1657     void willSubmitForm(uint64_t frameID, uint64_t sourceFrameID, const Vector<std::pair<String, String>>& textFieldValues, uint64_t listenerID, const UserData&);
1658
1659     void contentRuleListNotification(URL&&, WebCore::ContentRuleListResults&&);
1660
1661     // History client
1662     void didNavigateWithNavigationData(const WebNavigationDataStore&, uint64_t frameID);
1663     void didPerformClientRedirect(const String& sourceURLString, const String& destinationURLString, uint64_t frameID);
1664     void didPerformServerRedirect(const String& sourceURLString, const String& destinationURLString, uint64_t frameID);
1665     void didUpdateHistoryTitle(const String& title, const String& url, uint64_t frameID);
1666
1667     // UI client
1668     void createNewPage(const FrameInfoData&, Optional<WebCore::PageIdentifier> originatingPageID, WebCore::ResourceRequest&&, WebCore::WindowFeatures&&, NavigationActionData&&, Messages::WebPageProxy::CreateNewPage::DelayedReply&&);
1669     void showPage();
1670     void runJavaScriptAlert(uint64_t frameID, const WebCore::SecurityOriginData&, const String&, Messages::WebPageProxy::RunJavaScriptAlert::DelayedReply&&);
1671     void runJavaScriptConfirm(uint64_t frameID, const WebCore::SecurityOriginData&, const String&, Messages::WebPageProxy::RunJavaScriptConfirm::DelayedReply&&);
1672     void runJavaScriptPrompt(uint64_t frameID, const WebCore::SecurityOriginData&, const String&, const String&, Messages::WebPageProxy::RunJavaScriptPrompt::DelayedReply&&);
1673     void setStatusText(const String&);
1674     void mouseDidMoveOverElement(WebHitTestResultData&&, uint32_t modifiers, UserData&&);
1675
1676 #if ENABLE(NETSCAPE_PLUGIN_API)
1677     void unavailablePluginButtonClicked(uint32_t opaquePluginUnavailabilityReason, const String& mimeType, const String& pluginURLString, const String& pluginsPageURLString, const String& frameURLString, const String& pageURLString);
1678 #endif // ENABLE(NETSCAPE_PLUGIN_API)
1679 #if ENABLE(WEBGL)
1680     void webGLPolicyForURL(URL&&, Messages::WebPageProxy::WebGLPolicyForURL::DelayedReply&&);
1681     void resolveWebGLPolicyForURL(URL&&, Messages::WebPageProxy::ResolveWebGLPolicyForURL::DelayedReply&&);
1682 #endif // ENABLE(WEBGL)
1683     void setToolbarsAreVisible(bool toolbarsAreVisible);
1684     void getToolbarsAreVisible(Messages::WebPageProxy::GetToolbarsAreVisible::DelayedReply&&);
1685     void setMenuBarIsVisible(bool menuBarIsVisible);
1686     void getMenuBarIsVisible(Messages::WebPageProxy::GetMenuBarIsVisible::DelayedReply&&);
1687     void setStatusBarIsVisible(bool statusBarIsVisible);
1688     void getStatusBarIsVisible(Messages::WebPageProxy::GetStatusBarIsVisible::DelayedReply&&);
1689     void getIsViewVisible(bool&);
1690     void setIsResizable(bool isResizable);
1691     void screenToRootView(const WebCore::IntPoint& screenPoint, Messages::WebPageProxy::ScreenToRootView::DelayedReply&&);
1692     void rootViewToScreen(const WebCore::IntRect& viewRect, Messages::WebPageProxy::RootViewToScreen::DelayedReply&&);
1693     void accessibilityScreenToRootView(const WebCore::IntPoint& screenPoint, CompletionHandler<void(WebCore::IntPoint)>&&);
1694     void rootViewToAccessibilityScreen(const WebCore::IntRect& viewRect, CompletionHandler<void(WebCore::IntRect)>&&);
1695     void runBeforeUnloadConfirmPanel(uint64_t frameID, const WebCore::SecurityOriginData&, const String& message, Messages::WebPageProxy::RunBeforeUnloadConfirmPanel::DelayedReply&&);
1696     void didChangeViewportProperties(const WebCore::ViewportAttributes&);
1697     void pageDidScroll();
1698     void runOpenPanel(uint64_t frameID, const WebCore::SecurityOriginData&, const WebCore::FileChooserSettings&);
1699     void showShareSheet(const WebCore::ShareDataWithParsedURL&, ShareSheetCallbackID);
1700     void printFrame(uint64_t frameID, CompletionHandler<void()>&&);
1701     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&&);
1702     void reachedApplicationCacheOriginQuota(const String& originIdentifier, uint64_t currentQuota, uint64_t totalBytesNeeded, Messages::WebPageProxy::ReachedApplicationCacheOriginQuota::DelayedReply&&);
1703     void requestGeolocationPermissionForFrame(uint64_t geolocationID, uint64_t frameID, String originIdentifier);
1704
1705 #if ENABLE(MEDIA_STREAM)
1706     UserMediaPermissionRequestManagerProxy& userMediaPermissionRequestManager();
1707 #endif
1708     void requestUserMediaPermissionForFrame(uint64_t userMediaID, uint64_t frameID, const WebCore::SecurityOriginData& userMediaDocumentOriginIdentifier, const WebCore::SecurityOriginData& topLevelDocumentOriginIdentifier, WebCore::MediaStreamRequest&&);
1709     void enumerateMediaDevicesForFrame(uint64_t userMediaID, uint64_t frameID, const WebCore::SecurityOriginData& userMediaDocumentOriginData, const WebCore::SecurityOriginData& topLevelDocumentOriginData);
1710     void beginMonitoringCaptureDevices();
1711
1712     void runModal();
1713     void notifyScrollerThumbIsVisibleInRect(const WebCore::IntRect&);
1714     void recommendedScrollbarStyleDidChange(int32_t newStyle);
1715     void didChangeScrollbarsForMainFrame(bool hasHorizontalScrollbar, bool hasVerticalScrollbar);
1716     void didChangeScrollOffsetPinningForMainFrame(bool pinnedToLeftSide, bool pinnedToRightSide, bool pinnedToTopSide, bool pinnedToBottomSide);
1717     void didChangePageCount(unsigned);
1718     void pageExtendedBackgroundColorDidChange(const WebCore::Color&);
1719 #if ENABLE(NETSCAPE_PLUGIN_API)
1720     void didFailToInitializePlugin(const String& mimeType, const String& frameURLString, const String& pageURLString);
1721     void didBlockInsecurePluginVersion(const String& mimeType, const String& pluginURLString, const String& frameURLString, const String& pageURLString, bool replacementObscured);
1722 #endif // ENABLE(NETSCAPE_PLUGIN_API)
1723     void setCanShortCircuitHorizontalWheelEvents(bool canShortCircuitHorizontalWheelEvents) { m_canShortCircuitHorizontalWheelEvents = canShortCircuitHorizontalWheelEvents; }
1724
1725     void launchProcess(const WebCore::RegistrableDomain&);
1726     void swapToWebProcess(Ref<WebProcessProxy>&&, std::unique_ptr<DrawingAreaProxy>&&, RefPtr<WebFrameProxy>&& mainFrame);
1727     void didFailToSuspendAfterProcessSwap();
1728     void didSuspendAfterProcessSwap();
1729
1730     enum class IsProcessSwap { No, Yes };
1731     void finishAttachingToWebProcess(IsProcessSwap);
1732
1733     RefPtr<API::Navigation> launchProcessForReload();
1734     RefPtr<API::Navigation> launchProcessWithItem(WebBackForwardListItem&);
1735
1736     void requestNotificationPermission(uint64_t notificationID, const String& originString);
1737     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);
1738     void cancelNotification(uint64_t notificationID);
1739     void clearNotifications(const Vector<uint64_t>& notificationIDs);
1740     void didDestroyNotification(uint64_t notificationID);
1741
1742     void didChangeContentSize(const WebCore::IntSize&);
1743     void didChangeIntrinsicContentSize(const WebCore::IntSize&);
1744
1745 #if ENABLE(INPUT_TYPE_COLOR)
1746     void showColorPicker(const WebCore::Color& initialColor, const WebCore::IntRect&, Vector<WebCore::Color>&&);
1747     void didChooseColor(const WebCore::Color&) override;
1748     void didEndColorPicker() override;
1749 #endif
1750
1751 #if ENABLE(DATALIST_ELEMENT)
1752     void showDataListSuggestions(WebCore::DataListSuggestionInformation&&);
1753     void handleKeydownInDataList(const String&);
1754     void endDataListSuggestions();
1755 #endif
1756
1757     void closeOverlayedViews();
1758
1759     void compositionWasCanceled();
1760     void setHasHadSelectionChangesFromUserInteraction(bool);
1761     void setIsTouchBarUpdateSupressedForHiddenContentEditable(bool);
1762     void setIsNeverRichlyEditableForTouchBar(bool);
1763
1764     void requestDOMPasteAccess(const WebCore::IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&);
1765
1766     // Back/Forward list management
1767     void backForwardAddItem(BackForwardListItemState&&);
1768     void backForwardGoToItem(const WebCore::BackForwardItemIdentifier&, CompletionHandler<void(SandboxExtension::Handle&&)>&&);
1769     void backForwardItemAtIndex(int32_t index, CompletionHandler<void(Optional<WebCore::BackForwardItemIdentifier>&&)>&&);
1770     void backForwardBackListCount(CompletionHandler<void(uint32_t)>&&);
1771     void backForwardForwardListCount(CompletionHandler<void(uint32_t)>&&);
1772     void backForwardClear();
1773
1774     // Undo management
1775     void registerEditCommandForUndo(WebUndoStepID commandID, const String& label);
1776     void registerInsertionUndoGrouping();
1777     void clearAllEditCommands();
1778     void canUndoRedo(UndoOrRedo, CompletionHandler<void(bool)>&&);
1779     void executeUndoRedo(UndoOrRedo, CompletionHandler<void()>&&);
1780
1781     // Keyboard handling
1782 #if PLATFORM(COCOA)
1783     void executeSavedCommandBySelector(const String& selector, CompletionHandler<void(bool)>&&);
1784 #endif
1785
1786 #if PLATFORM(GTK)
1787     void getEditorCommandsForKeyEvent(const AtomString&, Vector<String>&);
1788 #endif
1789
1790 #if USE(ATK)
1791     void bindAccessibilityTree(const String&);
1792     void showEmojiPicker(const WebCore::IntRect&, CompletionHandler<void(String)>&&);
1793 #endif
1794
1795     // Popup Menu.
1796     void showPopupMenu(const WebCore::IntRect& rect, uint64_t textDirection, const Vector<WebPopupItem>& items, int32_t selectedIndex, const PlatformPopupMenuData&);
1797     void hidePopupMenu();
1798
1799 #if ENABLE(CONTEXT_MENUS)
1800     void showContextMenu(ContextMenuContextData&&, const UserData&);
1801 #endif
1802
1803 #if ENABLE(TELEPHONE_NUMBER_DETECTION)
1804 #if PLATFORM(MAC)
1805     void showTelephoneNumberMenu(const String& telephoneNumber, const WebCore::IntPoint&);
1806 #endif
1807 #endif
1808
1809     // Search popup results
1810     void saveRecentSearches(const String&, const Vector<WebCore::RecentSearch>&);
1811     void loadRecentSearches(const String&, CompletionHandler<void(Vector<WebCore::RecentSearch>&&)>&&);
1812
1813 #if PLATFORM(COCOA)
1814     // Speech.
1815     void getIsSpeaking(CompletionHandler<void(bool)>&&);
1816     void speak(const String&);
1817     void stopSpeaking();
1818
1819     // Spotlight.
1820     void searchWithSpotlight(const String&);
1821         
1822     void searchTheWeb(const String&);
1823
1824     // Dictionary.
1825     void didPerformDictionaryLookup(const WebCore::DictionaryPopupInfo&);
1826 #endif
1827
1828 #if PLATFORM(MAC)
1829     bool appleMailPaginationQuirkEnabled();
1830 #endif
1831
1832 #if PLATFORM(MAC)
1833     // FIXME: Need to support iOS too, but there is no isAppleMail for iOS.
1834     bool appleMailLinesClampEnabled();
1835 #endif
1836
1837     // Spelling and grammar.
1838     void checkSpellingOfString(const String& text, CompletionHandler<void(int32_t misspellingLocation, int32_t misspellingLength)>&&);
1839     void checkGrammarOfString(const String& text, CompletionHandler<void(Vector<WebCore::GrammarDetail>&&, int32_t badGrammarLocation, int32_t badGrammarLength)>&&);
1840     void spellingUIIsShowing(CompletionHandler<void(bool)>&&);
1841     void updateSpellingUIWithMisspelledWord(const String& misspelledWord);
1842     void updateSpellingUIWithGrammarString(const String& badGrammarPhrase, const WebCore::GrammarDetail&);
1843     void learnWord(const String& word);
1844     void ignoreWord(const String& word);
1845     void requestCheckingOfString(uint64_t requestID, const WebCore::TextCheckingRequestData&, int32_t insertionPoint);
1846
1847     void takeFocus(uint32_t direction);
1848     void setToolTip(const String&);
1849     void setCursor(const WebCore::Cursor&);
1850     void setCursorHiddenUntilMouseMoves(bool);
1851
1852     void didReceiveEvent(uint32_t opaqueType, bool handled);
1853
1854     void voidCallback(CallbackID);
1855     void dataCallback(const IPC::DataReference&, CallbackID);
1856     void imageCallback(const ShareableBitmap::Handle&, CallbackID);
1857     void stringCallback(const String&, CallbackID);
1858     void invalidateStringCallback(CallbackID);
1859     void scriptValueCallback(const IPC::DataReference&, bool hadException, const WebCore::ExceptionDetails&, CallbackID);
1860     void computedPagesCallback(const Vector<WebCore::IntRect>&, double totalScaleFactorForPrinting, const WebCore::FloatBoxExtent& computedPageMargin, CallbackID);
1861     void validateCommandCallback(const String&, bool, int, CallbackID);
1862     void unsignedCallback(uint64_t, CallbackID);
1863     void editingRangeCallback(const EditingRange&, CallbackID);
1864 #if ENABLE(APPLICATION_MANIFEST)
1865     void applicationManifestCallback(const Optional<WebCore::ApplicationManifest>&, CallbackID);
1866 #endif
1867 #if PLATFORM(COCOA)
1868     void machSendRightCallback(const WTF::MachSendRight&, CallbackID);
1869 #endif
1870     void rectForCharacterRangeCallback(const WebCore::IntRect&, const EditingRange&, CallbackID);
1871 #if PLATFORM(MAC)
1872     void attributedStringForCharacterRangeCallback(const AttributedString&, const EditingRange&, CallbackID);
1873     void fontAtSelectionCallback(const String&, double, bool, CallbackID);
1874 #endif
1875 #if PLATFORM(IOS_FAMILY)
1876     void gestureCallback(const WebCore::IntPoint&, uint32_t gestureType, uint32_t gestureState, uint32_t flags, CallbackID);
1877     void touchesCallback(const WebCore::IntPoint&, uint32_t touches, uint32_t flags, CallbackID);
1878     void selectionContextCallback(const String& selectedText, const String& beforeText, const String& afterText, CallbackID);
1879     void interpretKeyEvent(const EditorState&, bool isCharEvent, CompletionHandler<void(bool)>&&);
1880     void showPlaybackTargetPicker(bool hasVideo, const WebCore::IntRect& elementRect, WebCore::RouteSharingPolicy, const String&);
1881     void selectionRectsCallback(const Vector<WebCore::SelectionRect>&, CallbackID);
1882
1883     void updateStringForFind(const String&);
1884 #endif
1885 #if PLATFORM(GTK)
1886     void printFinishedCallback(const WebCore::ResourceError&, CallbackID);
1887 #endif
1888
1889     void focusedFrameChanged(uint64_t frameID);
1890     void frameSetLargestFrameChanged(uint64_t frameID);
1891
1892     void didFinishLoadingDataForCustomContentProvider(const String& suggestedFilename, const IPC::DataReference&);
1893
1894 #if PLATFORM(COCOA)
1895     void pluginFocusOrWindowFocusChanged(uint64_t pluginComplexTextInputIdentifier, bool pluginHasFocusAndWindowHasFocus);
1896     void setPluginComplexTextInputState(uint64_t pluginComplexTextInputIdentifier, uint64_t complexTextInputState);
1897 #endif
1898
1899     bool maybeInitializeSandboxExtensionHandle(WebProcessProxy&, const URL&, SandboxExtension::Handle&);
1900
1901 #if USE(AUTOMATIC_TEXT_REPLACEMENT)
1902     void toggleSmartInsertDelete();
1903     void toggleAutomaticQuoteSubstitution();
1904     void toggleAutomaticLinkDetection();
1905     void toggleAutomaticDashSubstitution();
1906     void toggleAutomaticTextReplacement();
1907 #endif
1908
1909 #if PLATFORM(MAC)
1910     void substitutionsPanelIsShowing(CompletionHandler<void(bool)>&&);
1911     void showCorrectionPanel(int32_t panelType, const WebCore::FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, const Vector<String>& alternativeReplacementStrings);
1912     void dismissCorrectionPanel(int32_t reason);
1913     void dismissCorrectionPanelSoon(int32_t reason, CompletionHandler<void(String)>&&);
1914     void recordAutocorrectionResponse(int32_t responseType, const String& replacedString, const String& replacementString);
1915
1916 #if USE(DICTATION_ALTERNATIVES)
1917     void showDictationAlternativeUI(const WebCore::FloatRect& boundingBoxOfDictatedText, uint64_t dictationContext);
1918     void removeDictationAlternatives(uint64_t dictationContext);
1919     void dictationAlternatives(uint64_t dictationContext, CompletionHandler<void(Vector<String>&&)>&&);
1920 #endif
1921
1922     void setEditableElementIsFocused(bool);
1923 #endif // PLATFORM(MAC)
1924
1925 #if PLATFORM(IOS_FAMILY)
1926     WebCore::FloatSize screenSize();
1927     WebCore::FloatSize availableScreenSize();
1928     WebCore::FloatSize overrideScreenSize();
1929     float textAutosizingWidth();
1930
1931     void couldNotRestorePageState();
1932     void restorePageState(Optional<WebCore::FloatPoint> scrollPosition, const WebCore::FloatPoint& scrollOrigin, const WebCore::FloatBoxExtent& obscuredInsetsOnSave, double scale);
1933     void restorePageCenterAndScale(Optional<WebCore::FloatPoint>, double scale);
1934
1935     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);
1936
1937     void elementDidFocus(const FocusedElementInformation&, bool userIsInteracting, bool blurPreviousNode, OptionSet<WebCore::ActivityState::Flag> activityStateChanges, const UserData&);
1938     void elementDidBlur();
1939     void focusedElementDidChangeInputMode(WebCore::InputMode);
1940     void didReceiveEditorStateUpdateAfterFocus();
1941
1942     void showInspectorHighlight(const WebCore::Highlight&);
1943     void hideInspectorHighlight();
1944
1945     void enableInspectorNodeSearch();
1946     void disableInspectorNodeSearch();
1947     void focusedElementInformationCallback(const FocusedElementInformation&, CallbackID);
1948 #endif // PLATFORM(IOS_FAMILY)
1949
1950 #if ENABLE(DATA_DETECTION)
1951     RetainPtr<NSArray> m_dataDetectionResults;
1952 #endif
1953
1954     void clearLoadDependentCallbacks();
1955
1956     void performDragControllerAction(DragControllerAction, WebCore::DragData&, const String& dragStorageName, SandboxExtension::Handle&&, SandboxExtension::HandleArray&&);
1957
1958     void updateBackingStoreDiscardableState();
1959
1960     void setRenderTreeSize(uint64_t treeSize) { m_renderTreeSize = treeSize; }
1961
1962 #if PLATFORM(X11)
1963     void createPluginContainer(CompletionHandler<void(uint64_t)>&&);
1964     void windowedPluginGeometryDidChange(const WebCore::IntRect& frameRect, const WebCore::IntRect& clipRect, uint64_t windowID);
1965     void windowedPluginVisibilityDidChange(bool isVisible, uint64_t windowID);
1966 #endif
1967
1968     void processNextQueuedWheelEvent();
1969     void sendWheelEvent(const WebWheelEvent&);
1970     bool shouldProcessWheelEventNow(const WebWheelEvent&) const;
1971
1972 #if ENABLE(TOUCH_EVENTS)
1973     void updateTouchEventTracking(const WebTouchEvent&);
1974     WebCore::TrackingType touchEventTrackingType(const WebTouchEvent&) const;
1975 #endif
1976
1977 #if ENABLE(NETSCAPE_PLUGIN_API)
1978     void findPlugin(const String& mimeType, uint32_t processType, const String& urlString, const String& frameURLString, const String& pageURLString, bool allowOnlyApplicationPlugins, Messages::WebPageProxy::FindPlugin::DelayedReply&&);
1979 #endif
1980
1981 #if USE(QUICK_LOOK)
1982     void didStartLoadForQuickLookDocumentInMainFrame(const String& fileName, const String& uti);
1983     void didFinishLoadForQuickLookDocumentInMainFrame(const QuickLookDocumentData&);
1984     void didRequestPasswordForQuickLookDocumentInMainFrame(const String& fileName);
1985 #endif
1986
1987 #if ENABLE(CONTENT_FILTERING)
1988     void contentFilterDidBlockLoadForFrame(const WebCore::ContentFilterUnblockHandler&, uint64_t frameID);
1989 #endif
1990
1991     void tryReloadAfterProcessTermination();
1992     void resetRecentCrashCountSoon();
1993     void resetRecentCrashCount();
1994
1995     API::DiagnosticLoggingClient* effectiveDiagnosticLoggingClient(WebCore::ShouldSample);
1996
1997     void dispatchActivityStateChange();
1998     void viewDidLeaveWindow();
1999     void viewDidEnterWindow();
2000
2001 #if PLATFORM(MAC)
2002     void didPerformImmediateActionHitTest(const WebHitTestResultData&, bool contentPreventsDefault, const UserData&);
2003 #endif
2004
2005     void useFixedLayoutDidChange(bool useFixedLayout) { m_useFixedLayout = useFixedLayout; }
2006     void fixedLayoutSizeDidChange(WebCore::IntSize fixedLayoutSize) { m_fixedLayoutSize = fixedLayoutSize; }
2007
2008     void imageOrMediaDocumentSizeChanged(const WebCore::IntSize&);
2009 #if ENABLE(VIDEO) && USE(GSTREAMER)
2010     void requestInstallMissingMediaPlugins(const String& details, const String& description);
2011 #endif
2012
2013     void startURLSchemeTask(URLSchemeTaskParameters&&);
2014     void stopURLSchemeTask(uint64_t handlerIdentifier, uint64_t taskIdentifier);
2015     void loadSynchronousURLSchemeTask(URLSchemeTaskParameters&&, Messages::WebPageProxy::LoadSynchronousURLSchemeTask::DelayedReply&&);
2016
2017     bool checkURLReceivedFromCurrentOrPreviousWebProcess(WebProcessProxy&, const String&);
2018     bool checkURLReceivedFromCurrentOrPreviousWebProcess(WebProcessProxy&, const URL&);
2019     void willAcquireUniversalFileReadSandboxExtension(WebProcessProxy&);
2020
2021     void handleAutoFillButtonClick(const UserData&);
2022
2023     void didResignInputElementStrongPasswordAppearance(const UserData&);
2024
2025     void handleMessage(IPC::Connection&, const String& messageName, const UserData& messageBody);
2026     void handleSynchronousMessage(IPC::Connection&, const String& messageName, const UserData& messageBody, CompletionHandler<void(UserData&&)>&&);
2027
2028     void viewIsBecomingVisible();
2029
2030     void stopAllURLSchemeTasks(WebProcessProxy* = nullptr);
2031
2032     void clearInspectorTargets();
2033     void createInspectorTargets();
2034
2035 #if ENABLE(ATTACHMENT_ELEMENT)
2036     void registerAttachmentIdentifierFromData(const String&, const String& contentType, const String& preferredFileName, const IPC::DataReference&);
2037     void registerAttachmentIdentifierFromFilePath(const String&, const String& contentType, const String& filePath);
2038     void registerAttachmentsFromSerializedData(Vector<WebCore::SerializedAttachmentData>&&);
2039     void cloneAttachmentData(const String& fromIdentifier, const String& toIdentifier);
2040
2041     void platformRegisterAttachment(Ref<API::Attachment>&&, const String& preferredFileName, const IPC::DataReference&);
2042     void platformRegisterAttachment(Ref<API::Attachment>&&, const String& filePath);
2043     void platformCloneAttachment(Ref<API::Attachment>&& fromAttachment, Ref<API::Attachment>&& toAttachment);
2044
2045     void didInsertAttachmentWithIdentifier(const String& identifier, const String& source, bool hasEnclosingImage);
2046     void didRemoveAttachmentWithIdentifier(const String& identifier);
2047     void didRemoveAttachment(API::Attachment&);
2048     Ref<API::Attachment> ensureAttachment(const String& identifier);
2049     void invalidateAllAttachments();
2050 #endif
2051
2052     void reportPageLoadResult(const WebCore::ResourceError& = { });
2053
2054     void continueNavigationInNewProcess(API::Navigation&, std::unique_ptr<SuspendedPageProxy>&&, Ref<WebProcessProxy>&&, ProcessSwapRequestedByClient, Optional<WebsitePoliciesData>&&);
2055
2056     void setNeedsFontAttributes(bool);
2057     void updateFontAttributesAfterEditorStateChange();
2058
2059     void didAttachToRunningProcess();
2060
2061 #if ENABLE(RESOURCE_LOAD_STATISTICS)
2062     void logFrameNavigation(const WebFrameProxy&, const URL& pageURL, const WebCore::ResourceRequest&, const URL& redirectURL);
2063 #endif
2064
2065     // WebPaymentCoordinatorProxy::Client
2066 #if ENABLE(APPLE_PAY)
2067     IPC::Connection* paymentCoordinatorConnection(const WebPaymentCoordinatorProxy&) final;
2068     const String& paymentCoordinatorBoundInterfaceIdentifier(const WebPaymentCoordinatorProxy&, PAL::SessionID) final;
2069     const String& paymentCoordinatorSourceApplicationBundleIdentifier(const WebPaymentCoordinatorProxy&, PAL::SessionID) final;
2070     const String& paymentCoordinatorSourceApplicationSecondaryIdentifier(const WebPaymentCoordinatorProxy&, PAL::SessionID) final;
2071     void paymentCoordinatorAddMessageReceiver(WebPaymentCoordinatorProxy&, const IPC::StringReference&, IPC::MessageReceiver&) final;
2072     void paymentCoordinatorRemoveMessageReceiver(WebPaymentCoordinatorProxy&, const IPC::StringReference&) final;
2073 #endif
2074 #if ENABLE(APPLE_PAY) && PLATFORM(IOS_FAMILY)
2075     UIViewController *paymentCoordinatorPresentingViewController(const WebPaymentCoordinatorProxy&) final;
2076     const String& paymentCoordinatorCTDataConnectionServiceType(const WebPaymentCoordinatorProxy&, PAL::SessionID) final;
2077     std::unique_ptr<PaymentAuthorizationPresenter> paymentCoordinatorAuthorizationPresenter(WebPaymentCoordinatorProxy&, PKPaymentRequest *) final;
2078 #endif
2079 #if ENABLE(APPLE_PAY) && PLATFORM(MAC)
2080     NSWindow *paymentCoordinatorPresentingWindow(const WebPaymentCoordinatorProxy&) final;
2081 #endif
2082
2083 #if ENABLE(SPEECH_SYNTHESIS)
2084     void didStartSpeaking(WebCore::PlatformSpeechSynthesisUtterance&) override;
2085     void didFinishSpeaking(WebCore::PlatformSpeechSynthesisUtterance&) override;
2086     void didPauseSpeaking(WebCore::PlatformSpeechSynthesisUtterance&) override;
2087     void didResumeSpeaking(WebCore::PlatformSpeechSynthesisUtterance&) override;
2088     void speakingErrorOccurred(WebCore::PlatformSpeechSynthesisUtterance&) override;
2089     void boundaryEventOccurred(WebCore::PlatformSpeechSynthesisUtterance&, WebCore::SpeechBoundary, unsigned charIndex) override;
2090     void voicesDidChange() override;
2091
2092     struct SpeechSynthesisData;
2093     SpeechSynthesisData& speechSynthesisData();
2094 #endif
2095
2096 #if PLATFORM(IOS_FAMILY)
2097     static bool isInHardwareKeyboardMode();
2098 #endif
2099
2100     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)>&&);
2101
2102     WeakPtr<PageClient> m_pageClient;
2103     Ref<API::PageConfiguration> m_configuration;
2104
2105     std::unique_ptr<API::LoaderClient> m_loaderClient;
2106     std::unique_ptr<API::PolicyClient> m_policyClient;
2107     UniqueRef<API::NavigationClient> m_navigationClient;
2108     UniqueRef<API::HistoryClient> m_historyClient;
2109     std::unique_ptr<API::IconLoadingClient> m_iconLoadingClient;
2110     std::unique_ptr<API::FormClient> m_formClient;
2111     std::unique_ptr<API::UIClient> m_uiClient;
2112     std::unique_ptr<API::FindClient> m_findClient;
2113     std::unique_ptr<API::FindMatchesClient> m_findMatchesClient;
2114     std::unique_ptr<API::DiagnosticLoggingClient> m_diagnosticLoggingClient;
2115 #if ENABLE(CONTEXT_MENUS)
2116     std::unique_ptr<API::ContextMenuClient> m_contextMenuClient;
2117 #endif
2118     std::unique_ptr<WebPageInjectedBundleClient> m_injectedBundleClient;
2119
2120     std::unique_ptr<WebNavigationState> m_navigationState;
2121     String m_failingProvisionalLoadURL;
2122     bool m_isLoadingAlternateHTMLStringForFailingProvisionalLoad { false };
2123
2124     std::unique_ptr<DrawingAreaProxy> m_drawingArea;
2125 #if PLATFORM(COCOA)
2126     std::unique_ptr<RemoteLayerTreeHost> m_frozenRemoteLayerTreeHost;
2127 #if ENABLE(ASYNC_SCROLLING)
2128     std::unique_ptr<RemoteScrollingCoordinatorProxy> m_scrollingCoordinatorProxy;
2129 #endif
2130 #endif
2131     Ref<WebProcessProxy> m_process;
2132     Ref<WebPageGroup> m_pageGroup;
2133     Ref<WebPreferences> m_preferences;
2134
2135     WebProcessLifetimeTracker m_webProcessLifetimeTracker { *this };
2136
2137     Ref<WebUserContentControllerProxy> m_userContentController;
2138     Ref<VisitedLinkStore> m_visitedLinkStore;
2139     Ref<WebsiteDataStore> m_websiteDataStore;
2140
2141     RefPtr<WebFrameProxy> m_mainFrame;
2142
2143     RefPtr<WebFrameProxy> m_focusedFrame;
2144     RefPtr<WebFrameProxy> m_frameSetLargestFrame;
2145
2146     String m_userAgent;
2147     String m_applicationNameForUserAgent;
2148     String m_applicationNameForDesktopUserAgent;
2149     String m_customUserAgent;
2150     String m_customTextEncodingName;
2151     String m_overrideContentSecurityPolicy;
2152
2153     bool m_treatsSHA1CertificatesAsInsecure { true };
2154
2155     RefPtr<WebInspectorProxy> m_inspector;
2156
2157 #if ENABLE(FULLSCREEN_API)
2158     std::unique_ptr<WebFullScreenManagerProxy> m_fullScreenManager;
2159     std::unique_ptr<API::FullscreenClient> m_fullscreenClient;
2160 #endif
2161
2162 #if (PLATFORM(IOS_FAMILY) && HAVE(AVKIT)) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
2163     RefPtr<PlaybackSessionManagerProxy> m_playbackSessionManager;
2164     RefPtr<VideoFullscreenManagerProxy> m_videoFullscreenManager;
2165 #endif
2166
2167 #if PLATFORM(IOS_FAMILY)
2168     Optional<WebCore::ViewportArguments> m_overrideViewportArguments;
2169     VisibleContentRectUpdateInfo m_lastVisibleContentRectUpdate;
2170     uint64_t m_firstLayerTreeTransactionIdAfterDidCommitLoad { 0 };
2171     int32_t m_deviceOrientation { 0 };
2172     bool m_hasReceivedLayerTreeTransactionAfterDidCommitLoad { true };
2173     bool m_hasNetworkRequestsOnSuspended { false };
2174     bool m_isKeyboardAnimatingIn { false };
2175     bool m_isScrollingOrZooming { false };
2176 #endif
2177         
2178 #if PLATFORM(MAC)
2179     bool m_useSystemAppearance { false };
2180 #endif
2181
2182 #if ENABLE(APPLE_PAY)
2183     std::unique_ptr<WebPaymentCoordinatorProxy> m_paymentCoordinator;
2184 #endif
2185
2186 #if USE(SYSTEM_PREVIEW)
2187     std::unique_ptr<SystemPreviewController> m_systemPreviewController;
2188 #endif
2189
2190 #if ENABLE(WEB_AUTHN)
2191     std::unique_ptr<WebAuthenticatorCoordinatorProxy> m_credentialsMessenger;
2192 #endif
2193
2194     CallbackMap m_callbacks;
2195     HashSet<CallbackID> m_loadDependentStringCallbackIDs;
2196
2197     HashSet<WebEditCommandProxy*> m_editCommandSet;
2198
2199 #if PLATFORM(COCOA)
2200     HashSet<String> m_knownKeypressCommandNames;
2201 #endif
2202
2203     RefPtr<WebPopupMenuProxy> m_activePopupMenu;
2204 #if ENABLE(CONTEXT_MENUS)
2205     RefPtr<WebContextMenuProxy> m_activeContextMenu;
2206     ContextMenuContextData m_activeContextMenuContextData;
2207 #endif
2208     RefPtr<API::HitTestResult> m_lastMouseMoveHitTestResult;
2209
2210     RefPtr<WebOpenPanelResultListenerProxy> m_openPanelResultListener;
2211     GeolocationPermissionRequestManagerProxy m_geolocationPermissionRequestManager;
2212     NotificationPermissionRequestManagerProxy m_notificationPermissionRequestManager;
2213
2214 #if ENABLE(MEDIA_STREAM)
2215     std::unique_ptr<UserMediaPermissionRequestManagerProxy> m_userMediaPermissionRequestManager;
2216 #endif
2217
2218     OptionSet<WebCore::ActivityState::Flag> m_activityState;
2219     bool m_viewWasEverInWindow { false };
2220 #if PLATFORM(IOS_FAMILY)
2221     bool m_allowsMediaDocumentInlinePlayback { false };
2222     bool m_alwaysRunsAtForegroundPriority { false };
2223     ProcessThrottler::ForegroundActivityToken m_activityToken;
2224 #endif
2225     bool m_initialCapitalizationEnabled { false };
2226     Optional<double> m_cpuLimit;
2227     Ref<WebBackForwardList> m_backForwardList;
2228         
2229     bool m_maintainsInactiveSelection { false };
2230
2231     bool m_waitsForPaintAfterViewDidMoveToWindow { false };
2232     bool m_shouldSkipWaitingForPaintAfterNextViewDidMoveToWindow { false };
2233
2234     String m_toolTip;
2235
2236     EditorState m_editorState;
2237     bool m_isEditable { false };
2238
2239 #if PLATFORM(COCOA)
2240     TouchBarMenuData m_touchBarMenuData;
2241 #endif
2242
2243     double m_textZoomFactor { 1 };
2244     double m_pageZoomFactor { 1 };
2245     double m_pageScaleFactor { 1 };
2246     double m_pluginZoomFactor { 1 };
2247     double m_pluginScaleFactor { 1 };
2248     double m_viewScaleFactor { 1 };
2249     float m_intrinsicDeviceScaleFactor { 1 };
2250     Optional<float> m_customDeviceScaleFactor;
2251     float m_topContentInset { 0 };
2252
2253     LayerHostingMode m_layerHostingMode { LayerHostingMode::InProcess };
2254
2255     WebCore::Color m_underlayColor;
2256     WebCore::Color m_pageExtendedBackgroundColor;
2257
2258     bool m_useFixedLayout { false };
2259     WebCore::IntSize m_fixedLayoutSize;
2260
2261     bool m_alwaysShowsHorizontalScroller { false };
2262     bool m_alwaysShowsVerticalScroller { false };
2263
2264     OptionSet<WebCore::LayoutMilestone> m_observedLayoutMilestones;
2265
2266     bool m_suppressScrollbarAnimations { false };
2267
2268     WebCore::Pagination::Mode m_paginationMode { WebCore::Pagination::Unpaginated };
2269     bool m_paginationBehavesLikeColumns { false };
2270     double m_pageLength { 0 };
2271     double m_gapBetweenPages { 0 };
2272     bool m_paginationLineGridEnabled { false };
2273         
2274     // If the process backing the web page is alive and kicking.
2275     bool m_hasRunningProcess { false };
2276
2277     // Whether WebPageProxy::close() has been called on this page.
2278     bool m_isClosed { false };
2279
2280     // Whether it can run modal child web pages.
2281     bool m_canRunModal { false };
2282
2283     bool m_isInPrintingMode { false };
2284     bool m_isPerformingDOMPrintOperation { false };
2285
2286     WebCore::ResourceRequest m_decidePolicyForResponseRequest;
2287     bool m_shouldSuppressAppLinksInNextNavigationPolicyDecision { false };
2288
2289 #if HAVE(APP_SSO)
2290     bool m_shouldSuppressSOAuthorizationInNextNavigationPolicyDecision { false };
2291     bool m_shouldSuppressSOAuthorizationInAllNavigationPolicyDecision { false };
2292 #endif
2293
2294     Deque<NativeWebMouseEvent> m_mouseEventQueue;
2295     Deque<NativeWebKeyboardEvent> m_keyEventQueue;
2296     Deque<NativeWebWheelEvent> m_wheelEventQueue;
2297     Deque<std::unique_ptr<Vector<NativeWebWheelEvent>>> m_currentlyProcessedWheelEvents;
2298 #if ENABLE(MAC_GESTURE_EVENTS)
2299     Deque<NativeWebGestureEvent> m_gestureEventQueue;
2300 #endif
2301
2302 #if ENABLE(TOUCH_EVENTS)
2303     struct TouchEventTracking {
2304         WebCore::TrackingType touchForceChangedTracking { WebCore::TrackingType::NotTracking };
2305         WebCore::TrackingType touchStartTracking { WebCore::TrackingType::NotTracking };
2306         WebCore::TrackingType touchMoveTracking { WebCore::TrackingType::NotTracking };
2307         WebCore::TrackingType touchEndTracking { WebCore::TrackingType::NotTracking };
2308
2309         bool isTrackingAnything() const
2310         {
2311             return touchForceChangedTracking != WebCore::TrackingType::NotTracking
2312                 || touchStartTracking != WebCore::TrackingType::NotTracking
2313                 || touchMoveTracking != WebCore::TrackingType::NotTracking
2314                 || touchEndTracking != WebCore::TrackingType::NotTracking;
2315         }
2316
2317         void reset()
2318         {
2319             touchForceChangedTracking = WebCore::TrackingType::NotTracking;
2320             touchStartTracking = WebCore::TrackingType::NotTracking;
2321             touchMoveTracking = WebCore::TrackingType::NotTracking;
2322             touchEndTracking = WebCore::TrackingType::NotTracking;
2323         }
2324     };
2325     TouchEventTracking m_touchAndPointerEventTracking;
2326 #endif
2327 #if ENABLE(TOUCH_EVENTS) && !ENABLE(IOS_TOUCH_EVENTS)
2328     Deque<QueuedTouchEvents> m_touchEventQueue;
2329 #endif
2330
2331 #if ENABLE(INPUT_TYPE_COLOR)
2332     RefPtr<WebColorPicker> m_colorPicker;
2333 #endif
2334 #if ENABLE(DATALIST_ELEMENT)
2335     RefPtr<WebDataListSuggestionsDropdown> m_dataListSuggestionsDropdown;
2336 #endif
2337 #if PLATFORM(COCOA)
2338     RefPtr<WebCore::ValidationBubble> m_validationBubble;
2339 #endif
2340
2341     const WebCore::PageIdentifier m_pageID;
2342
2343     bool m_isPageSuspended { false };
2344     bool m_addsVisitedLinks { true };
2345
2346     bool m_controlledByAutomation { false };
2347
2348     unsigned m_inspectorFrontendCount { 0 };
2349
2350 #if PLATFORM(COCOA)
2351     bool m_isSmartInsertDeleteEnabled { false };
2352 #endif
2353
2354     Optional<WebCore::Color> m_backgroundColor;
2355
2356     unsigned m_pendingLearnOrIgnoreWordMessageCount { 0 };
2357
2358     bool m_mainFrameHasCustomContentProvider { false };
2359
2360 #if ENABLE(DRAG_SUPPORT)
2361     // Current drag destination details are delivered as an asynchronous response,
2362     // so we preserve them to be used when the next dragging delegate call is made.
2363     WebCore::DragOperation m_currentDragOperation { WebCore::DragOperationNone };
2364     WebCore::DragHandlingMethod m_currentDragHandlingMethod { WebCore::DragHandlingMethod::None };
2365     bool m_currentDragIsOverFileInput { false };
2366     unsigned m_currentDragNumberOfFilesToBeAccepted { 0 };
2367     WebCore::IntRect m_currentDragCaretRect;
2368     WebCore::IntRect m_currentDragCaretEditableElementRect;
2369 #endif
2370
2371     PageLoadState m_pageLoadState;
2372     
2373     bool m_delegatesScrolling { false };
2374
2375     bool m_mainFrameHasHorizontalScrollbar { false };
2376     bool m_mainFrameHasVerticalScrollbar { false };
2377
2378     // Whether horizontal wheel events can be handled directly for swiping purposes.
2379     bool m_canShortCircuitHorizontalWheelEvents { true };
2380
2381     bool m_mainFrameIsPinnedToLeftSide { true };
2382     bool m_mainFrameIsPinnedToRightSide { true };
2383     bool m_mainFrameIsPinnedToTopSide { true };
2384     bool m_mainFrameIsPinnedToBottomSide { true };
2385
2386     bool m_shouldUseImplicitRubberBandControl { false };
2387     bool m_rubberBandsAtLeft { true };
2388     bool m_rubberBandsAtRight { true };
2389     bool m_rubberBandsAtTop { true };
2390     bool m_rubberBandsAtBottom { true };
2391         
2392     bool m_enableVerticalRubberBanding { true };
2393     bool m_enableHorizontalRubberBanding { true };
2394
2395     bool m_backgroundExtendsBeyondPage { true };
2396
2397     bool m_shouldRecordNavigationSnapshots { false };
2398     bool m_isShowingNavigationGestureSnapshot { false };
2399
2400     bool m_mainFramePluginHandlesPageScaleGesture { false };
2401
2402     unsigned m_pageCount { 0 };
2403
2404     WebCore::IntRect m_visibleScrollerThumbRect;
2405
2406     uint64_t m_renderTreeSize { 0 };
2407     uint64_t m_sessionRestorationRenderTreeSize { 0 };
2408     bool m_hitRenderTreeSizeThreshold { false };
2409
2410     bool m_suppressVisibilityUpdates { false };
2411     bool m_autoSizingShouldExpandToViewHeight { false };
2412     WebCore::IntSize m_viewLayoutSize;
2413     Optional<WebCore::IntSize> m_viewportSizeForCSSViewportUnits;
2414
2415     // Visual viewports
2416     WebCore::LayoutSize m_baseLayoutViewportSize;
2417     WebCore::LayoutPoint m_minStableLayoutViewportOrigin;
2418     WebCore::LayoutPoint m_maxStableLayoutViewportOrigin;
2419
2420     float m_mediaVolume { 1 };
2421     WebCore::MediaProducer::MutedStateFlags m_mutedState { WebCore::MediaProducer::NoneMuted };
2422     bool m_mayStartMediaWhenInWindow { true };
2423     bool m_mediaPlaybackIsSuspended { false };
2424     bool m_mediaCaptureEnabled { true };
2425
2426     bool m_waitingForDidUpdateActivityState { false };
2427
2428     bool m_shouldScaleViewToFitDocument { false };
2429     bool m_shouldSuppressNextAutomaticNavigationSnapshot { false };
2430
2431 #if PLATFORM(COCOA)
2432     HashMap<String, String> m_temporaryPDFFiles;
2433     std::unique_ptr<WebCore::RunLoopObserver> m_activityStateChangeDispatcher;
2434
2435     std::unique_ptr<RemoteLayerTreeScrollingPerformanceData> m_scrollingPerformanceData;
2436     bool m_scrollPerformanceDataCollectionEnabled { false };
2437 #endif
2438     UserObservablePageCounter::Token m_pageIsUserObservableCount;
2439     ProcessSuppressionDisabledToken m_preventProcessSuppressionCount;
2440     HiddenPageThrottlingAutoIncreasesCounter::Token m_hiddenPageDOMTimerThrottlingAutoIncreasesCount;
2441     VisibleWebPageToken m_visiblePageToken;
2442         
2443     WebCore::ScrollPinningBehavior m_scrollPinningBehavior { WebCore::DoNotPin };
2444     Optional<WebCore::ScrollbarOverlayStyle> m_scrollbarOverlayStyle;
2445
2446     ActivityStateChangeID m_currentActivityStateChangeID { ActivityStateChangeAsynchronous };
2447
2448     WebPreferencesStore::ValueMap m_configurationPreferenceValues;
2449     OptionSet<WebCore::ActivityState::Flag> m_potentiallyChangedActivityStateFlags;
2450     bool m_activityStateChangeWantsSynchronousReply { false };
2451     Vector<CallbackID> m_nextActivityStateChangeCallbacks;
2452
2453     WebCore::MediaProducer::MediaStateFlags m_mediaState { WebCore::MediaProducer::IsNotPlaying };
2454
2455     bool m_isResourceCachingDisabled { false };
2456
2457     bool m_hasHadSelectionChangesFromUserInteraction { false };
2458     bool m_isTouchBarUpdateSupressedForHiddenContentEditable { false };
2459     bool m_isNeverRichlyEditableForTouchBar { false };
2460
2461 #if ENABLE(MEDIA_SESSION)
2462     bool m_hasMediaSessionWithActiveMediaElements { false };
2463 #endif
2464
2465 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS_FAMILY)
2466     bool m_requiresTargetMonitoring { false };
2467 #endif
2468
2469 #if PLATFORM(IOS_FAMILY)
2470     std::unique_ptr<ElementDidFocusArguments> m_deferredElementDidFocusArguments;
2471     bool m_waitingForPostLayoutEditorStateUpdateAfterFocusingElement { false };
2472     bool m_forceAlwaysUserScalable { false };
2473     WebCore::FloatSize m_viewportConfigurationViewLayoutSize;
2474     double m_viewportConfigurationLayoutSizeScaleFactor { 1 };
2475     double m_viewportConfigurationMinimumEffectiveDeviceWidth { 0 };
2476     WebCore::FloatSize m_maximumUnobscuredSize;
2477 #endif
2478
2479     Optional<WebCore::FontAttributes> m_cachedFontAttributesAtSelectionStart;
2480
2481 #if ENABLE(POINTER_LOCK)
2482     bool m_isPointerLockPending { false };
2483     bool m_isPointerLocked { false };
2484 #endif
2485
2486     bool m_isUsingHighPerformanceWebGL { false };
2487     bool m_openedByDOM { false };
2488     bool m_hasCommittedAnyProvisionalLoads { false };
2489     bool m_allowsFastClicksEverywhere { false };
2490
2491     HashMap<String, Ref<WebURLSchemeHandler>> m_urlSchemeHandlersByScheme;
2492     HashMap<uint64_t, Ref<WebURLSchemeHandler>> m_urlSchemeHandlersByIdentifier;
2493
2494 #if ENABLE(ATTACHMENT_ELEMENT)
2495     HashMap<String, Ref<API::Attachment>> m_attachmentIdentifierToAttachmentMap;
2496 #endif
2497
2498     const std::unique_ptr<WebPageInspectorController> m_inspectorController;
2499 #if ENABLE(REMOTE_INSPECTOR)
2500     std::unique_ptr<WebPageDebuggable> m_inspectorDebuggable;
2501 #endif
2502
2503     Optional<SpellDocumentTag> m_spellDocumentTag;
2504
2505     Optional<MonotonicTime> m_pageLoadStart;
2506     HashSet<String> m_previouslyVisitedPaths;
2507
2508     RunLoop::Timer<WebPageProxy> m_resetRecentCrashCountTimer;
2509     unsigned m_recentCrashCount { 0 };
2510
2511     bool m_needsFontAttributes { false };
2512     bool m_mayHaveUniversalFileReadSandboxExtension { false };
2513
2514     std::unique_ptr<ProvisionalPageProxy> m_provisionalPage;
2515     WeakPtr<SuspendedPageProxy> m_lastSuspendedPage;
2516
2517 #if HAVE(PENCILKIT)
2518     std::unique_ptr<EditableImageController> m_editableImageController;
2519 #endif
2520
2521 #if HAVE(VISIBILITY_PROPAGATION_VIEW)
2522     LayerHostingContextID m_contextIDForVisibilityPropagation { 0 };
2523 #endif
2524
2525     HashMap<WebViewDidMoveToWindowObserver*, WeakPtr<WebViewDidMoveToWindowObserver>> m_webViewDidMoveToWindowObservers;
2526
2527     mutable RefPtr<Logger> m_logger;
2528
2529 #if ENABLE(SPEECH_SYNTHESIS)
2530     struct SpeechSynthesisData {
2531         std::unique_ptr<WebCore::PlatformSpeechSynthesizer> synthesizer;
2532         RefPtr<WebCore::PlatformSpeechSynthesisUtterance> utterance;
2533         CompletionHandler<void()> speakingFinishedCompletionHandler;
2534         CompletionHandler<void()> speakingPausedCompletionHandler;
2535         CompletionHandler<void()> speakingResumedCompletionHandler;
2536     };
2537     Optional<SpeechSynthesisData> m_speechSynthesisData;
2538 #endif
2539     bool m_isQuotaIncreaseDenied { false };
2540 };
2541
2542 } // namespace WebKit