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