Regression (r244291): Broken API Test AutoLayoutRenderingProgressRelativeOrdering
[WebKit-https.git] / Source / WebKit / UIProcess / WebPageProxy.h
1 /*
2  * Copyright (C) 2010-2019 Apple Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23  * THE POSSIBILITY OF SUCH DAMAGE.
24  */
25
26 #pragma once
27
28 #include "APIObject.h"
29 #include "AutoCorrectionCallback.h"
30 #include "Connection.h"
31 #include "ContextMenuContextData.h"
32 #include "DownloadID.h"
33 #include "DragControllerAction.h"
34 #include "EditingRange.h"
35 #include "EditorState.h"
36 #include "FocusedElementInformation.h"
37 #include "GeolocationPermissionRequestManagerProxy.h"
38 #include "HiddenPageThrottlingAutoIncreasesCounter.h"
39 #include "LayerTreeContext.h"
40 #include "MessageSender.h"
41 #include "NotificationPermissionRequestManagerProxy.h"
42 #include "PageLoadState.h"
43 #include "ProcessTerminationReason.h"
44 #include "ProcessThrottler.h"
45 #include "SandboxExtension.h"
46 #include "ShareSheetCallbackID.h"
47 #include "ShareableBitmap.h"
48 #include "SuspendedPageProxy.h"
49 #include "SystemPreviewController.h"
50 #include "UserMediaPermissionRequestManagerProxy.h"
51 #include "VisibleContentRectUpdateInfo.h"
52 #include "VisibleWebPageCounter.h"
53 #include "WKBase.h"
54 #include "WKPagePrivate.h"
55 #include "WebColorPicker.h"
56 #include "WebContextMenuItemData.h"
57 #include "WebCoreArgumentCoders.h"
58 #include "WebDataListSuggestionsDropdown.h"
59 #include "WebFrameProxy.h"
60 #include "WebPageCreationParameters.h"
61 #include "WebPageDiagnosticLoggingClient.h"
62 #include "WebPageInjectedBundleClient.h"
63 #include "WebPaymentCoordinatorProxy.h"
64 #include "WebPreferences.h"
65 #include "WebPageProxyMessages.h"
66 #include "WebPopupMenuProxy.h"
67 #include "WebProcessLifetimeTracker.h"
68 #include "WebUndoStepID.h"
69 #include "WebsitePoliciesData.h"
70 #include <WebCore/ActivityState.h>
71 #include <WebCore/AutoplayEvent.h>
72 #include <WebCore/Color.h>
73 #include <WebCore/DiagnosticLoggingClient.h>
74 #include <WebCore/DragActions.h>
75 #include <WebCore/EventTrackingRegions.h>
76 #include <WebCore/FontAttributes.h>
77 #include <WebCore/FrameLoaderTypes.h>
78 #include <WebCore/FrameView.h> // FIXME: Move LayoutViewportConstraint to its own file and stop including this.
79 #include <WebCore/InputMode.h>
80 #include <WebCore/LayoutPoint.h>
81 #include <WebCore/LayoutSize.h>
82 #include <WebCore/MediaPlaybackTargetContext.h>
83 #include <WebCore/MediaProducer.h>
84 #include <WebCore/PlatformEvent.h>
85 #include <WebCore/PlatformScreen.h>
86 #include <WebCore/PlatformSpeechSynthesisUtterance.h>
87 #include <WebCore/PlatformSpeechSynthesizer.h>
88 #include <WebCore/PointerID.h>
89 #include <WebCore/RegistrableDomain.h>
90 #include <WebCore/ScrollTypes.h>
91 #include <WebCore/SearchPopupMenu.h>
92 #include <WebCore/TextChecking.h>
93 #include <WebCore/TextGranularity.h>
94 #include <WebCore/UserInterfaceLayoutDirection.h>
95 #include <WebCore/ViewportArguments.h>
96 #include <memory>
97 #include <wtf/CompletionHandler.h>
98 #include <wtf/HashMap.h>
99 #include <wtf/HashSet.h>
100 #include <wtf/Logger.h>
101 #include <wtf/MonotonicTime.h>
102 #include <wtf/Optional.h>
103 #include <wtf/ProcessID.h>
104 #include <wtf/Ref.h>
105 #include <wtf/RefPtr.h>
106 #include <wtf/RunLoop.h>
107 #include <wtf/URL.h>
108 #include <wtf/UniqueRef.h>
109 #include <wtf/Vector.h>
110 #include <wtf/text/WTFString.h>
111
112 #if PLATFORM(IOS_FAMILY)
113 #include "WebAutocorrectionContext.h"
114 #endif
115
116 OBJC_CLASS NSView;
117 OBJC_CLASS _WKRemoteObjectRegistry;
118
119 #if ENABLE(DRAG_SUPPORT)
120 #include <WebCore/DragActions.h>
121 #endif
122
123 #if ENABLE(TOUCH_EVENTS)
124 #include "NativeWebTouchEvent.h"
125 #endif
126
127 #if PLATFORM(COCOA)
128 #include "DynamicViewportSizeUpdate.h"
129 #include "RemoteLayerTreeNode.h"
130 #include "TouchBarMenuData.h"
131 #include "TouchBarMenuItemData.h"
132 #endif
133
134 #if PLATFORM(GTK)
135 #include "ArgumentCodersGtk.h"
136 #endif
137
138 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS_FAMILY)
139 #include <WebCore/MediaPlaybackTargetPicker.h>
140 #include <WebCore/WebMediaSessionManagerClient.h>
141 #endif
142
143 #if USE(APPLE_INTERNAL_SDK)
144 #include <WebKitAdditions/WebPageProxyAdditions.h>
145 #endif
146
147 #if ENABLE(MEDIA_SESSION)
148 namespace WebCore {
149 class MediaSessionMetadata;
150 }
151 #endif
152
153 namespace API {
154 class Attachment;
155 class ContextMenuClient;
156 class FindClient;
157 class FindMatchesClient;
158 class FormClient;
159 class FullscreenClient;
160 class HistoryClient;
161 class IconLoadingClient;
162 class LoaderClient;
163 class Navigation;
164 class NavigationClient;
165 class PolicyClient;
166 class UIClient;
167 class URLRequest;
168 }
169
170 namespace IPC {
171 class Decoder;
172 }
173
174 namespace WebCore {
175 class AuthenticationChallenge;
176 class CertificateInfo;
177 class Cursor;
178 class DragData;
179 class FloatRect;
180 class FontAttributeChanges;
181 class FontChanges;
182 class GraphicsLayer;
183 class IntSize;
184 class ProtectionSpace;
185 class RunLoopObserver;
186 class SharedBuffer;
187 class TextIndicator;
188 class ValidationBubble;
189
190 enum SelectionDirection : uint8_t;
191
192 enum class AutoplayEvent : uint8_t;
193 enum class DOMPasteAccessResponse : uint8_t;
194 enum class LockBackForwardList : bool;
195 enum class HasInsecureContent : bool;
196 enum class NotificationDirection : uint8_t;
197 enum class ShouldSample : bool;
198 enum class ShouldTreatAsContinuingLoad : bool;
199 enum class WritingDirection : uint8_t;
200
201 struct ApplicationManifest;
202 struct BackForwardItemIdentifier;
203 struct ContentRuleListResults;
204 struct DataListSuggestionInformation;
205 struct DictionaryPopupInfo;
206 struct ExceptionDetails;
207 struct FileChooserSettings;
208 struct GlobalWindowIdentifier;
209 struct MediaStreamRequest;
210 struct PrewarmInformation;
211 struct SecurityOriginData;
212 struct ShareData;
213 struct TextAlternativeWithRange;
214 struct TextCheckingResult;
215 struct ViewportAttributes;
216 struct WindowFeatures;
217
218 template <typename> class RectEdges;
219 using FloatBoxExtent = RectEdges<float>;
220 }
221
222 #if PLATFORM(GTK)
223 typedef GtkWidget* PlatformWidget;
224 #endif
225
226 #if PLATFORM(WPE)
227 struct wpe_view_backend;
228 #endif
229
230 #if PLATFORM(GTK) || PLATFORM(WPE)
231 typedef struct OpaqueJSContext* JSGlobalContextRef;
232 #endif
233
234 #if PLATFORM(WIN)
235 typedef HWND PlatformWidget;
236 #endif
237
238 namespace WebKit {
239 class DrawingAreaProxy;
240 class EditableImageController;
241 class GamepadData;
242 class NativeWebGestureEvent;
243 class NativeWebKeyboardEvent;
244 class NativeWebMouseEvent;
245 class NativeWebWheelEvent;
246 class PageClient;
247 class ProvisionalPageProxy;
248 class RemoteLayerTreeHost;
249 class RemoteLayerTreeScrollingPerformanceData;
250 class RemoteLayerTreeTransaction;
251 class RemoteScrollingCoordinatorProxy;
252 class SecKeyProxyStore;
253 class SharedBufferDataReference;
254 class UserData;
255 class ViewSnapshot;
256 class VisitedLinkStore;
257 class WebBackForwardList;
258 class WebBackForwardListItem;
259 class WebContextMenuProxy;
260 class WebEditCommandProxy;
261 class WebFullScreenManagerProxy;
262 class PlaybackSessionManagerProxy;
263 class WebNavigationState;
264 class VideoFullscreenManagerProxy;
265 class WebAuthenticatorCoordinatorProxy;
266 class WebKeyboardEvent;
267 class WebURLSchemeHandler;
268 class WebMouseEvent;
269 class WebOpenPanelResultListenerProxy;
270 class WebPageDebuggable;
271 class WebPageGroup;
272 class WebPageInspectorController;
273 class WebProcessProxy;
274 class WebUserContentControllerProxy;
275 class WebWheelEvent;
276 class WebsiteDataStore;
277 class WebViewDidMoveToWindowObserver;
278
279 struct AttributedString;
280 struct ColorSpaceData;
281 struct DocumentEditingContext;
282 struct DocumentEditingContextRequest;
283 struct EditingRange;
284 struct EditorState;
285 struct FrameInfoData;
286 struct InteractionInformationRequest;
287 struct LoadParameters;
288 struct PlatformPopupMenuData;
289 struct PrintInfo;
290 struct TextInputContext;
291 struct WebPopupItem;
292 struct URLSchemeTaskParameters;
293
294 enum class ProcessSwapRequestedByClient;
295 enum class UndoOrRedo : bool;
296 enum class WebCompatibilityMode : uint8_t;
297
298 #if USE(QUICK_LOOK)
299 class QuickLookDocumentData;
300 #endif
301
302 typedef GenericCallback<uint64_t> UnsignedCallback;
303 typedef GenericCallback<EditingRange> EditingRangeCallback;
304 typedef GenericCallback<const String&> StringCallback;
305 typedef GenericCallback<API::SerializedScriptValue*, bool, const WebCore::ExceptionDetails&> ScriptValueCallback;
306 typedef GenericCallback<const WebCore::FontAttributes&> FontAttributesCallback;
307
308 #if HAVE(VISIBILITY_PROPAGATION_VIEW)
309 using LayerHostingContextID = uint32_t;
310 #endif
311
312 #if PLATFORM(GTK)
313 typedef GenericCallback<API::Error*> PrintFinishedCallback;
314 #endif
315
316 #if ENABLE(TOUCH_EVENTS)
317 struct QueuedTouchEvents {
318     QueuedTouchEvents(const NativeWebTouchEvent& event)
319         : forwardedEvent(event)
320     {
321     }
322     NativeWebTouchEvent forwardedEvent;
323     Vector<NativeWebTouchEvent> deferredTouchEvents;
324 };
325 #endif
326
327 typedef GenericCallback<const String&, bool, int32_t> ValidateCommandCallback;
328 typedef GenericCallback<const WebCore::IntRect&, const EditingRange&> RectForCharacterRangeCallback;
329
330 #if ENABLE(APPLICATION_MANIFEST)
331 typedef GenericCallback<const Optional<WebCore::ApplicationManifest>&> ApplicationManifestCallback;
332 #endif
333
334 #if PLATFORM(MAC)
335 typedef GenericCallback<const AttributedString&, const EditingRange&> AttributedStringForCharacterRangeCallback;
336 typedef GenericCallback<const String&, double, bool> FontAtSelectionCallback;
337 #endif
338
339 #if PLATFORM(IOS_FAMILY)
340 typedef GenericCallback<const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t> GestureCallback;
341 typedef GenericCallback<const WebCore::IntPoint&, uint32_t, uint32_t> TouchesCallback;
342 typedef GenericCallback<const Vector<WebCore::SelectionRect>&> SelectionRectsCallback;
343 typedef GenericCallback<const FocusedElementInformation&> FocusedElementInformationCallback;
344 struct ElementDidFocusArguments {
345     WTF_MAKE_FAST_ALLOCATED;
346 public:
347     FocusedElementInformation information;
348     bool userIsInteracting;
349     bool blurPreviousNode;
350     OptionSet<WebCore::ActivityState::Flag> activityStateChanges;
351     RefPtr<API::Object> userData;
352 };
353
354 using DrawToPDFCallback = GenericCallback<const IPC::DataReference&>;
355 #endif
356
357 #if PLATFORM(COCOA)
358 typedef GenericCallback<const WTF::MachSendRight&> MachSendRightCallback;
359 typedef GenericCallback<bool, bool, String, double, double, uint64_t> NowPlayingInfoCallback;
360 #endif
361
362 using SpellDocumentTag = int64_t;
363
364 class WebPageProxy : public API::ObjectImpl<API::Object::Type::Page>
365 #if ENABLE(INPUT_TYPE_COLOR)
366     , public WebColorPicker::Client
367 #endif
368 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS_FAMILY)
369     , public WebCore::WebMediaSessionManagerClient
370 #endif
371 #if ENABLE(APPLE_PAY)
372     , public WebPaymentCoordinatorProxy::Client
373 #endif
374     , public WebPopupMenuProxy::Client
375     , public IPC::MessageReceiver
376     , public IPC::MessageSender
377 #if ENABLE(SPEECH_SYNTHESIS)
378     , public WebCore::PlatformSpeechSynthesisUtteranceClient
379     , public WebCore::PlatformSpeechSynthesizerClient
380 #endif
381     , public CanMakeWeakPtr<WebPageProxy> {
382 public:
383     static Ref<WebPageProxy> create(PageClient&, WebProcessProxy&, uint64_t pageID, Ref<API::PageConfiguration>&&);
384     virtual ~WebPageProxy();
385
386     const API::PageConfiguration& configuration() const;
387
388     uint64_t pageID() const { return m_pageID; }
389
390     PAL::SessionID sessionID() const;
391
392     WebFrameProxy* mainFrame() const { return m_mainFrame.get(); }
393     WebFrameProxy* focusedFrame() const { return m_focusedFrame.get(); }
394     WebFrameProxy* frameSetLargestFrame() const { return m_frameSetLargestFrame.get(); }
395
396     DrawingAreaProxy* drawingArea() const { return m_drawingArea.get(); }
397     DrawingAreaProxy* provisionalDrawingArea() const;
398
399     WebNavigationState& navigationState() { return *m_navigationState.get(); }
400
401     WebsiteDataStore& websiteDataStore() { return m_websiteDataStore; }
402
403     void addPreviouslyVisitedPath(const String&);
404
405     WebProcessLifetimeTracker& webProcessLifetimeTracker() { return m_webProcessLifetimeTracker; }
406
407 #if ENABLE(DATA_DETECTION)
408     NSArray *dataDetectionResults() { return m_dataDetectionResults.get(); }
409     void detectDataInAllFrames(WebCore::DataDetectorTypes, CompletionHandler<void(const DataDetectionResult&)>&&);
410     void removeDataDetectedLinks(CompletionHandler<void(const DataDetectionResult&)>&&);
411 #endif
412         
413 #if ENABLE(ASYNC_SCROLLING) && PLATFORM(COCOA)
414     RemoteScrollingCoordinatorProxy* scrollingCoordinatorProxy() const { return m_scrollingCoordinatorProxy.get(); }
415 #endif
416
417     WebBackForwardList& backForwardList() { return m_backForwardList; }
418
419     bool addsVisitedLinks() const { return m_addsVisitedLinks; }
420     void setAddsVisitedLinks(bool addsVisitedLinks) { m_addsVisitedLinks = addsVisitedLinks; }
421     VisitedLinkStore& visitedLinkStore() { return m_visitedLinkStore; }
422
423     void exitFullscreenImmediately();
424     void fullscreenMayReturnToInline();
425     void didEnterFullscreen();
426     void didExitFullscreen();
427
428     WebInspectorProxy* inspector() const;
429
430     void didChangeInspectorFrontendCount(unsigned count) { m_inspectorFrontendCount = count; }
431     unsigned inspectorFrontendCount() const { return m_inspectorFrontendCount; }
432     bool hasInspectorFrontend() const { return m_inspectorFrontendCount > 0; }
433
434     bool isControlledByAutomation() const { return m_controlledByAutomation; }
435     void setControlledByAutomation(bool);
436
437     WebPageInspectorController& inspectorController() { return *m_inspectorController; }
438
439 #if PLATFORM(IOS_FAMILY)
440     void showInspectorIndication();
441     void hideInspectorIndication();
442 #endif
443
444     void createInspectorTarget(const String& targetId, Inspector::InspectorTargetType);
445     void destroyInspectorTarget(const String& targetId);
446     void sendMessageToInspectorFrontend(const String& targetId, const String& message);
447
448 #if ENABLE(REMOTE_INSPECTOR)
449     void setIndicating(bool);
450     bool allowsRemoteInspection() const;
451     void setAllowsRemoteInspection(bool);
452     String remoteInspectionNameOverride() const;
453     void setRemoteInspectionNameOverride(const String&);
454     void remoteInspectorInformationDidChange();
455 #endif
456
457 #if ENABLE(FULLSCREEN_API)
458     WebFullScreenManagerProxy* fullScreenManager();
459
460     API::FullscreenClient& fullscreenClient() const { return *m_fullscreenClient; }
461     void setFullscreenClient(std::unique_ptr<API::FullscreenClient>&&);
462 #endif
463 #if (PLATFORM(IOS_FAMILY) && HAVE(AVKIT)) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
464     PlaybackSessionManagerProxy* playbackSessionManager();
465     VideoFullscreenManagerProxy* videoFullscreenManager();
466 #endif
467
468 #if PLATFORM(IOS_FAMILY)
469     bool allowsMediaDocumentInlinePlayback() const;
470     void setAllowsMediaDocumentInlinePlayback(bool);
471 #endif
472
473 #if USE(SYSTEM_PREVIEW)
474     SystemPreviewController* systemPreviewController() { return m_systemPreviewController.get(); }
475 #endif
476
477 #if ENABLE(CONTEXT_MENUS)
478     API::ContextMenuClient& contextMenuClient() { return *m_contextMenuClient; }
479     void setContextMenuClient(std::unique_ptr<API::ContextMenuClient>&&);
480 #endif
481     API::FindClient& findClient() { return *m_findClient; }
482     void setFindClient(std::unique_ptr<API::FindClient>&&);
483     API::FindMatchesClient& findMatchesClient() { return *m_findMatchesClient; }
484     void setFindMatchesClient(std::unique_ptr<API::FindMatchesClient>&&);
485     API::DiagnosticLoggingClient* diagnosticLoggingClient() { return m_diagnosticLoggingClient.get(); }
486     void setDiagnosticLoggingClient(std::unique_ptr<API::DiagnosticLoggingClient>&&);
487     void setFormClient(std::unique_ptr<API::FormClient>&&);
488     void setNavigationClient(UniqueRef<API::NavigationClient>&&);
489     void setHistoryClient(UniqueRef<API::HistoryClient>&&);
490     void setLoaderClient(std::unique_ptr<API::LoaderClient>&&);
491     void setPolicyClient(std::unique_ptr<API::PolicyClient>&&);
492     void setInjectedBundleClient(const WKPageInjectedBundleClientBase*);
493     WebPageInjectedBundleClient* injectedBundleClient() { return m_injectedBundleClient.get(); }
494
495     API::UIClient& uiClient() { return *m_uiClient; }
496     void setUIClient(std::unique_ptr<API::UIClient>&&);
497
498     API::IconLoadingClient& iconLoadingClient() { return *m_iconLoadingClient; }
499     void setIconLoadingClient(std::unique_ptr<API::IconLoadingClient>&&);
500
501     void initializeWebPage();
502     void setDrawingArea(std::unique_ptr<DrawingAreaProxy>&&);
503
504     WeakPtr<SecKeyProxyStore> secKeyProxyStore(const WebCore::AuthenticationChallenge&);
505         
506     void close();
507     bool tryClose();
508     bool isClosed() const { return m_isClosed; }
509
510     void setOpenedByDOM() { m_openedByDOM = true; }
511     bool openedByDOM() const { return m_openedByDOM; }
512
513     bool hasCommittedAnyProvisionalLoads() const { return m_hasCommittedAnyProvisionalLoads; }
514
515     void setIsUsingHighPerformanceWebGL(bool value) { m_isUsingHighPerformanceWebGL = value; }
516     bool isUsingHighPerformanceWebGL() const { return m_isUsingHighPerformanceWebGL; }
517
518     void didExceedInactiveMemoryLimitWhileActive();
519     void didExceedBackgroundCPULimitWhileInForeground();
520
521     void closePage(bool stopResponsivenessTimer);
522
523     void addPlatformLoadParameters(LoadParameters&);
524     RefPtr<API::Navigation> loadRequest(WebCore::ResourceRequest&&, WebCore::ShouldOpenExternalURLsPolicy = WebCore::ShouldOpenExternalURLsPolicy::ShouldAllowExternalSchemes, API::Object* userData = nullptr);
525     RefPtr<API::Navigation> loadFile(const String& fileURL, const String& resourceDirectoryURL, API::Object* userData = nullptr);
526     RefPtr<API::Navigation> loadData(const IPC::DataReference&, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData = nullptr);
527     void loadAlternateHTML(const IPC::DataReference&, const String& encoding, const URL& baseURL, const URL& unreachableURL, API::Object* userData = nullptr);
528     void loadWebArchiveData(API::Data*, API::Object* userData = nullptr);
529     void navigateToPDFLinkWithSimulatedClick(const String& url, WebCore::IntPoint documentPoint, WebCore::IntPoint screenPoint);
530
531     void simulateDeviceOrientationChange(double alpha, double beta, double gamma);
532
533     void stopLoading();
534     RefPtr<API::Navigation> reload(OptionSet<WebCore::ReloadOption>);
535
536     RefPtr<API::Navigation> goForward();
537     RefPtr<API::Navigation> goBack();
538
539     RefPtr<API::Navigation> goToBackForwardItem(WebBackForwardListItem&);
540     void tryRestoreScrollPosition();
541     void didChangeBackForwardList(WebBackForwardListItem* addedItem, Vector<Ref<WebBackForwardListItem>>&& removed);
542     void willGoToBackForwardListItem(const WebCore::BackForwardItemIdentifier&, bool inPageCache);
543
544     bool shouldKeepCurrentBackForwardListItemInList(WebBackForwardListItem&);
545
546     bool willHandleHorizontalScrollEvents() const;
547
548     void updateWebsitePolicies(WebsitePoliciesData&&);
549
550     bool canShowMIMEType(const String& mimeType);
551
552     String currentURL() const;
553
554     float topContentInset() const { return m_topContentInset; }
555     void setTopContentInset(float);
556
557     WebCore::Color underlayColor() const { return m_underlayColor; }
558     void setUnderlayColor(const WebCore::Color&);
559
560     // At this time, m_pageExtendedBackgroundColor can be set via pageExtendedBackgroundColorDidChange() which is a message
561     // from the UIProcess, or by didCommitLayerTree(). When PLATFORM(MAC) adopts UI side compositing, we should get rid of
562     // the message entirely.
563     WebCore::Color pageExtendedBackgroundColor() const { return m_pageExtendedBackgroundColor; }
564
565     void viewWillStartLiveResize();
566     void viewWillEndLiveResize();
567
568     void setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent&, WTF::Function<void (CallbackBase::Error)>&&);
569     
570     void clearSelection();
571     void restoreSelectionInFocusedEditableElement();
572
573     PageClient& pageClient() const;
574
575     void setViewNeedsDisplay(const WebCore::Region&);
576     void requestScroll(const WebCore::FloatPoint& scrollPosition, const WebCore::IntPoint& scrollOrigin);
577     
578     WebCore::FloatPoint viewScrollPosition() const;
579
580     void setDelegatesScrolling(bool delegatesScrolling) { m_delegatesScrolling = delegatesScrolling; }
581     bool delegatesScrolling() const { return m_delegatesScrolling; }
582
583     enum class ActivityStateChangeDispatchMode { Deferrable, Immediate };
584     void activityStateDidChange(OptionSet<WebCore::ActivityState::Flag> mayHaveChanged, bool wantsSynchronousReply = false, ActivityStateChangeDispatchMode = ActivityStateChangeDispatchMode::Deferrable);
585     bool isInWindow() const { return m_activityState.contains(WebCore::ActivityState::IsInWindow); }
586     void waitForDidUpdateActivityState(ActivityStateChangeID);
587     void didUpdateActivityState() { m_waitingForDidUpdateActivityState = false; }
588
589     void layerHostingModeDidChange();
590
591     WebCore::IntSize viewSize() const;
592     bool isViewVisible() const { return m_activityState.contains(WebCore::ActivityState::IsVisible); }
593     bool isViewFocused() const { return m_activityState.contains(WebCore::ActivityState::IsFocused); }
594     bool isViewWindowActive() const { return m_activityState.contains(WebCore::ActivityState::WindowIsActive); }
595
596     void addMIMETypeWithCustomContentProvider(const String& mimeType);
597
598     void executeEditCommand(const String& commandName, const String& argument = String());
599     void validateCommand(const String& commandName, WTF::Function<void (const String&, bool, int32_t, CallbackBase::Error)>&&);
600
601     const EditorState& editorState() const { return m_editorState; }
602     bool canDelete() const { return hasSelectedRange() && isContentEditable(); }
603     bool hasSelectedRange() const { return m_editorState.selectionIsRange; }
604     bool isContentEditable() const { return m_editorState.isContentEditable; }
605
606     void increaseListLevel();
607     void decreaseListLevel();
608     void changeListType();
609
610     void setBaseWritingDirection(WebCore::WritingDirection);
611
612     Optional<WebCore::FontAttributes> cachedFontAttributesAtSelectionStart() const { return m_cachedFontAttributesAtSelectionStart; }
613
614 #if PLATFORM(COCOA)
615     const TouchBarMenuData& touchBarMenuData() const { return m_touchBarMenuData; }
616 #endif
617
618     bool maintainsInactiveSelection() const;
619     void setMaintainsInactiveSelection(bool);
620     void setEditable(bool);
621     bool isEditable() const { return m_isEditable; }
622
623     void activateMediaStreamCaptureInPage();
624     bool isMediaStreamCaptureMuted() const { return m_mutedState & WebCore::MediaProducer::MediaStreamCaptureIsMuted; }
625     void setMediaStreamCaptureMuted(bool);
626     void executeEditCommand(const String& commandName, const String& argument, WTF::Function<void(CallbackBase::Error)>&&);
627         
628     void requestFontAttributesAtSelectionStart(Function<void(const WebCore::FontAttributes&, CallbackBase::Error)>&&);
629     void fontAttributesCallback(const WebCore::FontAttributes&, CallbackID);
630
631     void textInputContextsInRect(WebCore::FloatRect, CompletionHandler<void(const Vector<TextInputContext>&)>&&);
632     void focusTextInputContext(const TextInputContext&, CompletionHandler<void(bool)>&&);
633
634 #if PLATFORM(IOS_FAMILY)
635     double displayedContentScale() const { return m_lastVisibleContentRectUpdate.scale(); }
636     const WebCore::FloatRect& exposedContentRect() const { return m_lastVisibleContentRectUpdate.exposedContentRect(); }
637     const WebCore::FloatRect& unobscuredContentRect() const { return m_lastVisibleContentRectUpdate.unobscuredContentRect(); }
638     bool inStableState() const { return m_lastVisibleContentRectUpdate.inStableState(); }
639     const WebCore::FloatRect& unobscuredContentRectRespectingInputViewBounds() const { return m_lastVisibleContentRectUpdate.unobscuredContentRectRespectingInputViewBounds(); }
640     // When visual viewports are enabled, this is the layout viewport rect.
641     const WebCore::FloatRect& customFixedPositionRect() const { return m_lastVisibleContentRectUpdate.customFixedPositionRect(); }
642
643     void updateVisibleContentRects(const VisibleContentRectUpdateInfo&);
644     void resendLastVisibleContentRects();
645
646     WebCore::FloatRect computeCustomFixedPositionRect(const WebCore::FloatRect& unobscuredContentRect, const WebCore::FloatRect& unobscuredContentRectRespectingInputViewBounds, const WebCore::FloatRect& currentCustomFixedPositionRect, double displayedContentScale, WebCore::FrameView::LayoutViewportConstraint = WebCore::FrameView::LayoutViewportConstraint::Unconstrained) const;
647
648     void scrollingNodeScrollViewWillStartPanGesture();
649     void scrollingNodeScrollViewDidScroll();
650     void scrollingNodeScrollWillStartScroll();
651     void scrollingNodeScrollDidEndScroll();
652
653     void dynamicViewportSizeUpdate(const WebCore::FloatSize& viewLayoutSize, const WebCore::FloatSize& maximumUnobscuredSize, const WebCore::FloatRect& targetExposedContentRect, const WebCore::FloatRect& targetUnobscuredRect, const WebCore::FloatRect& targetUnobscuredRectInScrollViewCoordinates, const WebCore::FloatBoxExtent& unobscuredSafeAreaInsets, double targetScale, int32_t deviceOrientation, DynamicViewportSizeUpdateID);
654
655     void setViewportConfigurationViewLayoutSize(const WebCore::FloatSize&, double scaleFactor, double minimumEffectiveDeviceWidth);
656     void setMaximumUnobscuredSize(const WebCore::FloatSize&);
657     void setDeviceOrientation(int32_t);
658     int32_t deviceOrientation() const { return m_deviceOrientation; }
659     void setOverrideViewportArguments(const Optional<WebCore::ViewportArguments>&);
660     void willCommitLayerTree(uint64_t transactionID);
661
662     void selectWithGesture(const WebCore::IntPoint, WebCore::TextGranularity, uint32_t gestureType, uint32_t gestureState, bool isInteractingWithFocusedElement, WTF::Function<void(const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t, CallbackBase::Error)>&&);
663     void updateSelectionWithTouches(const WebCore::IntPoint, uint32_t touches, bool baseIsStart, WTF::Function<void (const WebCore::IntPoint&, uint32_t, uint32_t, CallbackBase::Error)>&&);
664     void selectWithTwoTouches(const WebCore::IntPoint from, const WebCore::IntPoint to, uint32_t gestureType, uint32_t gestureState, WTF::Function<void (const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t, CallbackBase::Error)>&&);
665     void extendSelection(WebCore::TextGranularity);
666     void selectWordBackward();
667     void moveSelectionByOffset(int32_t offset, WTF::Function<void (CallbackBase::Error)>&&);
668     void selectTextWithGranularityAtPoint(const WebCore::IntPoint, WebCore::TextGranularity, bool isInteractingWithFocusedElement, WTF::Function<void(CallbackBase::Error)>&&);
669     void selectPositionAtPoint(const WebCore::IntPoint, bool isInteractingWithFocusedElement, WTF::Function<void(CallbackBase::Error)>&&);
670     void selectPositionAtBoundaryWithDirection(const WebCore::IntPoint, WebCore::TextGranularity, WebCore::SelectionDirection, bool isInteractingWithFocusedElement, WTF::Function<void(CallbackBase::Error)>&&);
671     void moveSelectionAtBoundaryWithDirection(WebCore::TextGranularity, WebCore::SelectionDirection, WTF::Function<void(CallbackBase::Error)>&&);
672     void beginSelectionInDirection(WebCore::SelectionDirection, WTF::Function<void (uint64_t, CallbackBase::Error)>&&);
673     void updateSelectionWithExtentPoint(const WebCore::IntPoint, bool isInteractingWithFocusedElement, WTF::Function<void(uint64_t, CallbackBase::Error)>&&);
674     void updateSelectionWithExtentPointAndBoundary(const WebCore::IntPoint, WebCore::TextGranularity, bool isInteractingWithFocusedElement, WTF::Function<void(uint64_t, CallbackBase::Error)>&&);
675     void requestAutocorrectionData(const String& textForAutocorrection, WTF::Function<void (const Vector<WebCore::FloatRect>&, const String&, double, uint64_t, CallbackBase::Error)>&&);
676     void applyAutocorrection(const String& correction, const String& originalText, WTF::Function<void (const String&, CallbackBase::Error)>&&);
677     bool applyAutocorrection(const String& correction, const String& originalText);
678     void requestAutocorrectionContext();
679     void handleAutocorrectionContext(const WebAutocorrectionContext&);
680     void requestDictationContext(WTF::Function<void (const String&, const String&, const String&, CallbackBase::Error)>&&);
681     void replaceDictatedText(const String& oldText, const String& newText);
682     void replaceSelectedText(const String& oldText, const String& newText);
683     void didReceivePositionInformation(const InteractionInformationAtPosition&);
684     void requestPositionInformation(const InteractionInformationRequest&);
685     void startInteractionWithElementAtPosition(const WebCore::IntPoint&);
686     void stopInteraction();
687     void performActionOnElement(uint32_t action);
688     void saveImageToLibrary(const SharedMemory::Handle& imageHandle, uint64_t imageSize);
689     void focusNextFocusedElement(bool isForward, WTF::Function<void (CallbackBase::Error)>&& = [] (auto) { });
690     void setFocusedElementValue(const String&);
691     void setFocusedElementValueAsNumber(double);
692     void setFocusedElementSelectedIndex(uint32_t index, bool allowMultipleSelection = false);
693     void applicationDidEnterBackground();
694     void applicationDidFinishSnapshottingAfterEnteringBackground();
695     void applicationWillEnterForeground();
696     void applicationWillResignActive();
697     void applicationDidBecomeActive();
698     void commitPotentialTapFailed();
699     void didNotHandleTapAsClick(const WebCore::IntPoint&);
700     void didCompleteSyntheticClick();
701     void disableDoubleTapGesturesDuringTapIfNecessary(uint64_t requestID);
702     void handleSmartMagnificationInformationForPotentialTap(uint64_t requestID, const WebCore::FloatRect& renderRect, bool fitEntireRect, double viewportMinimumScale, double viewportMaximumScale);
703     void contentSizeCategoryDidChange(const String& contentSizeCategory);
704     void getSelectionContext(WTF::Function<void(const String&, const String&, const String&, CallbackBase::Error)>&&);
705     void handleTwoFingerTapAtPoint(const WebCore::IntPoint&, OptionSet<WebKit::WebEvent::Modifier>, uint64_t requestID);
706     void handleStylusSingleTapAtPoint(const WebCore::IntPoint&, uint64_t requestID);
707     void setForceAlwaysUserScalable(bool);
708     bool forceAlwaysUserScalable() const { return m_forceAlwaysUserScalable; }
709     double layoutSizeScaleFactor() const { return m_viewportConfigurationLayoutSizeScaleFactor; }
710     double minimumEffectiveDeviceWidth() const { return m_viewportConfigurationMinimumEffectiveDeviceWidth; }
711     void setIsScrollingOrZooming(bool);
712     void requestRectsForGranularityWithSelectionOffset(WebCore::TextGranularity, uint32_t offset, WTF::Function<void(const Vector<WebCore::SelectionRect>&, CallbackBase::Error)>&&);
713     void requestRectsAtSelectionOffsetWithText(int32_t offset, const String&, WTF::Function<void(const Vector<WebCore::SelectionRect>&, CallbackBase::Error)>&&);
714     void autofillLoginCredentials(const String& username, const String& password);
715     void storeSelectionForAccessibility(bool);
716     void startAutoscrollAtPosition(const WebCore::FloatPoint& positionInWindow);
717     void cancelAutoscroll();
718     void hardwareKeyboardAvailabilityChanged(bool keyboardIsAttached);
719     bool isScrollingOrZooming() const { return m_isScrollingOrZooming; }
720     void requestEvasionRectsAboveSelection(CompletionHandler<void(const Vector<WebCore::FloatRect>&)>&&);
721     void updateSelectionWithDelta(int64_t locationDelta, int64_t lengthDelta, CompletionHandler<void()>&&);
722     void requestDocumentEditingContext(WebKit::DocumentEditingContextRequest, CompletionHandler<void(WebKit::DocumentEditingContext)>&&);
723 #if ENABLE(DATA_INTERACTION)
724     void didHandleDragStartRequest(bool started);
725     void didHandleAdditionalDragItemsRequest(bool added);
726     void requestDragStart(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition, WebCore::DragSourceAction allowedActions);
727     void requestAdditionalItemsForDragSession(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition, WebCore::DragSourceAction allowedActions);
728     void didConcludeEditDrag(Optional<WebCore::TextIndicatorData>);
729 #endif
730 #endif
731 #if ENABLE(DATA_DETECTION)
732     void setDataDetectionResult(const DataDetectionResult&);
733 #endif
734     void didCommitLayerTree(const WebKit::RemoteLayerTreeTransaction&);
735     void layerTreeCommitComplete();
736
737     bool updateLayoutViewportParameters(const WebKit::RemoteLayerTreeTransaction&);
738
739 #if PLATFORM(GTK)
740     void setComposition(const String& text, Vector<WebCore::CompositionUnderline> underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeEnd);
741     void confirmComposition(const String& compositionString, int64_t selectionStart, int64_t selectionLength);
742     void cancelComposition();
743 #endif
744
745 #if PLATFORM(GTK)
746     void setInputMethodState(bool enabled);
747 #endif
748
749 #if PLATFORM (GTK) && HAVE(GTK_GESTURES)
750     void getCenterForZoomGesture(const WebCore::IntPoint& centerInViewCoordinates, WebCore::IntPoint& center);
751 #endif
752
753 #if PLATFORM(COCOA)
754     void windowAndViewFramesChanged(const WebCore::FloatRect& viewFrameInWindowCoordinates, const WebCore::FloatPoint& accessibilityViewCoordinates);
755     void setMainFrameIsScrollable(bool);
756
757     void sendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdentifier, const String& textInput);
758     bool shouldDelayWindowOrderingForEvent(const WebMouseEvent&);
759     bool acceptsFirstMouse(int eventNumber, const WebMouseEvent&);
760
761     void setRemoteLayerTreeRootNode(RemoteLayerTreeNode*);
762     CALayer *acceleratedCompositingRootLayer() const;
763
764     void setTextAsync(const String&);
765     void insertTextAsync(const String& text, const EditingRange& replacementRange, bool registerUndoGroup = false, EditingRangeIsRelativeTo = EditingRangeIsRelativeTo::EditableRoot, bool suppressSelectionUpdate = false);
766     void getMarkedRangeAsync(WTF::Function<void (EditingRange, CallbackBase::Error)>&&);
767     void getSelectedRangeAsync(WTF::Function<void (EditingRange, CallbackBase::Error)>&&);
768     void characterIndexForPointAsync(const WebCore::IntPoint&, WTF::Function<void (uint64_t, CallbackBase::Error)>&&);
769     void firstRectForCharacterRangeAsync(const EditingRange&, WTF::Function<void (const WebCore::IntRect&, const EditingRange&, CallbackBase::Error)>&&);
770     void setCompositionAsync(const String& text, const Vector<WebCore::CompositionUnderline>& underlines, const EditingRange& selectionRange, const EditingRange& replacementRange);
771     void confirmCompositionAsync();
772
773     void setScrollPerformanceDataCollectionEnabled(bool);
774     bool scrollPerformanceDataCollectionEnabled() const { return m_scrollPerformanceDataCollectionEnabled; }
775     RemoteLayerTreeScrollingPerformanceData* scrollingPerformanceData() { return m_scrollingPerformanceData.get(); }
776 #endif // PLATFORM(COCOA)
777
778     void changeFontAttributes(WebCore::FontAttributeChanges&&);
779     void changeFont(WebCore::FontChanges&&);
780
781 #if PLATFORM(MAC)
782     void insertDictatedTextAsync(const String& text, const EditingRange& replacementRange, const Vector<WebCore::TextAlternativeWithRange>& dictationAlternatives, bool registerUndoGroup);
783     void attributedSubstringForCharacterRangeAsync(const EditingRange&, WTF::Function<void (const AttributedString&, const EditingRange&, CallbackBase::Error)>&&);
784     void fontAtSelection(WTF::Function<void (const String&, double, bool, CallbackBase::Error)>&&);
785
786     void startWindowDrag();
787     NSWindow *platformWindow();
788     void rootViewToWindow(const WebCore::IntRect& viewRect, WebCore::IntRect& windowRect);
789
790     NSView *inspectorAttachmentView();
791     _WKRemoteObjectRegistry *remoteObjectRegistry();
792
793     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
881     void setUseFixedLayout(bool);
882     void setFixedLayoutSize(const WebCore::IntSize&);
883     bool useFixedLayout() const { return m_useFixedLayout; };
884     const WebCore::IntSize& fixedLayoutSize() const { return m_fixedLayoutSize; };
885
886     void setAlwaysShowsHorizontalScroller(bool);
887     void setAlwaysShowsVerticalScroller(bool);
888     bool alwaysShowsHorizontalScroller() const { return m_alwaysShowsHorizontalScroller; }
889     bool alwaysShowsVerticalScroller() const { return m_alwaysShowsVerticalScroller; }
890
891     void listenForLayoutMilestones(OptionSet<WebCore::LayoutMilestone>);
892
893     bool hasHorizontalScrollbar() const { return m_mainFrameHasHorizontalScrollbar; }
894     bool hasVerticalScrollbar() const { return m_mainFrameHasVerticalScrollbar; }
895
896     void setSuppressScrollbarAnimations(bool);
897     bool areScrollbarAnimationsSuppressed() const { return m_suppressScrollbarAnimations; }
898
899     bool isPinnedToLeftSide() const { return m_mainFrameIsPinnedToLeftSide; }
900     bool isPinnedToRightSide() const { return m_mainFrameIsPinnedToRightSide; }
901     bool isPinnedToTopSide() const { return m_mainFrameIsPinnedToTopSide; }
902     bool isPinnedToBottomSide() const { return m_mainFrameIsPinnedToBottomSide; }
903
904     bool rubberBandsAtLeft() const;
905     void setRubberBandsAtLeft(bool);
906     bool rubberBandsAtRight() const;
907     void setRubberBandsAtRight(bool);
908     bool rubberBandsAtTop() const;
909     void setRubberBandsAtTop(bool);
910     bool rubberBandsAtBottom() const;
911     void setRubberBandsAtBottom(bool);
912
913     void setShouldUseImplicitRubberBandControl(bool shouldUseImplicitRubberBandControl) { m_shouldUseImplicitRubberBandControl = shouldUseImplicitRubberBandControl; }
914     bool shouldUseImplicitRubberBandControl() const { return m_shouldUseImplicitRubberBandControl; }
915         
916     void setEnableVerticalRubberBanding(bool);
917     bool verticalRubberBandingIsEnabled() const;
918     void setEnableHorizontalRubberBanding(bool);
919     bool horizontalRubberBandingIsEnabled() const;
920         
921     void setBackgroundExtendsBeyondPage(bool);
922     bool backgroundExtendsBeyondPage() const;
923
924     void setPaginationMode(WebCore::Pagination::Mode);
925     WebCore::Pagination::Mode paginationMode() const { return m_paginationMode; }
926     void setPaginationBehavesLikeColumns(bool);
927     bool paginationBehavesLikeColumns() const { return m_paginationBehavesLikeColumns; }
928     void setPageLength(double);
929     double pageLength() const { return m_pageLength; }
930     void setGapBetweenPages(double);
931     double gapBetweenPages() const { return m_gapBetweenPages; }
932     void setPaginationLineGridEnabled(bool);
933     bool paginationLineGridEnabled() const { return m_paginationLineGridEnabled; }
934     unsigned pageCount() const { return m_pageCount; }
935
936     void isJITEnabled(CompletionHandler<void(bool)>&&);
937
938 #if PLATFORM(MAC)
939     void setUseSystemAppearance(bool);
940     bool useSystemAppearance() const { return m_useSystemAppearance; }
941 #endif
942
943     void effectiveAppearanceDidChange();
944     bool useDarkAppearance() const;
945
946 #if PLATFORM(COCOA)
947     // Called by the web process through a message.
948     void registerWebProcessAccessibilityToken(const IPC::DataReference&);
949     // Called by the UI process when it is ready to send its tokens to the web process.
950     void registerUIProcessAccessibilityTokens(const IPC::DataReference& elemenToken, const IPC::DataReference& windowToken);
951     bool readSelectionFromPasteboard(const String& pasteboardName);
952     String stringSelectionForPasteboard();
953     RefPtr<WebCore::SharedBuffer> dataSelectionForPasteboard(const String& pasteboardType);
954     void makeFirstResponder();
955     void assistiveTechnologyMakeFirstResponder();
956
957     ColorSpaceData colorSpace();
958 #endif
959
960 #if ENABLE(SERVICE_CONTROLS)
961     void replaceSelectionWithPasteboardData(const Vector<String>& types, const IPC::DataReference&);
962 #endif
963
964     void pageScaleFactorDidChange(double);
965     void pluginScaleFactorDidChange(double);
966     void pluginZoomFactorDidChange(double);
967
968     // Find.
969     void findString(const String&, FindOptions, unsigned maxMatchCount);
970     void findStringMatches(const String&, FindOptions, unsigned maxMatchCount);
971     void getImageForFindMatch(int32_t matchIndex);
972     void selectFindMatch(int32_t matchIndex);
973     void didGetImageForFindMatch(const ShareableBitmap::Handle& contentImageHandle, uint32_t matchIndex);
974     void hideFindUI();
975     void countStringMatches(const String&, FindOptions, unsigned maxMatchCount);
976     void replaceMatches(Vector<uint32_t>&& matchIndices, const String& replacementText, bool selectionOnly, Function<void(uint64_t, CallbackBase::Error)>&&);
977     void didCountStringMatches(const String&, uint32_t matchCount);
978     void setTextIndicator(const WebCore::TextIndicatorData&, uint64_t /* WebCore::TextIndicatorWindowLifetime */ lifetime = 0 /* Permanent */);
979     void setTextIndicatorAnimationProgress(float);
980     void clearTextIndicator();
981     void didFindString(const String&, const Vector<WebCore::IntRect>&, uint32_t matchCount, int32_t matchIndex, bool didWrapAround);
982     void didFailToFindString(const String&);
983     void didFindStringMatches(const String&, const Vector<Vector<WebCore::IntRect>>& matchRects, int32_t firstIndexAfterSelection);
984
985     void getContentsAsString(WTF::Function<void (const String&, CallbackBase::Error)>&&);
986 #if PLATFORM(COCOA)
987     void getContentsAsAttributedString(CompletionHandler<void(const AttributedString&)>&&);
988 #endif
989     void getBytecodeProfile(WTF::Function<void (const String&, CallbackBase::Error)>&&);
990     void getSamplingProfilerOutput(WTF::Function<void (const String&, CallbackBase::Error)>&&);
991
992 #if ENABLE(MHTML)
993     void getContentsAsMHTMLData(Function<void (API::Data*, CallbackBase::Error)>&&);
994 #endif
995     void getMainResourceDataOfFrame(WebFrameProxy*, Function<void (API::Data*, CallbackBase::Error)>&&);
996     void getResourceDataFromFrame(WebFrameProxy*, API::URL*, Function<void (API::Data*, CallbackBase::Error)>&&);
997     void getRenderTreeExternalRepresentation(WTF::Function<void (const String&, CallbackBase::Error)>&&);
998     void getSelectionOrContentsAsString(WTF::Function<void (const String&, CallbackBase::Error)>&&);
999     void getSelectionAsWebArchiveData(Function<void (API::Data*, CallbackBase::Error)>&&);
1000     void getSourceForFrame(WebFrameProxy*, WTF::Function<void (const String&, CallbackBase::Error)>&&);
1001     void getWebArchiveOfFrame(WebFrameProxy*, Function<void (API::Data*, CallbackBase::Error)>&&);
1002     void runJavaScriptInMainFrame(const String&, bool, WTF::Function<void (API::SerializedScriptValue*, bool hadException, const WebCore::ExceptionDetails&, CallbackBase::Error)>&& callbackFunction);
1003     void runJavaScriptInMainFrameScriptWorld(const String&, bool, const Optional<String>& worldName, WTF::Function<void(API::SerializedScriptValue*, bool hadException, const WebCore::ExceptionDetails&, CallbackBase::Error)>&& callbackFunction);
1004     // For sub frames.
1005     void runJavaScriptInFrame(uint64_t frameID, const String& script, bool forceUserGesture, WTF::Function<void(API::SerializedScriptValue*, bool hadException, const WebCore::ExceptionDetails&, CallbackBase::Error)>&& callbackFunction);
1006     void forceRepaint(RefPtr<VoidCallback>&&);
1007
1008     float headerHeight(WebFrameProxy&);
1009     float footerHeight(WebFrameProxy&);
1010     void drawHeader(WebFrameProxy&, WebCore::FloatRect&&);
1011     void drawFooter(WebFrameProxy&, WebCore::FloatRect&&);
1012
1013 #if PLATFORM(COCOA)
1014     // Dictionary.
1015     void performDictionaryLookupAtLocation(const WebCore::FloatPoint&);
1016     void performDictionaryLookupOfCurrentSelection();
1017 #endif
1018
1019     class PolicyDecisionSender;
1020     enum class WillContinueLoadInNewProcess : bool { No, Yes };
1021     void receivedPolicyDecision(WebCore::PolicyAction, API::Navigation*, Optional<WebsitePoliciesData>&&, Ref<PolicyDecisionSender>&&, WillContinueLoadInNewProcess = WillContinueLoadInNewProcess::No);
1022     void receivedNavigationPolicyDecision(WebCore::PolicyAction, API::Navigation*, ProcessSwapRequestedByClient, WebFrameProxy&, API::WebsitePolicies*, Ref<PolicyDecisionSender>&&);
1023
1024     void backForwardRemovedItem(const WebCore::BackForwardItemIdentifier&);
1025
1026 #if ENABLE(DRAG_SUPPORT)    
1027     // Drag and drop support.
1028     void dragEntered(WebCore::DragData&, const String& dragStorageName = String());
1029     void dragUpdated(WebCore::DragData&, const String& dragStorageName = String());
1030     void dragExited(WebCore::DragData&, const String& dragStorageName = String());
1031     void performDragOperation(WebCore::DragData&, const String& dragStorageName, SandboxExtension::Handle&&, SandboxExtension::HandleArray&&);
1032     void didPerformDragOperation(bool handled);
1033
1034     void didPerformDragControllerAction(uint64_t dragOperation, WebCore::DragHandlingMethod, bool mouseIsOverFileInput, unsigned numberOfItemsToBeAccepted, const WebCore::IntRect& insertionRect, const WebCore::IntRect& editableElementRect);
1035     void dragEnded(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition, uint64_t operation);
1036     void didStartDrag();
1037     void dragCancelled();
1038     void setDragCaretRect(const WebCore::IntRect&);
1039 #if PLATFORM(COCOA)
1040     void startDrag(const WebCore::DragItem&, const ShareableBitmap::Handle& dragImageHandle);
1041     void setPromisedDataForImage(const String& pasteboardName, const SharedMemory::Handle& imageHandle, uint64_t imageSize, const String& filename, const String& extension,
1042                          const String& title, const String& url, const String& visibleURL, const SharedMemory::Handle& archiveHandle, uint64_t archiveSize);
1043 #endif
1044 #if PLATFORM(GTK)
1045     void startDrag(WebSelectionData&&, uint64_t dragOperation, const ShareableBitmap::Handle& dragImage);
1046 #endif
1047 #endif
1048
1049     void processDidBecomeUnresponsive();
1050     void processDidBecomeResponsive();
1051     void processDidTerminate(ProcessTerminationReason);
1052     void provisionalProcessDidTerminate();
1053     void dispatchProcessDidTerminate(ProcessTerminationReason);
1054     void willChangeProcessIsResponsive();
1055     void didChangeProcessIsResponsive();
1056
1057 #if PLATFORM(IOS_FAMILY)
1058     void processWillBecomeSuspended();
1059     void processWillBecomeForeground();
1060 #endif
1061
1062 #if HAVE(VISIBILITY_PROPAGATION_VIEW)
1063     void didCreateContextForVisibilityPropagation(LayerHostingContextID);
1064 #endif
1065
1066     virtual void enterAcceleratedCompositingMode(const LayerTreeContext&);
1067     virtual void exitAcceleratedCompositingMode();
1068     virtual void updateAcceleratedCompositingMode(const LayerTreeContext&);
1069
1070     void addEditCommand(WebEditCommandProxy&);
1071     void removeEditCommand(WebEditCommandProxy&);
1072     void registerEditCommand(Ref<WebEditCommandProxy>&&, UndoOrRedo);
1073
1074     bool canUndo();
1075     bool canRedo();
1076
1077 #if PLATFORM(COCOA)
1078     void registerKeypressCommandName(const String& name) { m_knownKeypressCommandNames.add(name); }
1079     bool isValidKeypressCommandName(const String& name) const { return m_knownKeypressCommandNames.contains(name); }
1080 #endif
1081
1082     WebProcessProxy& ensureRunningProcess();
1083     WebProcessProxy& process() { return m_process; }
1084     ProcessID processIdentifier() const;
1085
1086     WebPreferences& preferences() { return m_preferences; }
1087     void setPreferences(WebPreferences&);
1088
1089     WebPageGroup& pageGroup() { return m_pageGroup; }
1090
1091     bool hasRunningProcess() const;
1092     void launchInitialProcessIfNecessary();
1093
1094 #if ENABLE(DRAG_SUPPORT)
1095     WebCore::DragOperation currentDragOperation() const { return m_currentDragOperation; }
1096     WebCore::DragHandlingMethod currentDragHandlingMethod() const { return m_currentDragHandlingMethod; }
1097     bool currentDragIsOverFileInput() const { return m_currentDragIsOverFileInput; }
1098     unsigned currentDragNumberOfFilesToBeAccepted() const { return m_currentDragNumberOfFilesToBeAccepted; }
1099     WebCore::IntRect currentDragCaretRect() const { return m_currentDragCaretRect; }
1100     WebCore::IntRect currentDragCaretEditableElementRect() const { return m_currentDragCaretEditableElementRect; }
1101     void resetCurrentDragInformation();
1102     void didEndDragging();
1103 #endif
1104
1105     void preferencesDidChange();
1106
1107 #if ENABLE(CONTEXT_MENUS)
1108     // Called by the WebContextMenuProxy.
1109     void contextMenuItemSelected(const WebContextMenuItemData&);
1110     void handleContextMenuKeyEvent();
1111 #endif
1112
1113     // Called by the WebOpenPanelResultListenerProxy.
1114 #if PLATFORM(IOS_FAMILY)
1115     void didChooseFilesForOpenPanelWithDisplayStringAndIcon(const Vector<String>&, const String& displayString, const API::Data* iconData);
1116 #endif
1117     void didChooseFilesForOpenPanel(const Vector<String>&);
1118     void didCancelForOpenPanel();
1119
1120     WebPageCreationParameters creationParameters(WebProcessProxy&, DrawingAreaProxy&);
1121
1122     void handleDownloadRequest(DownloadProxy&);
1123
1124     void advanceToNextMisspelling(bool startBeforeSelection);
1125     void changeSpellingToWord(const String& word);
1126 #if USE(APPKIT)
1127     void uppercaseWord();
1128     void lowercaseWord();
1129     void capitalizeWord();
1130 #endif
1131
1132 #if PLATFORM(COCOA)
1133     bool isSmartInsertDeleteEnabled() const { return m_isSmartInsertDeleteEnabled; }
1134     void setSmartInsertDeleteEnabled(bool);
1135 #endif
1136
1137     void setCanRunModal(bool);
1138     bool canRunModal();
1139
1140     void beginPrinting(WebFrameProxy*, const PrintInfo&);
1141     void endPrinting();
1142     void computePagesForPrinting(WebFrameProxy*, const PrintInfo&, Ref<ComputedPagesCallback>&&);
1143 #if PLATFORM(COCOA)
1144     void drawRectToImage(WebFrameProxy*, const PrintInfo&, const WebCore::IntRect&, const WebCore::IntSize&, Ref<ImageCallback>&&);
1145     void drawPagesToPDF(WebFrameProxy*, const PrintInfo&, uint32_t first, uint32_t count, Ref<DataCallback>&&);
1146 #if PLATFORM(IOS_FAMILY)
1147     uint32_t computePagesForPrintingAndDrawToPDF(uint64_t frameID, const PrintInfo&, DrawToPDFCallback::CallbackFunction&&);
1148     void drawToPDFCallback(const IPC::DataReference& pdfData, WebKit::CallbackID);
1149 #endif
1150 #elif PLATFORM(GTK)
1151     void drawPagesForPrinting(WebFrameProxy*, const PrintInfo&, Ref<PrintFinishedCallback>&&);
1152 #endif
1153
1154     PageLoadState& pageLoadState() { return m_pageLoadState; }
1155
1156 #if PLATFORM(COCOA)
1157     void handleAlternativeTextUIResult(const String& result);
1158 #endif
1159
1160     void saveDataToFileInDownloadsFolder(String&& suggestedFilename, String&& mimeType, URL&& originatingURL, API::Data&);
1161     void savePDFToFileInDownloadsFolder(String&& suggestedFilename, URL&& originatingURL, const IPC::DataReference&);
1162 #if PLATFORM(COCOA)
1163     void savePDFToTemporaryFolderAndOpenWithNativeApplicationRaw(const String& suggestedFilename, const String& originatingURLString, const uint8_t* data, unsigned long size, const String& pdfUUID);
1164     void savePDFToTemporaryFolderAndOpenWithNativeApplication(const String& suggestedFilename, const String& originatingURLString, const IPC::DataReference&, const String& pdfUUID);
1165     void openPDFFromTemporaryFolderWithNativeApplication(const String& pdfUUID);
1166 #endif
1167
1168 #if ENABLE(PDFKIT_PLUGIN)
1169     void showPDFContextMenu(const WebKit::PDFContextMenu&, CompletionHandler<void(Optional<int32_t>&&)>&&);
1170 #endif
1171     WebCore::IntRect visibleScrollerThumbRect() const { return m_visibleScrollerThumbRect; }
1172
1173     uint64_t renderTreeSize() const { return m_renderTreeSize; }
1174
1175     void setMediaVolume(float);
1176     void setMuted(WebCore::MediaProducer::MutedStateFlags);
1177     void setMayStartMediaWhenInWindow(bool);
1178     bool mayStartMediaWhenInWindow() const { return m_mayStartMediaWhenInWindow; }
1179     void setMediaCaptureEnabled(bool);
1180     bool mediaCaptureEnabled() const { return m_mediaCaptureEnabled; }
1181     void stopMediaCapture();
1182
1183     void stopAllMediaPlayback();
1184     void suspendAllMediaPlayback();
1185     void resumeAllMediaPlayback();
1186
1187 #if ENABLE(MEDIA_SESSION)
1188     bool hasMediaSessionWithActiveMediaElements() const { return m_hasMediaSessionWithActiveMediaElements; }
1189     void handleMediaEvent(WebCore::MediaEventType);
1190     void setVolumeOfMediaElement(double, uint64_t);
1191 #endif
1192         
1193 #if ENABLE(POINTER_LOCK)
1194     void didAllowPointerLock();
1195     void didDenyPointerLock();
1196 #endif
1197
1198     // WebPopupMenuProxy::Client
1199     NativeWebMouseEvent* currentlyProcessedMouseDownEvent() override;
1200
1201     void setSuppressVisibilityUpdates(bool flag);
1202     bool suppressVisibilityUpdates() { return m_suppressVisibilityUpdates; }
1203
1204 #if PLATFORM(IOS_FAMILY)
1205     void willStartUserTriggeredZooming();
1206
1207     void potentialTapAtPosition(const WebCore::FloatPoint&, bool shouldRequestMagnificationInformation, uint64_t& requestID);
1208     void commitPotentialTap(OptionSet<WebKit::WebEvent::Modifier>, uint64_t layerTreeTransactionIdAtLastTouchStart);
1209     void cancelPotentialTap();
1210     void tapHighlightAtPosition(const WebCore::FloatPoint&, uint64_t& requestID);
1211     void handleTap(const WebCore::FloatPoint&, OptionSet<WebKit::WebEvent::Modifier>, uint64_t layerTreeTransactionIdAtLastTouchStart);
1212     void didRecognizeLongPress();
1213
1214     void inspectorNodeSearchMovedToPosition(const WebCore::FloatPoint&);
1215     void inspectorNodeSearchEndedAtPosition(const WebCore::FloatPoint&);
1216
1217     void blurFocusedElement();
1218     void setIsShowingInputViewForFocusedElement(bool);
1219 #endif
1220
1221     void postMessageToInjectedBundle(const String& messageName, API::Object* messageBody);
1222
1223 #if ENABLE(INPUT_TYPE_COLOR)
1224     void setColorPickerColor(const WebCore::Color&);
1225     void endColorPicker();
1226 #endif
1227
1228     WebCore::IntSize viewLayoutSize() const { return m_viewLayoutSize; }
1229     void setViewLayoutSize(const WebCore::IntSize&);
1230
1231     bool autoSizingShouldExpandToViewHeight() const { return m_autoSizingShouldExpandToViewHeight; }
1232     void setAutoSizingShouldExpandToViewHeight(bool);
1233
1234     void setViewportSizeForCSSViewportUnits(const WebCore::IntSize&);
1235     WebCore::IntSize viewportSizeForCSSViewportUnits() const { return m_viewportSizeForCSSViewportUnits.valueOr(WebCore::IntSize()); }
1236
1237     void didReceiveAuthenticationChallengeProxy(uint64_t frameID, Ref<AuthenticationChallengeProxy>&&);
1238
1239     SpellDocumentTag spellDocumentTag();
1240
1241     void didFinishCheckingText(uint64_t requestID, const Vector<WebCore::TextCheckingResult>&);
1242     void didCancelCheckingText(uint64_t requestID);
1243
1244     void connectionWillOpen(IPC::Connection&);
1245     void webProcessWillShutDown();
1246
1247     void didSaveToPageCache();
1248         
1249     void setScrollPinningBehavior(WebCore::ScrollPinningBehavior);
1250     WebCore::ScrollPinningBehavior scrollPinningBehavior() const { return m_scrollPinningBehavior; }
1251
1252     void setOverlayScrollbarStyle(Optional<WebCore::ScrollbarOverlayStyle>);
1253     Optional<WebCore::ScrollbarOverlayStyle> overlayScrollbarStyle() const { return m_scrollbarOverlayStyle; }
1254
1255     // When the state of the window changes such that the WebPage needs immediate update, the UIProcess sends a new
1256     // ActivityStateChangeID to the WebProcess through the SetActivityState message. The UIProcess will wait till it
1257     // receives a CommitLayerTree which has an ActivityStateChangeID equal to or greater than the one it sent.
1258     ActivityStateChangeID takeNextActivityStateChangeID() { return ++m_currentActivityStateChangeID; }
1259
1260     bool shouldRecordNavigationSnapshots() const { return m_shouldRecordNavigationSnapshots; }
1261     void setShouldRecordNavigationSnapshots(bool shouldRecordSnapshots) { m_shouldRecordNavigationSnapshots = shouldRecordSnapshots; }
1262     void recordAutomaticNavigationSnapshot();
1263     void suppressNextAutomaticNavigationSnapshot() { m_shouldSuppressNextAutomaticNavigationSnapshot = true; }
1264     void recordNavigationSnapshot(WebBackForwardListItem&);
1265     void requestFocusedElementInformation(Function<void(const FocusedElementInformation&, CallbackBase::Error)>&&);
1266
1267 #if PLATFORM(COCOA) || PLATFORM(GTK)
1268     RefPtr<ViewSnapshot> takeViewSnapshot();
1269 #endif
1270
1271 #if ENABLE(WEB_CRYPTO)
1272     void wrapCryptoKey(const Vector<uint8_t>&, CompletionHandler<void(bool, Vector<uint8_t>&&)>&&);
1273     void unwrapCryptoKey(const Vector<uint8_t>&, CompletionHandler<void(bool, Vector<uint8_t>&&)>&&);
1274 #endif
1275
1276     void signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String& challengeString, const URL&, CompletionHandler<void(String)>&&);
1277
1278     void takeSnapshot(WebCore::IntRect, WebCore::IntSize bitmapSize, SnapshotOptions, WTF::Function<void (const ShareableBitmap::Handle&, CallbackBase::Error)>&&);
1279
1280     void navigationGestureDidBegin();
1281     void navigationGestureWillEnd(bool willNavigate, WebBackForwardListItem&);
1282     void navigationGestureDidEnd(bool willNavigate, WebBackForwardListItem&);
1283     void navigationGestureDidEnd();
1284     void navigationGestureSnapshotWasRemoved();
1285     void willRecordNavigationSnapshot(WebBackForwardListItem&);
1286
1287     bool isShowingNavigationGestureSnapshot() const { return m_isShowingNavigationGestureSnapshot; }
1288
1289     bool isPlayingAudio() const { return !!(m_mediaState & WebCore::MediaProducer::IsPlayingAudio); }
1290     void isPlayingMediaDidChange(WebCore::MediaProducer::MediaStateFlags, uint64_t);
1291     void updatePlayingMediaDidChange(WebCore::MediaProducer::MediaStateFlags);
1292     bool hasActiveAudioStream() const { return m_mediaState & WebCore::MediaProducer::HasActiveAudioCaptureDevice; }
1293     bool hasActiveVideoStream() const { return m_mediaState & WebCore::MediaProducer::HasActiveVideoCaptureDevice; }
1294     WebCore::MediaProducer::MediaStateFlags mediaStateFlags() const { return m_mediaState; }
1295     void handleAutoplayEvent(WebCore::AutoplayEvent, OptionSet<WebCore::AutoplayEventFlags>);
1296
1297     void videoControlsManagerDidChange();
1298     bool hasActiveVideoForControlsManager() const;
1299     void requestControlledElementID() const;
1300     void handleControlledElementIDResponse(const String&) const;
1301     bool isPlayingVideoInEnhancedFullscreen() const;
1302
1303 #if PLATFORM(COCOA)
1304     void requestActiveNowPlayingSessionInfo(Ref<NowPlayingInfoCallback>&&);
1305     void nowPlayingInfoCallback(bool, bool, const String&, double, double, uint64_t, CallbackID);
1306 #endif
1307
1308 #if ENABLE(MEDIA_SESSION)
1309     void hasMediaSessionWithActiveMediaElementsDidChange(bool);
1310     void mediaSessionMetadataDidChange(const WebCore::MediaSessionMetadata&);
1311     void focusedContentMediaElementDidChange(uint64_t);
1312 #endif
1313
1314 #if PLATFORM(MAC)
1315     API::HitTestResult* lastMouseMoveHitTestResult() const { return m_lastMouseMoveHitTestResult.get(); }
1316     void performImmediateActionHitTestAtLocation(WebCore::FloatPoint);
1317
1318     void immediateActionDidUpdate();
1319     void immediateActionDidCancel();
1320     void immediateActionDidComplete();
1321
1322     NSObject *immediateActionAnimationControllerForHitTestResult(RefPtr<API::HitTestResult>, uint64_t, RefPtr<API::Object>);
1323
1324     void handleAcceptedCandidate(WebCore::TextCheckingResult);
1325     void didHandleAcceptedCandidate();
1326
1327     void setHeaderBannerHeightForTesting(int);
1328     void setFooterBannerHeightForTesting(int);
1329 #endif
1330
1331     bool scrollingUpdatesDisabledForTesting();
1332
1333     void installActivityStateChangeCompletionHandler(Function<void()>&&);
1334
1335 #if USE(UNIFIED_TEXT_CHECKING)
1336     void checkTextOfParagraph(const String& text, OptionSet<WebCore::TextCheckingType> checkingTypes, int32_t insertionPoint, CompletionHandler<void(Vector<WebCore::TextCheckingResult>&&)>&&);
1337 #endif
1338     void getGuessesForWord(const String& word, const String& context, int32_t insertionPoint, CompletionHandler<void(Vector<String>&&)>&&);
1339
1340     void setShouldDispatchFakeMouseMoveEvents(bool);
1341
1342     // Diagnostic messages logging.
1343     void logDiagnosticMessage(const String& message, const String& description, WebCore::ShouldSample);
1344     void logDiagnosticMessageWithResult(const String& message, const String& description, uint32_t result, WebCore::ShouldSample);
1345     void logDiagnosticMessageWithValue(const String& message, const String& description, double value, unsigned significantFigures, WebCore::ShouldSample);
1346     void logDiagnosticMessageWithEnhancedPrivacy(const String& message, const String& description, WebCore::ShouldSample);
1347     void logDiagnosticMessageWithValueDictionary(const String& message, const String& description, const WebCore::DiagnosticLoggingClient::ValueDictionary&, WebCore::ShouldSample);
1348
1349     // Performance logging.
1350     void logScrollingEvent(uint32_t eventType, MonotonicTime, uint64_t);
1351
1352     // Form validation messages.
1353     void showValidationMessage(const WebCore::IntRect& anchorClientRect, const String& message);
1354     void hideValidationMessage();
1355 #if PLATFORM(COCOA)
1356     WebCore::ValidationBubble* validationBubble() const { return m_validationBubble.get(); } // For testing.
1357 #endif
1358
1359 #if PLATFORM(IOS_FAMILY)
1360     void setIsKeyboardAnimatingIn(bool isKeyboardAnimatingIn) { m_isKeyboardAnimatingIn = isKeyboardAnimatingIn; }
1361 #endif
1362
1363 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS_FAMILY)
1364     void addPlaybackTargetPickerClient(uint64_t);
1365     void removePlaybackTargetPickerClient(uint64_t);
1366     void showPlaybackTargetPicker(uint64_t, const WebCore::FloatRect&, bool hasVideo);
1367     void playbackTargetPickerClientStateDidChange(uint64_t, WebCore::MediaProducer::MediaStateFlags);
1368     void setMockMediaPlaybackTargetPickerEnabled(bool);
1369     void setMockMediaPlaybackTargetPickerState(const String&, WebCore::MediaPlaybackTargetContext::State);
1370
1371     // WebMediaSessionManagerClient
1372     void setPlaybackTarget(uint64_t, Ref<WebCore::MediaPlaybackTarget>&&) override;
1373     void externalOutputDeviceAvailableDidChange(uint64_t, bool) override;
1374     void setShouldPlayToPlaybackTarget(uint64_t, bool) override;
1375 #endif
1376
1377     void didChangeBackgroundColor();
1378     void didLayoutForCustomContentProvider();
1379
1380     // For testing
1381     void clearWheelEventTestTrigger();
1382     void callAfterNextPresentationUpdate(WTF::Function<void (CallbackBase::Error)>&&);
1383
1384     void didReachLayoutMilestone(OptionSet<WebCore::LayoutMilestone>);
1385
1386     void didRestoreScrollPosition();
1387
1388     void getLoadDecisionForIcon(const WebCore::LinkIcon&, WebKit::CallbackID);
1389     void finishedLoadingIcon(WebKit::CallbackID, const IPC::DataReference&);
1390
1391     void setFocus(bool focused);
1392     void setWindowFrame(const WebCore::FloatRect&);
1393     void getWindowFrame(Messages::WebPageProxy::GetWindowFrame::DelayedReply&&);
1394     void getWindowFrameWithCallback(Function<void(WebCore::FloatRect)>&&);
1395
1396     bool isResourceCachingDisabled() const { return m_isResourceCachingDisabled; }
1397     void setResourceCachingDisabled(bool);
1398
1399     WebCore::UserInterfaceLayoutDirection userInterfaceLayoutDirection();
1400     void setUserInterfaceLayoutDirection(WebCore::UserInterfaceLayoutDirection);
1401
1402     bool hasHadSelectionChangesFromUserInteraction() const { return m_hasHadSelectionChangesFromUserInteraction; }
1403     bool isTouchBarUpdateSupressedForHiddenContentEditable() const { return m_isTouchBarUpdateSupressedForHiddenContentEditable; }
1404     bool isNeverRichlyEditableForTouchBar() const { return m_isNeverRichlyEditableForTouchBar; }
1405
1406     bool isAlwaysOnLoggingAllowed() const;
1407
1408 #if ENABLE(GAMEPAD)
1409     void gamepadActivity(const Vector<GamepadData>&, bool shouldMakeGamepadsVisible);
1410 #endif
1411
1412     void isLoadingChanged() { activityStateDidChange(WebCore::ActivityState::IsLoading); }
1413
1414     void clearUserMediaState();
1415
1416     void setShouldSkipWaitingForPaintAfterNextViewDidMoveToWindow(bool shouldSkip) { m_shouldSkipWaitingForPaintAfterNextViewDidMoveToWindow = shouldSkip; }
1417
1418     void setURLSchemeHandlerForScheme(Ref<WebURLSchemeHandler>&&, const String& scheme);
1419     WebURLSchemeHandler* urlSchemeHandlerForScheme(const String& scheme);
1420
1421 #if PLATFORM(COCOA)
1422     void createSandboxExtensionsIfNeeded(const Vector<String>& files, SandboxExtension::Handle& fileReadHandle, SandboxExtension::HandleArray& fileUploadHandles);
1423 #endif
1424     void editorStateChanged(const EditorState&);
1425
1426 #if PLATFORM(COCOA)
1427     void touchBarMenuDataRemoved();
1428     void touchBarMenuDataChanged(const TouchBarMenuData&);
1429     void touchBarMenuItemDataAdded(const TouchBarMenuItemData&);
1430     void touchBarMenuItemDataRemoved(const TouchBarMenuItemData&);
1431 #endif
1432
1433 #if ENABLE(RESOURCE_LOAD_STATISTICS)
1434     void requestStorageAccessConfirm(const WebCore::RegistrableDomain& subFrameDomain, const WebCore::RegistrableDomain& topFrameDomain, uint64_t frameID, CompletionHandler<void(bool)>&&);
1435 #endif
1436
1437 #if ENABLE(DEVICE_ORIENTATION)
1438     void shouldAllowDeviceOrientationAndMotionAccess(uint64_t frameID, WebCore::SecurityOriginData&&, bool mayPrompt, CompletionHandler<void(WebCore::DeviceOrientationOrMotionPermissionState)>&&);
1439 #endif
1440
1441     static WebPageProxy* nonEphemeralWebPageProxy();
1442
1443 #if ENABLE(ATTACHMENT_ELEMENT)
1444     RefPtr<API::Attachment> attachmentForIdentifier(const String& identifier) const;
1445     void insertAttachment(Ref<API::Attachment>&&, Function<void(CallbackBase::Error)>&&);
1446     void updateAttachmentAttributes(const API::Attachment&, Function<void(CallbackBase::Error)>&&);
1447     void serializedAttachmentDataForIdentifiers(const Vector<String>&, CompletionHandler<void(Vector<WebCore::SerializedAttachmentData>&&)>&&);
1448     void registerAttachmentIdentifier(const String&);
1449     void didInvalidateDataForAttachment(API::Attachment&);
1450
1451     enum class ShouldUpdateAttachmentAttributes : bool { No, Yes };
1452     ShouldUpdateAttachmentAttributes willUpdateAttachmentAttributes(const API::Attachment&);
1453 #endif
1454
1455 #if ENABLE(APPLICATION_MANIFEST)
1456     void getApplicationManifest(Function<void(const Optional<WebCore::ApplicationManifest>&, CallbackBase::Error)>&&);
1457 #endif
1458
1459     WebPreferencesStore preferencesStore() const;
1460
1461     void setDefersLoadingForTesting(bool);
1462
1463     bool isPageOpenedByDOMShowingInitialEmptyDocument() const;
1464
1465     WebCore::IntRect syncRootViewToScreen(const WebCore::IntRect& viewRect);
1466
1467 #if ENABLE(DATALIST_ELEMENT)
1468     void didSelectOption(const String&);
1469     void didCloseSuggestions();
1470 #endif
1471
1472     void updateCurrentModifierState();
1473
1474 #if HAVE(PENCILKIT)
1475     EditableImageController& editableImageController() { return *m_editableImageController; }
1476 #endif
1477
1478     ProvisionalPageProxy* provisionalPageProxy() const { return m_provisionalPage.get(); }
1479     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&);
1480
1481     // Logic shared between the WebPageProxy and the ProvisionalPageProxy.
1482     void didStartProvisionalLoadForFrameShared(Ref<WebProcessProxy>&&, uint64_t frameID, uint64_t navigationID, URL&&, URL&& unreachableURL, const UserData&);
1483     void didFailProvisionalLoadForFrameShared(Ref<WebProcessProxy>&&, uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, uint64_t navigationID, const String& provisionalURL, const WebCore::ResourceError&, WebCore::WillContinueLoading, const UserData&);
1484     void didReceiveServerRedirectForProvisionalLoadForFrameShared(Ref<WebProcessProxy>&&, uint64_t frameID, uint64_t navigationID, WebCore::ResourceRequest&&, const UserData&);
1485     void didPerformServerRedirectShared(Ref<WebProcessProxy>&&, const String& sourceURLString, const String& destinationURLString, uint64_t frameID);
1486     void didPerformClientRedirectShared(Ref<WebProcessProxy>&&, const String& sourceURLString, const String& destinationURLString, uint64_t frameID);
1487     void didNavigateWithNavigationDataShared(Ref<WebProcessProxy>&&, const WebNavigationDataStore&, uint64_t frameID);
1488     void didChangeProvisionalURLForFrameShared(Ref<WebProcessProxy>&&, uint64_t frameID, uint64_t navigationID, URL&&);
1489     void decidePolicyForNavigationActionAsyncShared(Ref<WebProcessProxy>&&, uint64_t frameID, WebCore::SecurityOriginData&& frameSecurityOrigin, WebCore::PolicyCheckIdentifier,
1490         uint64_t navigationID, NavigationActionData&&, FrameInfoData&&, uint64_t originatingPageID, const WebCore::ResourceRequest& originalRequest, WebCore::ResourceRequest&&,
1491         IPC::FormDataReference&& requestBody, WebCore::ResourceResponse&& redirectResponse, const UserData&, uint64_t listenerID);
1492     void decidePolicyForResponseShared(Ref<WebProcessProxy>&&, uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, WebCore::PolicyCheckIdentifier,
1493         uint64_t navigationID, const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, bool canShowMIMEType, const String& downloadAttribute, uint64_t listenerID, const UserData&);
1494     void startURLSchemeTaskShared(Ref<WebProcessProxy>&&, URLSchemeTaskParameters&&);
1495     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);
1496     void loadRequestWithNavigationShared(Ref<WebProcessProxy>&&, API::Navigation&, WebCore::ResourceRequest&&, WebCore::ShouldOpenExternalURLsPolicy, API::Object* userData, WebCore::ShouldTreatAsContinuingLoad, Optional<WebsitePoliciesData>&& = WTF::nullopt);
1497     void backForwardGoToItemShared(Ref<WebProcessProxy>&&, const WebCore::BackForwardItemIdentifier&, CompletionHandler<void(SandboxExtension::Handle&&)>&&);
1498     void decidePolicyForNavigationActionSyncShared(Ref<WebProcessProxy>&&, uint64_t frameID, bool isMainFrame, WebCore::SecurityOriginData&&, WebCore::PolicyCheckIdentifier, uint64_t navigationID, NavigationActionData&&,
1499         FrameInfoData&&, uint64_t originatingPageID, const WebCore::ResourceRequest& originalRequest, WebCore::ResourceRequest&&, IPC::FormDataReference&& requestBody,
1500         WebCore::ResourceResponse&& redirectResponse, const UserData&, Messages::WebPageProxy::DecidePolicyForNavigationActionSync::DelayedReply&&);
1501 #if USE(QUICK_LOOK)
1502     void didRequestPasswordForQuickLookDocumentInMainFrameShared(Ref<WebProcessProxy>&&, const String& fileName);
1503 #endif
1504
1505     void dumpAdClickAttribution(CompletionHandler<void(const String&)>&&);
1506     void clearAdClickAttribution(CompletionHandler<void()>&&);
1507     void setAdClickAttributionOverrideTimerForTesting(bool value, CompletionHandler<void()>&&);
1508     void setAdClickAttributionConversionURLForTesting(const URL&, CompletionHandler<void()>&&);
1509     void markAdClickAttributionsAsExpiredForTesting(CompletionHandler<void()>&&);
1510
1511 #if ENABLE(SPEECH_SYNTHESIS)
1512     void speechSynthesisVoiceList(CompletionHandler<void(Vector<WebSpeechSynthesisVoice>&&)>&&);
1513     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()>&&);
1514     void speechSynthesisCancel();
1515     void speechSynthesisPause(CompletionHandler<void()>&&);
1516     void speechSynthesisResume(CompletionHandler<void()>&&);
1517 #endif
1518
1519     void configureLoggingChannel(const String&, WTFLogChannelState, WTFLogLevel);
1520
1521     void addObserver(WebViewDidMoveToWindowObserver&);
1522     void removeObserver(WebViewDidMoveToWindowObserver&);
1523     void webViewDidMoveToWindow();
1524
1525 #if HAVE(LOAD_OPTIMIZER)
1526 WEBPAGEPROXY_LOADOPTIMIZER_ADDITIONS_1
1527 #endif
1528
1529     Logger& logger();
1530
1531     // IPC::MessageReceiver
1532     // Implemented in generated WebPageProxyMessageReceiver.cpp
1533     void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override;
1534     void didReceiveSyncMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&) override;
1535
1536 private:
1537     WebPageProxy(PageClient&, WebProcessProxy&, uint64_t pageID, Ref<API::PageConfiguration>&&);
1538     void platformInitialize();
1539
1540     void notifyProcessPoolToPrewarm();
1541
1542     RefPtr<API::Navigation> goToBackForwardItem(WebBackForwardListItem&, WebCore::FrameLoadType);
1543
1544     void updateActivityState(OptionSet<WebCore::ActivityState::Flag> flagsToUpdate = WebCore::ActivityState::allFlags());
1545     void updateThrottleState();
1546     void updateHiddenPageThrottlingAutoIncreases();
1547
1548     bool suspendCurrentPageIfPossible(API::Navigation&, Optional<uint64_t> mainFrameID, ProcessSwapRequestedByClient);
1549
1550     enum class ResetStateReason {
1551         PageInvalidated,
1552         WebProcessExited,
1553         NavigationSwap,
1554     };
1555     void resetState(ResetStateReason);
1556     void resetStateAfterProcessExited(ProcessTerminationReason);
1557
1558     void setUserAgent(String&&);
1559
1560     // IPC::MessageSender
1561     bool sendMessage(std::unique_ptr<IPC::Encoder>, OptionSet<IPC::SendOption>) override;
1562     IPC::Connection* messageSenderConnection() const override;
1563     uint64_t messageSenderDestinationID() const override;
1564
1565     // WebPopupMenuProxy::Client
1566     void valueChangedForPopupMenu(WebPopupMenuProxy*, int32_t newSelectedIndex) override;
1567     void setTextFromItemForPopupMenu(WebPopupMenuProxy*, int32_t index) override;
1568 #if PLATFORM(GTK)
1569     void failedToShowPopupMenu() override;
1570 #endif
1571
1572 #if ENABLE(POINTER_LOCK)
1573     void requestPointerLock();
1574     void requestPointerUnlock();
1575 #endif
1576
1577     void didCreateMainFrame(uint64_t frameID);
1578     void didCreateSubframe(uint64_t frameID);
1579     void didCreateWindow(uint64_t frameID, WebCore::GlobalWindowIdentifier&&);
1580
1581     void didStartProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, URL&&, URL&& unreachableURL, const UserData&);
1582     void didReceiveServerRedirectForProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, WebCore::ResourceRequest&&, const UserData&);
1583     void willPerformClientRedirectForFrame(uint64_t frameID, const String& url, double delay, WebCore::LockBackForwardList);
1584     void didCancelClientRedirectForFrame(uint64_t frameID);
1585     void didChangeProvisionalURLForFrame(uint64_t frameID, uint64_t navigationID, URL&&);
1586     void didFailProvisionalLoadForFrame(uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, uint64_t navigationID, const String& provisionalURL, const WebCore::ResourceError&, WebCore::WillContinueLoading, const UserData&);
1587     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&);
1588     void didFinishDocumentLoadForFrame(uint64_t frameID, uint64_t navigationID, const UserData&);
1589     void didFinishLoadForFrame(uint64_t frameID, uint64_t navigationID, const UserData&);
1590     void didFailLoadForFrame(uint64_t frameID, uint64_t navigationID, const WebCore::ResourceError&, const UserData&);
1591     void didSameDocumentNavigationForFrame(uint64_t frameID, uint64_t navigationID, uint32_t sameDocumentNavigationType, URL&&, const UserData&);
1592     void didChangeMainDocument(uint64_t frameID);
1593     void didExplicitOpenForFrame(uint64_t frameID, URL&&);
1594
1595     void didReceiveTitleForFrame(uint64_t frameID, const String&, const UserData&);
1596     void didFirstLayoutForFrame(uint64_t frameID, const UserData&);
1597     void didFirstVisuallyNonEmptyLayoutForFrame(uint64_t frameID, const UserData&);
1598     void didDisplayInsecureContentForFrame(uint64_t frameID, const UserData&);
1599     void didRunInsecureContentForFrame(uint64_t frameID, const UserData&);
1600     void didDetectXSSForFrame(uint64_t frameID, const UserData&);
1601     void mainFramePluginHandlesPageScaleGestureDidChange(bool);
1602     void frameDidBecomeFrameSet(uint64_t frameID, bool);
1603     void didStartProgress();
1604     void didChangeProgress(double);
1605     void didFinishProgress();
1606     void setNetworkRequestsInProgress(bool);
1607
1608     void hasInsecureContent(CompletionHandler<void(WebCore::HasInsecureContent)>&&);
1609
1610     void didDestroyNavigation(uint64_t navigationID);
1611
1612     void decidePolicyForNavigationAction(Ref<WebProcessProxy>&&, WebFrameProxy&, WebCore::SecurityOriginData&&, uint64_t navigationID, NavigationActionData&&,
1613         FrameInfoData&&, uint64_t originatingPageID, const WebCore::ResourceRequest& originalRequest, WebCore::ResourceRequest&&, IPC::FormDataReference&& requestBody,
1614         WebCore::ResourceResponse&& redirectResponse, const UserData&, Ref<PolicyDecisionSender>&&);
1615     void decidePolicyForNavigationActionAsync(uint64_t frameID, WebCore::SecurityOriginData&&, WebCore::PolicyCheckIdentifier, uint64_t navigationID, NavigationActionData&&,
1616         FrameInfoData&&, uint64_t originatingPageID, const WebCore::ResourceRequest& originalRequest, WebCore::ResourceRequest&&, IPC::FormDataReference&& requestBody,
1617         WebCore::ResourceResponse&& redirectResponse, const UserData&, uint64_t listenerID);
1618     void decidePolicyForNavigationActionSync(uint64_t frameID, bool isMainFrame, WebCore::SecurityOriginData&&, WebCore::PolicyCheckIdentifier, uint64_t navigationID, NavigationActionData&&,
1619         FrameInfoData&&, uint64_t originatingPageID, const WebCore::ResourceRequest& originalRequest, WebCore::ResourceRequest&&, IPC::FormDataReference&& requestBody,
1620         WebCore::ResourceResponse&& redirectResponse, const UserData&, Messages::WebPageProxy::DecidePolicyForNavigationActionSync::DelayedReply&&);
1621     void decidePolicyForNewWindowAction(uint64_t frameID, const WebCore::SecurityOriginData&, WebCore::PolicyCheckIdentifier, NavigationActionData&&,
1622         WebCore::ResourceRequest&&, const String& frameName, uint64_t listenerID, const UserData&);
1623     void decidePolicyForResponse(uint64_t frameID, const WebCore::SecurityOriginData&, WebCore::PolicyCheckIdentifier, uint64_t navigationID,
1624         const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, bool canShowMIMEType, const String& downloadAttribute, uint64_t listenerID, const UserData&);
1625     void unableToImplementPolicy(uint64_t frameID, const WebCore::ResourceError&, const UserData&);
1626     void beginSafeBrowsingCheck(const URL&, bool, WebFramePolicyListenerProxy&);
1627
1628     WebCompatibilityMode effectiveCompatibilityModeAfterAdjustingPolicies(API::WebsitePolicies&, const WebCore::ResourceRequest&);
1629
1630     void willSubmitForm(uint64_t frameID, uint64_t sourceFrameID, const Vector<std::pair<String, String>>& textFieldValues, uint64_t listenerID, const UserData&);
1631
1632     void contentRuleListNotification(URL&&, WebCore::ContentRuleListResults&&);
1633
1634     // History client
1635     void didNavigateWithNavigationData(const WebNavigationDataStore&, uint64_t frameID);
1636     void didPerformClientRedirect(const String& sourceURLString, const String& destinationURLString, uint64_t frameID);
1637     void didPerformServerRedirect(const String& sourceURLString, const String& destinationURLString, uint64_t frameID);
1638     void didUpdateHistoryTitle(const String& title, const String& url, uint64_t frameID);
1639
1640     // UI client
1641     void createNewPage(const FrameInfoData&, uint64_t originatingPageID, WebCore::ResourceRequest&&, WebCore::WindowFeatures&&, NavigationActionData&&, Messages::WebPageProxy::CreateNewPage::DelayedReply&&);
1642     void showPage();
1643     void runJavaScriptAlert(uint64_t frameID, const WebCore::SecurityOriginData&, const String&, Messages::WebPageProxy::RunJavaScriptAlert::DelayedReply&&);
1644     void runJavaScriptConfirm(uint64_t frameID, const WebCore::SecurityOriginData&, const String&, Messages::WebPageProxy::RunJavaScriptConfirm::DelayedReply&&);
1645     void runJavaScriptPrompt(uint64_t frameID, const WebCore::SecurityOriginData&, const String&, const String&, Messages::WebPageProxy::RunJavaScriptPrompt::DelayedReply&&);
1646     void setStatusText(const String&);
1647     void mouseDidMoveOverElement(WebHitTestResultData&&, uint32_t modifiers, UserData&&);
1648
1649 #if ENABLE(NETSCAPE_PLUGIN_API)
1650     void unavailablePluginButtonClicked(uint32_t opaquePluginUnavailabilityReason, const String& mimeType, const String& pluginURLString, const String& pluginsPageURLString, const String& frameURLString, const String& pageURLString);
1651 #endif // ENABLE(NETSCAPE_PLUGIN_API)
1652 #if ENABLE(WEBGL)
1653     void webGLPolicyForURL(URL&&, Messages::WebPageProxy::WebGLPolicyForURL::DelayedReply&&);
1654     void resolveWebGLPolicyForURL(URL&&, Messages::WebPageProxy::ResolveWebGLPolicyForURL::DelayedReply&&);
1655 #endif // ENABLE(WEBGL)
1656     void setToolbarsAreVisible(bool toolbarsAreVisible);
1657     void getToolbarsAreVisible(Messages::WebPageProxy::GetToolbarsAreVisible::DelayedReply&&);
1658     void setMenuBarIsVisible(bool menuBarIsVisible);
1659     void getMenuBarIsVisible(Messages::WebPageProxy::GetMenuBarIsVisible::DelayedReply&&);
1660     void setStatusBarIsVisible(bool statusBarIsVisible);
1661     void getStatusBarIsVisible(Messages::WebPageProxy::GetStatusBarIsVisible::DelayedReply&&);
1662     void getIsViewVisible(bool&);
1663     void setIsResizable(bool isResizable);
1664     void screenToRootView(const WebCore::IntPoint& screenPoint, Messages::WebPageProxy::ScreenToRootView::DelayedReply&&);
1665     void rootViewToScreen(const WebCore::IntRect& viewRect, Messages::WebPageProxy::RootViewToScreen::DelayedReply&&);
1666     void accessibilityScreenToRootView(const WebCore::IntPoint& screenPoint, CompletionHandler<void(WebCore::IntPoint)>&&);
1667     void rootViewToAccessibilityScreen(const WebCore::IntRect& viewRect, CompletionHandler<void(WebCore::IntRect)>&&);
1668     void runBeforeUnloadConfirmPanel(uint64_t frameID, const WebCore::SecurityOriginData&, const String& message, Messages::WebPageProxy::RunBeforeUnloadConfirmPanel::DelayedReply&&);
1669     void didChangeViewportProperties(const WebCore::ViewportAttributes&);
1670     void pageDidScroll();
1671     void runOpenPanel(uint64_t frameID, const WebCore::SecurityOriginData&, const WebCore::FileChooserSettings&);
1672     void showShareSheet(const WebCore::ShareDataWithParsedURL&, ShareSheetCallbackID);
1673     void printFrame(uint64_t frameID, CompletionHandler<void()>&&);
1674     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&&);
1675     void reachedApplicationCacheOriginQuota(const String& originIdentifier, uint64_t currentQuota, uint64_t totalBytesNeeded, Messages::WebPageProxy::ReachedApplicationCacheOriginQuota::DelayedReply&&);
1676     void requestGeolocationPermissionForFrame(uint64_t geolocationID, uint64_t frameID, String originIdentifier);
1677
1678 #if ENABLE(MEDIA_STREAM)
1679     UserMediaPermissionRequestManagerProxy& userMediaPermissionRequestManager();
1680 #endif
1681     void requestUserMediaPermissionForFrame(uint64_t userMediaID, uint64_t frameID, const WebCore::SecurityOriginData& userMediaDocumentOriginIdentifier, const WebCore::SecurityOriginData& topLevelDocumentOriginIdentifier, WebCore::MediaStreamRequest&&);
1682     void enumerateMediaDevicesForFrame(uint64_t userMediaID, uint64_t frameID, const WebCore::SecurityOriginData& userMediaDocumentOriginData, const WebCore::SecurityOriginData& topLevelDocumentOriginData);
1683     void beginMonitoringCaptureDevices();
1684
1685     void runModal();
1686     void notifyScrollerThumbIsVisibleInRect(const WebCore::IntRect&);
1687     void recommendedScrollbarStyleDidChange(int32_t newStyle);
1688     void didChangeScrollbarsForMainFrame(bool hasHorizontalScrollbar, bool hasVerticalScrollbar);
1689     void didChangeScrollOffsetPinningForMainFrame(bool pinnedToLeftSide, bool pinnedToRightSide, bool pinnedToTopSide, bool pinnedToBottomSide);
1690     void didChangePageCount(unsigned);
1691     void pageExtendedBackgroundColorDidChange(const WebCore::Color&);
1692 #if ENABLE(NETSCAPE_PLUGIN_API)
1693     void didFailToInitializePlugin(const String& mimeType, const String& frameURLString, const String& pageURLString);
1694     void didBlockInsecurePluginVersion(const String& mimeType, const String& pluginURLString, const String& frameURLString, const String& pageURLString, bool replacementObscured);
1695 #endif // ENABLE(NETSCAPE_PLUGIN_API)
1696     void setCanShortCircuitHorizontalWheelEvents(bool canShortCircuitHorizontalWheelEvents) { m_canShortCircuitHorizontalWheelEvents = canShortCircuitHorizontalWheelEvents; }
1697
1698     void launchProcess(const WebCore::RegistrableDomain&);
1699     void swapToWebProcess(Ref<WebProcessProxy>&&, std::unique_ptr<DrawingAreaProxy>&&, RefPtr<WebFrameProxy>&& mainFrame);
1700     void didFailToSuspendAfterProcessSwap();
1701     void didSuspendAfterProcessSwap();
1702
1703     enum class IsProcessSwap { No, Yes };
1704     void finishAttachingToWebProcess(IsProcessSwap);
1705
1706     RefPtr<API::Navigation> launchProcessForReload();
1707     RefPtr<API::Navigation> launchProcessWithItem(WebBackForwardListItem&);
1708
1709     void requestNotificationPermission(uint64_t notificationID, const String& originString);
1710     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);
1711     void cancelNotification(uint64_t notificationID);
1712     void clearNotifications(const Vector<uint64_t>& notificationIDs);
1713     void didDestroyNotification(uint64_t notificationID);
1714
1715     void didChangeContentSize(const WebCore::IntSize&);
1716     void didChangeIntrinsicContentSize(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, OptionSet<WebCore::ActivityState::Flag> activityStateChanges, 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