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