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