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