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