Re-landing:
[WebKit-https.git] / Source / WebKit2 / UIProcess / WebPageProxy.h
1 /*
2  * Copyright (C) 2010-2016 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 "AssistedNodeInformation.h"
30 #include "AutoCorrectionCallback.h"
31 #include "Connection.h"
32 #include "ContextMenuContextData.h"
33 #include "DownloadID.h"
34 #include "DragControllerAction.h"
35 #include "DrawingAreaProxy.h"
36 #include "EditingRange.h"
37 #include "EditorState.h"
38 #include "GeolocationPermissionRequestManagerProxy.h"
39 #include "LayerTreeContext.h"
40 #include "MessageSender.h"
41 #include "NotificationPermissionRequestManagerProxy.h"
42 #include "PageLoadState.h"
43 #include "ProcessThrottler.h"
44 #include "SandboxExtension.h"
45 #include "ShareableBitmap.h"
46 #include "UserMediaPermissionRequestManagerProxy.h"
47 #include "VisibleContentRectUpdateInfo.h"
48 #include "WKBase.h"
49 #include "WKPagePrivate.h"
50 #include "WebColorPicker.h"
51 #include "WebContextMenuItemData.h"
52 #include "WebCoreArgumentCoders.h"
53 #include "WebFrameProxy.h"
54 #include "WebPageCreationParameters.h"
55 #include "WebPageDiagnosticLoggingClient.h"
56 #include "WebPageInjectedBundleClient.h"
57 #include "WebPaymentCoordinatorProxy.h"
58 #include "WebPreferences.h"
59 #include <WebCore/AlternativeTextClient.h> // FIXME: Needed by WebPageProxyMessages.h for DICTATION_ALTERNATIVES.
60 #include "WebPageProxyMessages.h"
61 #include "WebPopupMenuProxy.h"
62 #include "WebProcessLifetimeTracker.h"
63 #include "WebsitePolicies.h"
64 #include <WebCore/ActivityState.h>
65 #include <WebCore/Color.h>
66 #include <WebCore/DragActions.h>
67 #include <WebCore/EventTrackingRegions.h>
68 #include <WebCore/FrameLoaderTypes.h>
69 #include <WebCore/HitTestResult.h>
70 #include <WebCore/MediaProducer.h>
71 #include <WebCore/Page.h>
72 #include <WebCore/PlatformScreen.h>
73 #include <WebCore/ScrollTypes.h>
74 #include <WebCore/SearchPopupMenu.h>
75 #include <WebCore/TextChecking.h>
76 #include <WebCore/TextGranularity.h>
77 #include <WebCore/UserInterfaceLayoutDirection.h>
78 #include <WebCore/VisibleSelection.h>
79 #include <memory>
80 #include <wtf/HashMap.h>
81 #include <wtf/HashSet.h>
82 #include <wtf/PassRefPtr.h>
83 #include <wtf/Ref.h>
84 #include <wtf/RefPtr.h>
85 #include <wtf/Vector.h>
86 #include <wtf/text/WTFString.h>
87
88 OBJC_CLASS NSView;
89 OBJC_CLASS _WKRemoteObjectRegistry;
90
91 #if ENABLE(DRAG_SUPPORT)
92 #include <WebCore/DragActions.h>
93 #endif
94
95 #if ENABLE(TOUCH_EVENTS)
96 #include "NativeWebTouchEvent.h"
97 #endif
98
99 #if PLATFORM(COCOA)
100 #include "LayerRepresentation.h"
101 #endif
102
103 #if PLATFORM(MAC)
104 #include "AttributedString.h"
105 #endif
106
107 #if PLATFORM(IOS)
108 #include "ProcessThrottler.h"
109 #endif
110
111 #if PLATFORM(GTK)
112 #include "ArgumentCodersGtk.h"
113 #endif
114
115 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
116 #include <WebCore/MediaPlaybackTargetPicker.h>
117 #include <WebCore/WebMediaSessionManagerClient.h>
118 #endif
119
120 #if ENABLE(MEDIA_SESSION)
121 namespace WebCore {
122 class MediaSessionMetadata;
123 }
124 #endif
125
126 namespace API {
127 class ContextMenuClient;
128 class FindClient;
129 class FindMatchesClient;
130 class FormClient;
131 class FullscreenClient;
132 class HistoryClient;
133 class IconLoadingClient;
134 class LoaderClient;
135 class Navigation;
136 class NavigationClient;
137 class PolicyClient;
138 class UIClient;
139 class URLRequest;
140 }
141
142 namespace IPC {
143 class Decoder;
144 class Connection;
145 }
146
147 namespace WebCore {
148 class AuthenticationChallenge;
149 class Cursor;
150 class DragData;
151 class FloatRect;
152 class GraphicsLayer;
153 class IntSize;
154 class ProtectionSpace;
155 class RunLoopObserver;
156 class SharedBuffer;
157 class TextIndicator;
158 class ValidationBubble;
159 enum class HasInsecureContent;
160 struct DictionaryPopupInfo;
161 struct ExceptionDetails;
162 struct FileChooserSettings;
163 struct MediaConstraintsData;
164 struct SecurityOriginData;
165 struct TextAlternativeWithRange;
166 struct TextCheckingResult;
167 struct ViewportAttributes;
168 struct WindowFeatures;
169 }
170
171 #if PLATFORM(GTK)
172 typedef GtkWidget* PlatformWidget;
173 #endif
174
175 namespace WebKit {
176
177 enum HiddenPageThrottlingAutoIncreasesCounterType { };
178 typedef RefCounter<HiddenPageThrottlingAutoIncreasesCounterType> HiddenPageThrottlingAutoIncreasesCounter;
179
180 class CertificateInfo;
181 class NativeWebGestureEvent;
182 class NativeWebKeyboardEvent;
183 class NativeWebMouseEvent;
184 class NativeWebWheelEvent;
185 class PageClient;
186 class RemoteLayerTreeScrollingPerformanceData;
187 class RemoteLayerTreeTransaction;
188 class RemoteScrollingCoordinatorProxy;
189 class StringPairVector;
190 class UserData;
191 class ViewSnapshot;
192 class VisitedLinkStore;
193 class WebBackForwardList;
194 class WebBackForwardListItem;
195 class WebContextMenuProxy;
196 class WebEditCommandProxy;
197 class WebFullScreenManagerProxy;
198 class WebPlaybackSessionManagerProxy;
199 class WebNavigationState;
200 class WebVideoFullscreenManagerProxy;
201 class WebKeyboardEvent;
202 class WebMouseEvent;
203 class WebOpenPanelResultListenerProxy;
204 class WebPageGroup;
205 class WebProcessProxy;
206 class WebUserContentControllerProxy;
207 class WebWheelEvent;
208 class WebsiteDataStore;
209 struct AttributedString;
210 struct ColorSpaceData;
211 struct EditingRange;
212 struct EditorState;
213 class GamepadData;
214 struct InteractionInformationRequest;
215 struct LoadParameters;
216 struct PlatformPopupMenuData;
217 struct PrintInfo;
218 struct WebPopupItem;
219
220 #if ENABLE(VIBRATION)
221 class WebVibrationProxy;
222 #endif
223
224 #if USE(QUICK_LOOK)
225 class QuickLookDocumentData;
226 #endif
227
228 typedef GenericCallback<uint64_t> UnsignedCallback;
229 typedef GenericCallback<EditingRange> EditingRangeCallback;
230 typedef GenericCallback<const String&> StringCallback;
231 typedef GenericCallback<API::SerializedScriptValue*, bool, const WebCore::ExceptionDetails&> ScriptValueCallback;
232
233 #if PLATFORM(GTK)
234 typedef GenericCallback<API::Error*> PrintFinishedCallback;
235 #endif
236
237 #if ENABLE(TOUCH_EVENTS)
238 struct QueuedTouchEvents {
239     QueuedTouchEvents(const NativeWebTouchEvent& event)
240         : forwardedEvent(event)
241     {
242     }
243     NativeWebTouchEvent forwardedEvent;
244     Vector<NativeWebTouchEvent> deferredTouchEvents;
245 };
246 #endif
247
248 typedef GenericCallback<const String&, bool, int32_t> ValidateCommandCallback;
249 typedef GenericCallback<const WebCore::IntRect&, const EditingRange&> RectForCharacterRangeCallback;
250
251 #if PLATFORM(MAC)
252 typedef GenericCallback<const AttributedString&, const EditingRange&> AttributedStringForCharacterRangeCallback;
253 typedef GenericCallback<const String&, double, bool> FontAtSelectionCallback;
254 #endif
255
256 #if PLATFORM(IOS)
257 typedef GenericCallback<const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t> GestureCallback;
258 typedef GenericCallback<const WebCore::IntPoint&, uint32_t, uint32_t> TouchesCallback;
259 struct NodeAssistanceArguments {
260     AssistedNodeInformation m_nodeInformation;
261     bool m_userIsInteracting;
262     bool m_blurPreviousNode;
263     RefPtr<API::Object> m_userData;
264 };
265
266 using DrawToPDFCallback = GenericCallback<const IPC::DataReference&>;
267 #endif
268
269 #if PLATFORM(COCOA)
270 typedef GenericCallback<const WebCore::MachSendRight&> MachSendRightCallback;
271 #endif
272
273 class WebPageProxy : public API::ObjectImpl<API::Object::Type::Page>
274 #if ENABLE(INPUT_TYPE_COLOR)
275     , public WebColorPicker::Client
276 #endif
277 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
278     , public WebCore::WebMediaSessionManagerClient
279 #endif
280     , public WebPopupMenuProxy::Client
281     , public IPC::MessageReceiver
282     , public IPC::MessageSender {
283 public:
284     static Ref<WebPageProxy> create(PageClient&, WebProcessProxy&, uint64_t pageID, Ref<API::PageConfiguration>&&);
285     virtual ~WebPageProxy();
286
287     const API::PageConfiguration& configuration() const;
288
289     uint64_t pageID() const { return m_pageID; }
290     WebCore::SessionID sessionID() const { return m_sessionID; }
291
292     WebFrameProxy* mainFrame() const { return m_mainFrame.get(); }
293     WebFrameProxy* focusedFrame() const { return m_focusedFrame.get(); }
294     WebFrameProxy* frameSetLargestFrame() const { return m_frameSetLargestFrame.get(); }
295
296     DrawingAreaProxy* drawingArea() const { return m_drawingArea.get(); }
297
298     WebNavigationState& navigationState() { return *m_navigationState.get(); }
299
300     WebsiteDataStore& websiteDataStore() { return m_websiteDataStore; }
301
302 #if ENABLE(DATA_DETECTION)
303     NSArray *dataDetectionResults() { return m_dataDetectionResults.get(); }
304 #endif
305         
306 #if ENABLE(ASYNC_SCROLLING)
307     RemoteScrollingCoordinatorProxy* scrollingCoordinatorProxy() const { return m_scrollingCoordinatorProxy.get(); }
308 #endif
309
310     WebBackForwardList& backForwardList() { return m_backForwardList; }
311
312     bool addsVisitedLinks() const { return m_addsVisitedLinks; }
313     void setAddsVisitedLinks(bool addsVisitedLinks) { m_addsVisitedLinks = addsVisitedLinks; }
314
315     void fullscreenMayReturnToInline();
316     void didEnterFullscreen();
317     void didExitFullscreen();
318
319     WebInspectorProxy* inspector() const;
320
321     bool isControlledByAutomation() const { return m_controlledByAutomation; }
322     void setControlledByAutomation(bool);
323
324 #if ENABLE(REMOTE_INSPECTOR)
325     bool allowsRemoteInspection() const { return m_allowsRemoteInspection; }
326     void setAllowsRemoteInspection(bool);
327     String remoteInspectionNameOverride() const { return m_remoteInspectionNameOverride; }
328     void setRemoteInspectionNameOverride(const String&);
329 #endif
330
331 #if ENABLE(VIBRATION)
332     WebVibrationProxy* vibration() { return m_vibration.get(); }
333 #endif
334
335 #if ENABLE(FULLSCREEN_API)
336     WebFullScreenManagerProxy* fullScreenManager();
337
338     API::FullscreenClient& fullscreenClient() const { return *m_fullscreenClient; }
339     void setFullscreenClient(std::unique_ptr<API::FullscreenClient>);
340 #endif
341 #if (PLATFORM(IOS) && HAVE(AVKIT)) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
342     WebPlaybackSessionManagerProxy* playbackSessionManager();
343     WebVideoFullscreenManagerProxy* videoFullscreenManager();
344 #endif
345
346 #if PLATFORM(IOS)
347     bool allowsMediaDocumentInlinePlayback() const;
348     void setAllowsMediaDocumentInlinePlayback(bool);
349 #endif
350
351 #if ENABLE(CONTEXT_MENUS)
352     API::ContextMenuClient& contextMenuClient() { return *m_contextMenuClient; }
353     void setContextMenuClient(std::unique_ptr<API::ContextMenuClient>);
354 #endif
355     API::FindClient& findClient() { return *m_findClient; }
356     void setFindClient(std::unique_ptr<API::FindClient>);
357     API::FindMatchesClient& findMatchesClient() { return *m_findMatchesClient; }
358     void setFindMatchesClient(std::unique_ptr<API::FindMatchesClient>);
359     API::DiagnosticLoggingClient& diagnosticLoggingClient() { return *m_diagnosticLoggingClient; }
360     void setDiagnosticLoggingClient(std::unique_ptr<API::DiagnosticLoggingClient>);
361     void setFormClient(std::unique_ptr<API::FormClient>);
362     void setNavigationClient(std::unique_ptr<API::NavigationClient>);
363     void setHistoryClient(std::unique_ptr<API::HistoryClient>);
364     void setLoaderClient(std::unique_ptr<API::LoaderClient>);
365     void setPolicyClient(std::unique_ptr<API::PolicyClient>);
366     void setInjectedBundleClient(const WKPageInjectedBundleClientBase*);
367     WebPageInjectedBundleClient* injectedBundleClient() { return m_injectedBundleClient.get(); }
368
369     API::UIClient& uiClient() { return *m_uiClient; }
370     void setUIClient(std::unique_ptr<API::UIClient>);
371
372     API::IconLoadingClient& iconLoadingClient() { return *m_iconLoadingClient; }
373     void setIconLoadingClient(std::unique_ptr<API::IconLoadingClient>);
374
375     void initializeWebPage();
376
377     void close();
378     bool tryClose();
379     bool isClosed() const { return m_isClosed; }
380
381     void closePage(bool stopResponsivenessTimer);
382
383     void addPlatformLoadParameters(LoadParameters&);
384     RefPtr<API::Navigation> loadRequest(const WebCore::ResourceRequest&, WebCore::ShouldOpenExternalURLsPolicy = WebCore::ShouldOpenExternalURLsPolicy::ShouldAllowExternalSchemes, API::Object* userData = nullptr);
385     RefPtr<API::Navigation> loadFile(const String& fileURL, const String& resourceDirectoryURL, API::Object* userData = nullptr);
386     RefPtr<API::Navigation> loadData(API::Data*, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData = nullptr);
387     RefPtr<API::Navigation> loadHTMLString(const String& htmlString, const String& baseURL, API::Object* userData = nullptr);
388     void loadAlternateHTMLString(const String& htmlString, const String& baseURL, const String& unreachableURL, API::Object* userData = nullptr);
389     void loadPlainTextString(const String&, API::Object* userData = nullptr);
390     void loadWebArchiveData(API::Data*, API::Object* userData = nullptr);
391     void navigateToPDFLinkWithSimulatedClick(const String& url, WebCore::IntPoint documentPoint, WebCore::IntPoint screenPoint);
392
393     void stopLoading();
394     RefPtr<API::Navigation> reload(bool reloadFromOrigin, bool contentBlockersEnabled);
395
396     RefPtr<API::Navigation> goForward();
397     RefPtr<API::Navigation> goBack();
398
399     RefPtr<API::Navigation> goToBackForwardItem(WebBackForwardListItem*);
400     void tryRestoreScrollPosition();
401     void didChangeBackForwardList(WebBackForwardListItem* addedItem, Vector<RefPtr<WebBackForwardListItem>> removed);
402     void willGoToBackForwardListItem(uint64_t itemID, const UserData&);
403
404     bool shouldKeepCurrentBackForwardListItemInList(WebBackForwardListItem*);
405
406     bool willHandleHorizontalScrollEvents() const;
407
408     bool canShowMIMEType(const String& mimeType);
409
410     bool drawsBackground() const { return m_drawsBackground; }
411     void setDrawsBackground(bool);
412
413     float topContentInset() const { return m_topContentInset; }
414     void setTopContentInset(float);
415
416     WebCore::Color underlayColor() const { return m_underlayColor; }
417     void setUnderlayColor(const WebCore::Color&);
418
419     // At this time, m_pageExtendedBackgroundColor can be set via pageExtendedBackgroundColorDidChange() which is a message
420     // from the UIProcess, or by didCommitLayerTree(). When PLATFORM(MAC) adopts UI side compositing, we should get rid of
421     // the message entirely.
422     WebCore::Color pageExtendedBackgroundColor() const { return m_pageExtendedBackgroundColor; }
423
424     void viewWillStartLiveResize();
425     void viewWillEndLiveResize();
426
427     void setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent&, std::function<void (CallbackBase::Error)>);
428     
429     void clearSelection();
430     void restoreSelectionInFocusedEditableElement();
431
432     void setViewNeedsDisplay(const WebCore::Region&);
433     void requestScroll(const WebCore::FloatPoint& scrollPosition, const WebCore::IntPoint& scrollOrigin, bool isProgrammaticScroll);
434     
435     void setDelegatesScrolling(bool delegatesScrolling) { m_delegatesScrolling = delegatesScrolling; }
436     bool delegatesScrolling() const { return m_delegatesScrolling; }
437
438     enum class ActivityStateChangeDispatchMode { Deferrable, Immediate };
439     void activityStateDidChange(WebCore::ActivityState::Flags mayHaveChanged, bool wantsSynchronousReply = false, ActivityStateChangeDispatchMode = ActivityStateChangeDispatchMode::Deferrable);
440     bool isInWindow() const { return m_activityState & WebCore::ActivityState::IsInWindow; }
441     void waitForDidUpdateActivityState();
442     void didUpdateActivityState() { m_waitingForDidUpdateActivityState = false; }
443
444     void layerHostingModeDidChange();
445
446     WebCore::IntSize viewSize() const;
447     bool isViewVisible() const { return m_activityState & WebCore::ActivityState::IsVisible; }
448     bool isViewWindowActive() const;
449
450     void addMIMETypeWithCustomContentProvider(const String& mimeType);
451
452     void executeEditCommand(const String& commandName, const String& argument = String());
453     void validateCommand(const String& commandName, std::function<void (const String&, bool, int32_t, CallbackBase::Error)>);
454
455     const EditorState& editorState() const { return m_editorState; }
456     bool canDelete() const { return hasSelectedRange() && isContentEditable(); }
457     bool hasSelectedRange() const { return m_editorState.selectionIsRange; }
458     bool isContentEditable() const { return m_editorState.isContentEditable; }
459     
460     bool maintainsInactiveSelection() const { return m_maintainsInactiveSelection; }
461     void setMaintainsInactiveSelection(bool);
462     void setEditable(bool);
463     bool isEditable() const { return m_isEditable; }
464
465 #if PLATFORM(IOS)
466     void executeEditCommand(const String& commandName, std::function<void (CallbackBase::Error)>);
467     double displayedContentScale() const { return m_lastVisibleContentRectUpdate.scale(); }
468     const WebCore::FloatRect& exposedContentRect() const { return m_lastVisibleContentRectUpdate.exposedContentRect(); }
469     const WebCore::FloatRect& unobscuredContentRect() const { return m_lastVisibleContentRectUpdate.unobscuredContentRect(); }
470     // When visual viewports are enabled, this is the layout viewport rect.
471     const WebCore::FloatRect& customFixedPositionRect() const { return m_lastVisibleContentRectUpdate.customFixedPositionRect(); }
472
473     void updateVisibleContentRects(const VisibleContentRectUpdateInfo&);
474     void resendLastVisibleContentRects();
475
476     enum class UnobscuredRectConstraint { ConstrainedToDocumentRect, Unconstrained };
477     WebCore::FloatRect computeCustomFixedPositionRect(const WebCore::FloatRect& unobscuredContentRect, const WebCore::FloatRect& currentCustomFixedPositionRect, double displayedContentScale, UnobscuredRectConstraint = UnobscuredRectConstraint::Unconstrained, bool visualViewportEnabled = false) const;
478
479     void overflowScrollViewWillStartPanGesture();
480     void overflowScrollViewDidScroll();
481     void overflowScrollWillStartScroll();
482     void overflowScrollDidEndScroll();
483
484     void dynamicViewportSizeUpdate(const WebCore::FloatSize& minimumLayoutSize, const WebCore::FloatSize& maximumUnobscuredSize, const WebCore::FloatRect& targetExposedContentRect, const WebCore::FloatRect& targetUnobscuredRect, const WebCore::FloatRect& targetUnobscuredRectInScrollViewCoordinates, double targetScale, int32_t deviceOrientation);
485     void synchronizeDynamicViewportUpdate();
486
487     void setViewportConfigurationMinimumLayoutSize(const WebCore::FloatSize&);
488     void setMaximumUnobscuredSize(const WebCore::FloatSize&);
489     void setDeviceOrientation(int32_t);
490     int32_t deviceOrientation() const { return m_deviceOrientation; }
491     void willCommitLayerTree(uint64_t transactionID);
492
493     void selectWithGesture(const WebCore::IntPoint, WebCore::TextGranularity, uint32_t gestureType, uint32_t gestureState, bool isInteractingWithAssistedNode, std::function<void (const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t, CallbackBase::Error)>);
494     void updateSelectionWithTouches(const WebCore::IntPoint, uint32_t touches, bool baseIsStart, std::function<void (const WebCore::IntPoint&, uint32_t, uint32_t, CallbackBase::Error)>);
495     void selectWithTwoTouches(const WebCore::IntPoint from, const WebCore::IntPoint to, uint32_t gestureType, uint32_t gestureState, std::function<void (const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t, CallbackBase::Error)>);
496     void updateBlockSelectionWithTouch(const WebCore::IntPoint, uint32_t touch, uint32_t handlePosition);
497     void extendSelection(WebCore::TextGranularity);
498     void selectWordBackward();
499     void moveSelectionByOffset(int32_t offset, std::function<void (CallbackBase::Error)>);
500     void selectTextWithGranularityAtPoint(const WebCore::IntPoint, WebCore::TextGranularity, bool isInteractingWithAssistedNode, std::function<void (CallbackBase::Error)>);
501     void selectPositionAtPoint(const WebCore::IntPoint, bool isInteractingWithAssistedNode, std::function<void (CallbackBase::Error)>);
502     void selectPositionAtBoundaryWithDirection(const WebCore::IntPoint, WebCore::TextGranularity, WebCore::SelectionDirection, bool isInteractingWithAssistedNode, std::function<void (CallbackBase::Error)>);
503     void moveSelectionAtBoundaryWithDirection(WebCore::TextGranularity, WebCore::SelectionDirection, std::function<void(CallbackBase::Error)>);
504     void beginSelectionInDirection(WebCore::SelectionDirection, std::function<void (uint64_t, CallbackBase::Error)>);
505     void updateSelectionWithExtentPoint(const WebCore::IntPoint, bool isInteractingWithAssistedNode, std::function<void (uint64_t, CallbackBase::Error)>);
506     void updateSelectionWithExtentPointAndBoundary(const WebCore::IntPoint, WebCore::TextGranularity, bool isInteractingWithAssistedNode, std::function<void(uint64_t, CallbackBase::Error)>);
507     void requestAutocorrectionData(const String& textForAutocorrection, std::function<void (const Vector<WebCore::FloatRect>&, const String&, double, uint64_t, CallbackBase::Error)>);
508     void applyAutocorrection(const String& correction, const String& originalText, std::function<void (const String&, CallbackBase::Error)>);
509     bool applyAutocorrection(const String& correction, const String& originalText);
510     void requestAutocorrectionContext(std::function<void (const String&, const String&, const String&, const String&, uint64_t, uint64_t, CallbackBase::Error)>);
511     void getAutocorrectionContext(String& contextBefore, String& markedText, String& selectedText, String& contextAfter, uint64_t& location, uint64_t& length);
512     void requestDictationContext(std::function<void (const String&, const String&, const String&, CallbackBase::Error)>);
513     void replaceDictatedText(const String& oldText, const String& newText);
514     void replaceSelectedText(const String& oldText, const String& newText);
515     void didReceivePositionInformation(const InteractionInformationAtPosition&);
516     void getPositionInformation(const InteractionInformationRequest&, InteractionInformationAtPosition&);
517     void requestPositionInformation(const InteractionInformationRequest&);
518     void startInteractionWithElementAtPosition(const WebCore::IntPoint&);
519     void stopInteraction();
520     void performActionOnElement(uint32_t action);
521     void saveImageToLibrary(const SharedMemory::Handle& imageHandle, uint64_t imageSize);
522     void didUpdateBlockSelectionWithTouch(uint32_t touch, uint32_t flags, float growThreshold, float shrinkThreshold);
523     void focusNextAssistedNode(bool isForward, std::function<void (CallbackBase::Error)>);
524     void setAssistedNodeValue(const String&);
525     void setAssistedNodeValueAsNumber(double);
526     void setAssistedNodeSelectedIndex(uint32_t index, bool allowMultipleSelection = false);
527     void applicationDidEnterBackground();
528     void applicationDidFinishSnapshottingAfterEnteringBackground();
529     void applicationWillEnterForeground();
530     void applicationWillResignActive();
531     void applicationDidBecomeActive();
532     void zoomToRect(WebCore::FloatRect, double minimumScale, double maximumScale);
533     void commitPotentialTapFailed();
534     void didNotHandleTapAsClick(const WebCore::IntPoint&);
535     void disableDoubleTapGesturesDuringTapIfNecessary(uint64_t requestID);
536     void contentSizeCategoryDidChange(const String& contentSizeCategory);
537     void getSelectionContext(std::function<void(const String&, const String&, const String&, CallbackBase::Error)>);
538     void handleTwoFingerTapAtPoint(const WebCore::IntPoint&, uint64_t requestID);
539     void setForceAlwaysUserScalable(bool);
540     void setIsScrollingOrZooming(bool);
541 #endif
542 #if ENABLE(DATA_DETECTION)
543     void setDataDetectionResult(const DataDetectionResult&);
544 #endif
545     void didCommitLayerTree(const WebKit::RemoteLayerTreeTransaction&);
546     void layerTreeCommitComplete();
547
548     bool updateLayoutViewportParameters(const WebKit::RemoteLayerTreeTransaction&);
549
550 #if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
551     void didRenderFrame(const WebCore::IntSize& contentsSize, const WebCore::IntRect& coveredRect);
552     void commitPageTransitionViewport();
553 #endif
554 #if PLATFORM(EFL)
555     void setThemePath(const String&);
556 #endif
557
558 #if PLATFORM(GTK)
559     void setComposition(const String& text, Vector<WebCore::CompositionUnderline> underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeEnd);
560     void confirmComposition(const String& compositionString, int64_t selectionStart, int64_t selectionLength);
561     void cancelComposition();
562 #endif
563
564 #if PLATFORM(GTK)
565     void setInputMethodState(bool enabled);
566 #endif
567
568 #if PLATFORM (GTK) && HAVE(GTK_GESTURES)
569     void getCenterForZoomGesture(const WebCore::IntPoint& centerInViewCoordinates, WebCore::IntPoint& center);
570 #endif
571
572 #if PLATFORM(COCOA)
573     void windowAndViewFramesChanged(const WebCore::FloatRect& viewFrameInWindowCoordinates, const WebCore::FloatPoint& accessibilityViewCoordinates);
574     void setMainFrameIsScrollable(bool);
575
576     void sendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdentifier, const String& textInput);
577     bool shouldDelayWindowOrderingForEvent(const WebMouseEvent&);
578     bool acceptsFirstMouse(int eventNumber, const WebMouseEvent&);
579
580     void setAcceleratedCompositingRootLayer(LayerOrView*);
581     LayerOrView* acceleratedCompositingRootLayer() const;
582
583     void insertTextAsync(const String& text, const EditingRange& replacementRange, bool registerUndoGroup = false, EditingRangeIsRelativeTo = EditingRangeIsRelativeTo::EditableRoot, bool suppressSelectionUpdate = false);
584     void getMarkedRangeAsync(std::function<void (EditingRange, CallbackBase::Error)>);
585     void getSelectedRangeAsync(std::function<void (EditingRange, CallbackBase::Error)>);
586     void characterIndexForPointAsync(const WebCore::IntPoint&, std::function<void (uint64_t, CallbackBase::Error)>);
587     void firstRectForCharacterRangeAsync(const EditingRange&, std::function<void (const WebCore::IntRect&, const EditingRange&, CallbackBase::Error)>);
588     void setCompositionAsync(const String& text, Vector<WebCore::CompositionUnderline> underlines, const EditingRange& selectionRange, const EditingRange& replacementRange);
589     void confirmCompositionAsync();
590
591     void setScrollPerformanceDataCollectionEnabled(bool);
592     bool scrollPerformanceDataCollectionEnabled() const { return m_scrollPerformanceDataCollectionEnabled; }
593     RemoteLayerTreeScrollingPerformanceData* scrollingPerformanceData() { return m_scrollingPerformanceData.get(); }
594 #endif // PLATFORM(COCOA)
595
596 #if PLATFORM(MAC)
597     void insertDictatedTextAsync(const String& text, const EditingRange& replacementRange, const Vector<WebCore::TextAlternativeWithRange>& dictationAlternatives, bool registerUndoGroup);
598     void attributedSubstringForCharacterRangeAsync(const EditingRange&, std::function<void (const AttributedString&, const EditingRange&, CallbackBase::Error)>);
599     void setFont(const String& fontFamily, double fontSize, uint64_t fontTraits);
600     void fontAtSelection(std::function<void (const String&, double, bool, CallbackBase::Error)>);
601
602     void startWindowDrag();
603     NSWindow *platformWindow();
604     void rootViewToWindow(const WebCore::IntRect& viewRect, WebCore::IntRect& windowRect);
605
606 #if WK_API_ENABLED
607     NSView *inspectorAttachmentView();
608     _WKRemoteObjectRegistry *remoteObjectRegistry();
609 #endif
610
611     void intrinsicContentSizeDidChange(const WebCore::IntSize& intrinsicContentSize);
612     CGRect boundsOfLayerInLayerBackedWindowCoordinates(CALayer *) const;
613 #endif // PLATFORM(MAC)
614
615 #if PLATFORM(EFL)
616     void handleInputMethodKeydown(bool& handled);
617     void confirmComposition(const String&);
618     void setComposition(const String&, Vector<WebCore::CompositionUnderline>&, int);
619     void cancelComposition();
620 #endif
621
622 #if PLATFORM(GTK)
623     PlatformWidget viewWidget();
624     const WebCore::Color& backgroundColor() const { return m_backgroundColor; }
625     void setBackgroundColor(const WebCore::Color& color) { m_backgroundColor = color; }
626 #endif
627
628     void handleMouseEvent(const NativeWebMouseEvent&);
629     void handleWheelEvent(const NativeWebWheelEvent&);
630     void handleKeyboardEvent(const NativeWebKeyboardEvent&);
631
632 #if ENABLE(MAC_GESTURE_EVENTS)
633     void handleGestureEvent(const NativeWebGestureEvent&);
634 #endif
635
636 #if ENABLE(IOS_TOUCH_EVENTS)
637     void handleTouchEventSynchronously(NativeWebTouchEvent&);
638     void handleTouchEventAsynchronously(const NativeWebTouchEvent&);
639
640 #elif ENABLE(TOUCH_EVENTS)
641     void handleTouchEvent(const NativeWebTouchEvent&);
642 #endif
643
644     void scrollBy(WebCore::ScrollDirection, WebCore::ScrollGranularity);
645     void centerSelectionInVisibleArea();
646
647     const String& toolTip() const { return m_toolTip; }
648
649     const String& userAgent() const { return m_userAgent; }
650     void setApplicationNameForUserAgent(const String&);
651     const String& applicationNameForUserAgent() const { return m_applicationNameForUserAgent; }
652     void setCustomUserAgent(const String&);
653     const String& customUserAgent() const { return m_customUserAgent; }
654     static String standardUserAgent(const String& applicationName = String());
655
656     bool supportsTextEncoding() const;
657     void setCustomTextEncodingName(const String&);
658     String customTextEncodingName() const { return m_customTextEncodingName; }
659
660     bool areActiveDOMObjectsAndAnimationsSuspended() const { return m_isPageSuspended; }
661     void resumeActiveDOMObjectsAndAnimations();
662     void suspendActiveDOMObjectsAndAnimations();
663
664     double estimatedProgress() const;
665
666     void terminateProcess();
667
668     SessionState sessionState(const std::function<bool (WebBackForwardListItem&)>& = nullptr) const;
669     RefPtr<API::Navigation> restoreFromSessionState(SessionState, bool navigate);
670
671     bool supportsTextZoom() const;
672     double textZoomFactor() const { return m_textZoomFactor; }
673     void setTextZoomFactor(double);
674     double pageZoomFactor() const;
675     void setPageZoomFactor(double);
676     void setPageAndTextZoomFactors(double pageZoomFactor, double textZoomFactor);
677
678     void scalePage(double scale, const WebCore::IntPoint& origin);
679     void scalePageInViewCoordinates(double scale, const WebCore::IntPoint& centerInViewCoordinates);
680     double pageScaleFactor() const;
681     double viewScaleFactor() const { return m_viewScaleFactor; }
682     void scaleView(double scale);
683     void setShouldScaleViewToFitDocument(bool);
684     
685     float deviceScaleFactor() const;
686     void setIntrinsicDeviceScaleFactor(float);
687     void setCustomDeviceScaleFactor(float);
688     void windowScreenDidChange(WebCore::PlatformDisplayID);
689     void accessibilitySettingsDidChange();
690
691     void setUseFixedLayout(bool);
692     void setFixedLayoutSize(const WebCore::IntSize&);
693     bool useFixedLayout() const { return m_useFixedLayout; };
694     const WebCore::IntSize& fixedLayoutSize() const { return m_fixedLayoutSize; };
695
696     void listenForLayoutMilestones(WebCore::LayoutMilestones);
697
698     bool hasHorizontalScrollbar() const { return m_mainFrameHasHorizontalScrollbar; }
699     bool hasVerticalScrollbar() const { return m_mainFrameHasVerticalScrollbar; }
700
701     void setSuppressScrollbarAnimations(bool);
702     bool areScrollbarAnimationsSuppressed() const { return m_suppressScrollbarAnimations; }
703
704     bool isPinnedToLeftSide() const { return m_mainFrameIsPinnedToLeftSide; }
705     bool isPinnedToRightSide() const { return m_mainFrameIsPinnedToRightSide; }
706     bool isPinnedToTopSide() const { return m_mainFrameIsPinnedToTopSide; }
707     bool isPinnedToBottomSide() const { return m_mainFrameIsPinnedToBottomSide; }
708
709     bool rubberBandsAtLeft() const;
710     void setRubberBandsAtLeft(bool);
711     bool rubberBandsAtRight() const;
712     void setRubberBandsAtRight(bool);
713     bool rubberBandsAtTop() const;
714     void setRubberBandsAtTop(bool);
715     bool rubberBandsAtBottom() const;
716     void setRubberBandsAtBottom(bool);
717
718     void setShouldUseImplicitRubberBandControl(bool shouldUseImplicitRubberBandControl) { m_shouldUseImplicitRubberBandControl = shouldUseImplicitRubberBandControl; }
719     bool shouldUseImplicitRubberBandControl() const { return m_shouldUseImplicitRubberBandControl; }
720         
721     void setEnableVerticalRubberBanding(bool);
722     bool verticalRubberBandingIsEnabled() const;
723     void setEnableHorizontalRubberBanding(bool);
724     bool horizontalRubberBandingIsEnabled() const;
725         
726     void setBackgroundExtendsBeyondPage(bool);
727     bool backgroundExtendsBeyondPage() const;
728
729     void setPaginationMode(WebCore::Pagination::Mode);
730     WebCore::Pagination::Mode paginationMode() const { return m_paginationMode; }
731     void setPaginationBehavesLikeColumns(bool);
732     bool paginationBehavesLikeColumns() const { return m_paginationBehavesLikeColumns; }
733     void setPageLength(double);
734     double pageLength() const { return m_pageLength; }
735     void setGapBetweenPages(double);
736     double gapBetweenPages() const { return m_gapBetweenPages; }
737     void setPaginationLineGridEnabled(bool);
738     bool paginationLineGridEnabled() const { return m_paginationLineGridEnabled; }
739     unsigned pageCount() const { return m_pageCount; }
740
741 #if PLATFORM(COCOA)
742     // Called by the web process through a message.
743     void registerWebProcessAccessibilityToken(const IPC::DataReference&);
744     // Called by the UI process when it is ready to send its tokens to the web process.
745     void registerUIProcessAccessibilityTokens(const IPC::DataReference& elemenToken, const IPC::DataReference& windowToken);
746     bool readSelectionFromPasteboard(const String& pasteboardName);
747     String stringSelectionForPasteboard();
748     RefPtr<WebCore::SharedBuffer> dataSelectionForPasteboard(const String& pasteboardType);
749     void makeFirstResponder();
750
751     ColorSpaceData colorSpace();
752 #endif
753
754 #if ENABLE(SERVICE_CONTROLS)
755     void replaceSelectionWithPasteboardData(const Vector<String>& types, const IPC::DataReference&);
756 #endif
757
758     void pageScaleFactorDidChange(double);
759     void pluginScaleFactorDidChange(double);
760     void pluginZoomFactorDidChange(double);
761
762     // Find.
763     void findString(const String&, FindOptions, unsigned maxMatchCount);
764     void findStringMatches(const String&, FindOptions, unsigned maxMatchCount);
765     void getImageForFindMatch(int32_t matchIndex);
766     void selectFindMatch(int32_t matchIndex);
767     void didGetImageForFindMatch(const ShareableBitmap::Handle& contentImageHandle, uint32_t matchIndex);
768     void hideFindUI();
769     void countStringMatches(const String&, FindOptions, unsigned maxMatchCount);
770     void didCountStringMatches(const String&, uint32_t matchCount);
771     void setTextIndicator(const WebCore::TextIndicatorData&, uint64_t /* WebCore::TextIndicatorWindowLifetime */ lifetime = 0 /* Permanent */);
772     void setTextIndicatorAnimationProgress(float);
773     void clearTextIndicator();
774     void didFindString(const String&, const Vector<WebCore::IntRect>&, uint32_t matchCount, int32_t matchIndex);
775     void didFailToFindString(const String&);
776     void didFindStringMatches(const String&, const Vector<Vector<WebCore::IntRect>>& matchRects, int32_t firstIndexAfterSelection);
777
778     void getContentsAsString(std::function<void (const String&, CallbackBase::Error)>);
779     void getBytecodeProfile(std::function<void (const String&, CallbackBase::Error)>);
780     void getSamplingProfilerOutput(std::function<void (const String&, CallbackBase::Error)>);
781     void isWebProcessResponsive(std::function<void (bool isWebProcessResponsive)>);
782
783 #if ENABLE(MHTML)
784     void getContentsAsMHTMLData(std::function<void (API::Data*, CallbackBase::Error)>);
785 #endif
786     void getMainResourceDataOfFrame(WebFrameProxy*, std::function<void (API::Data*, CallbackBase::Error)>);
787     void getResourceDataFromFrame(WebFrameProxy*, API::URL*, std::function<void (API::Data*, CallbackBase::Error)>);
788     void getRenderTreeExternalRepresentation(std::function<void (const String&, CallbackBase::Error)>);
789     void getSelectionOrContentsAsString(std::function<void (const String&, CallbackBase::Error)>);
790     void getSelectionAsWebArchiveData(std::function<void (API::Data*, CallbackBase::Error)>);
791     void getSourceForFrame(WebFrameProxy*, std::function<void (const String&, CallbackBase::Error)>);
792     void getWebArchiveOfFrame(WebFrameProxy*, std::function<void (API::Data*, CallbackBase::Error)>);
793     void runJavaScriptInMainFrame(const String&, std::function<void (API::SerializedScriptValue*, bool hadException, const WebCore::ExceptionDetails&, CallbackBase::Error)> callbackFunction);
794     void forceRepaint(PassRefPtr<VoidCallback>);
795
796     float headerHeight(WebFrameProxy*);
797     float footerHeight(WebFrameProxy*);
798     void drawHeader(WebFrameProxy*, const WebCore::FloatRect&);
799     void drawFooter(WebFrameProxy*, const WebCore::FloatRect&);
800
801 #if PLATFORM(COCOA)
802     // Dictionary.
803     void performDictionaryLookupAtLocation(const WebCore::FloatPoint&);
804     void performDictionaryLookupOfCurrentSelection();
805 #endif
806
807     void receivedPolicyDecision(WebCore::PolicyAction, WebFrameProxy&, uint64_t listenerID, API::Navigation* navigationID, const WebsitePolicies&);
808
809     void backForwardRemovedItem(uint64_t itemID);
810
811 #if ENABLE(DRAG_SUPPORT)    
812     // Drag and drop support.
813     void dragEntered(WebCore::DragData&, const String& dragStorageName = String());
814     void dragUpdated(WebCore::DragData&, const String& dragStorageName = String());
815     void dragExited(WebCore::DragData&, const String& dragStorageName = String());
816     void performDragOperation(WebCore::DragData&, const String& dragStorageName, const SandboxExtension::Handle&, const SandboxExtension::HandleArray&);
817
818     void didPerformDragControllerAction(uint64_t dragOperation, bool mouseIsOverFileInput, unsigned numberOfItemsToBeAccepted);
819     void dragEnded(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition, uint64_t operation);
820 #if PLATFORM(COCOA)
821     void setDragImage(const WebCore::IntPoint& clientPosition, const ShareableBitmap::Handle& dragImageHandle, bool isLinkDrag);
822     void setPromisedDataForImage(const String& pasteboardName, const SharedMemory::Handle& imageHandle, uint64_t imageSize, const String& filename, const String& extension,
823                          const String& title, const String& url, const String& visibleURL, const SharedMemory::Handle& archiveHandle, uint64_t archiveSize);
824 #if ENABLE(ATTACHMENT_ELEMENT)
825     void setPromisedDataForAttachment(const String& pasteboardName, const String& filename, const String& extension, const String& title, const String& url, const String& visibleURL);
826 #endif
827 #endif
828 #if PLATFORM(GTK)
829     void startDrag(WebSelectionData&&, uint64_t dragOperation, const ShareableBitmap::Handle& dragImage);
830 #endif
831 #endif
832
833     void processDidBecomeUnresponsive();
834     void processDidBecomeResponsive();
835     void processDidCrash();
836     void willChangeProcessIsResponsive();
837     void didChangeProcessIsResponsive();
838
839 #if PLATFORM(IOS)
840     void processWillBecomeSuspended();
841     void processWillBecomeForeground();
842 #endif
843
844     virtual void enterAcceleratedCompositingMode(const LayerTreeContext&);
845     virtual void exitAcceleratedCompositingMode();
846     virtual void updateAcceleratedCompositingMode(const LayerTreeContext&);
847
848     enum UndoOrRedo { Undo, Redo };
849     void addEditCommand(WebEditCommandProxy*);
850     void removeEditCommand(WebEditCommandProxy*);
851     bool isValidEditCommand(WebEditCommandProxy*);
852     void registerEditCommand(PassRefPtr<WebEditCommandProxy>, UndoOrRedo);
853
854 #if PLATFORM(COCOA)
855     void registerKeypressCommandName(const String& name) { m_knownKeypressCommandNames.add(name); }
856     bool isValidKeypressCommandName(const String& name) const { return m_knownKeypressCommandNames.contains(name); }
857 #endif
858
859     WebProcessProxy& process() { return m_process; }
860     pid_t processIdentifier() const;
861
862     WebPreferences& preferences() { return m_preferences; }
863     void setPreferences(WebPreferences&);
864
865     WebPageGroup& pageGroup() { return m_pageGroup; }
866
867     bool isValid() const;
868
869 #if ENABLE(DRAG_SUPPORT)
870     WebCore::DragOperation currentDragOperation() const { return m_currentDragOperation; }
871     bool currentDragIsOverFileInput() const { return m_currentDragIsOverFileInput; }
872     unsigned currentDragNumberOfFilesToBeAccepted() const { return m_currentDragNumberOfFilesToBeAccepted; }
873     void resetCurrentDragInformation()
874     {
875         m_currentDragOperation = WebCore::DragOperationNone;
876         m_currentDragIsOverFileInput = false;
877         m_currentDragNumberOfFilesToBeAccepted = 0;
878     }
879 #endif
880
881     void preferencesDidChange();
882
883 #if ENABLE(CONTEXT_MENUS)
884     // Called by the WebContextMenuProxy.
885     void contextMenuItemSelected(const WebContextMenuItemData&);
886 #endif
887
888     // Called by the WebOpenPanelResultListenerProxy.
889 #if PLATFORM(IOS)
890     void didChooseFilesForOpenPanelWithDisplayStringAndIcon(const Vector<String>&, const String& displayString, const API::Data* iconData);
891 #endif
892     void didChooseFilesForOpenPanel(const Vector<String>&);
893     void didCancelForOpenPanel();
894
895     WebPageCreationParameters creationParameters();
896
897 #if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
898     void findZoomableAreaForPoint(const WebCore::IntPoint&, const WebCore::IntSize&);
899 #endif
900
901     void handleDownloadRequest(DownloadProxy*);
902
903     void advanceToNextMisspelling(bool startBeforeSelection);
904     void changeSpellingToWord(const String& word);
905 #if USE(APPKIT)
906     void uppercaseWord();
907     void lowercaseWord();
908     void capitalizeWord();
909 #endif
910
911 #if PLATFORM(COCOA)
912     bool isSmartInsertDeleteEnabled() const { return m_isSmartInsertDeleteEnabled; }
913     void setSmartInsertDeleteEnabled(bool);
914 #endif
915
916 #if PLATFORM(GTK)
917     String accessibilityPlugID() const { return m_accessibilityPlugID; }
918 #endif
919
920     void setCanRunModal(bool);
921     bool canRunModal();
922
923     void beginPrinting(WebFrameProxy*, const PrintInfo&);
924     void endPrinting();
925     void computePagesForPrinting(WebFrameProxy*, const PrintInfo&, PassRefPtr<ComputedPagesCallback>);
926 #if PLATFORM(COCOA)
927     void drawRectToImage(WebFrameProxy*, const PrintInfo&, const WebCore::IntRect&, const WebCore::IntSize&, PassRefPtr<ImageCallback>);
928     void drawPagesToPDF(WebFrameProxy*, const PrintInfo&, uint32_t first, uint32_t count, PassRefPtr<DataCallback>);
929 #if PLATFORM(IOS)
930     uint32_t computePagesForPrintingAndDrawToPDF(uint64_t frameID, const PrintInfo&, DrawToPDFCallback::CallbackFunction&&);
931     void drawToPDFCallback(const IPC::DataReference& pdfData, uint64_t callbackID);
932 #endif
933 #elif PLATFORM(GTK)
934     void drawPagesForPrinting(WebFrameProxy*, const PrintInfo&, PassRefPtr<PrintFinishedCallback>);
935 #endif
936
937     PageLoadState& pageLoadState() { return m_pageLoadState; }
938
939 #if PLATFORM(COCOA)
940     void handleAlternativeTextUIResult(const String& result);
941 #endif
942
943     void saveDataToFileInDownloadsFolder(const String& suggestedFilename, const String& mimeType, const String& originatingURLString, API::Data*);
944     void savePDFToFileInDownloadsFolder(const String& suggestedFilename, const String& originatingURLString, const IPC::DataReference&);
945 #if PLATFORM(COCOA)
946     void savePDFToTemporaryFolderAndOpenWithNativeApplicationRaw(const String& suggestedFilename, const String& originatingURLString, const uint8_t* data, unsigned long size, const String& pdfUUID);
947     void savePDFToTemporaryFolderAndOpenWithNativeApplication(const String& suggestedFilename, const String& originatingURLString, const IPC::DataReference&, const String& pdfUUID);
948     void openPDFFromTemporaryFolderWithNativeApplication(const String& pdfUUID);
949 #endif
950
951     WebCore::IntRect visibleScrollerThumbRect() const { return m_visibleScrollerThumbRect; }
952
953     uint64_t renderTreeSize() const { return m_renderTreeSize; }
954
955     void printMainFrame();
956     
957     void setMediaVolume(float);
958     void setMuted(WebCore::MediaProducer::MutedStateFlags);
959     void setMayStartMediaWhenInWindow(bool);
960     bool mayStartMediaWhenInWindow() const { return m_mayStartMediaWhenInWindow; }
961         
962 #if ENABLE(MEDIA_SESSION)
963     bool hasMediaSessionWithActiveMediaElements() const { return m_hasMediaSessionWithActiveMediaElements; }
964     void handleMediaEvent(WebCore::MediaEventType);
965     void setVolumeOfMediaElement(double, uint64_t);
966 #endif
967         
968 #if ENABLE(POINTER_LOCK)
969     void didAllowPointerLock();
970     void didDenyPointerLock();
971 #endif
972
973     // WebPopupMenuProxy::Client
974     NativeWebMouseEvent* currentlyProcessedMouseDownEvent() override;
975
976     void setSuppressVisibilityUpdates(bool flag);
977     bool suppressVisibilityUpdates() { return m_suppressVisibilityUpdates; }
978
979 #if PLATFORM(IOS)
980     void willStartUserTriggeredZooming();
981
982     void potentialTapAtPosition(const WebCore::FloatPoint&, uint64_t& requestID);
983     void commitPotentialTap();
984     void cancelPotentialTap();
985     void tapHighlightAtPosition(const WebCore::FloatPoint&, uint64_t& requestID);
986     void handleTap(const WebCore::FloatPoint&);
987
988     void inspectorNodeSearchMovedToPosition(const WebCore::FloatPoint&);
989     void inspectorNodeSearchEndedAtPosition(const WebCore::FloatPoint&);
990
991     void blurAssistedNode();
992 #endif
993
994     void postMessageToInjectedBundle(const String& messageName, API::Object* messageBody);
995
996 #if ENABLE(INPUT_TYPE_COLOR)
997     void setColorPickerColor(const WebCore::Color&);
998     void endColorPicker();
999 #endif
1000
1001     WebCore::IntSize minimumLayoutSize() const { return m_minimumLayoutSize; }
1002     void setMinimumLayoutSize(const WebCore::IntSize&);
1003
1004     bool autoSizingShouldExpandToViewHeight() const { return m_autoSizingShouldExpandToViewHeight; }
1005     void setAutoSizingShouldExpandToViewHeight(bool);
1006
1007     void didReceiveAuthenticationChallengeProxy(uint64_t frameID, PassRefPtr<AuthenticationChallengeProxy>);
1008
1009     int64_t spellDocumentTag();
1010     void didFinishCheckingText(uint64_t requestID, const Vector<WebCore::TextCheckingResult>&);
1011     void didCancelCheckingText(uint64_t requestID);
1012
1013     void connectionWillOpen(IPC::Connection&);
1014     void webProcessWillShutDown();
1015
1016     void processDidFinishLaunching();
1017
1018     void didSaveToPageCache();
1019         
1020     void setScrollPinningBehavior(WebCore::ScrollPinningBehavior);
1021     WebCore::ScrollPinningBehavior scrollPinningBehavior() const { return m_scrollPinningBehavior; }
1022
1023     void setOverlayScrollbarStyle(std::optional<WebCore::ScrollbarOverlayStyle>);
1024     std::optional<WebCore::ScrollbarOverlayStyle> overlayScrollbarStyle() const { return m_scrollbarOverlayStyle; }
1025
1026     bool shouldRecordNavigationSnapshots() const { return m_shouldRecordNavigationSnapshots; }
1027     void setShouldRecordNavigationSnapshots(bool shouldRecordSnapshots) { m_shouldRecordNavigationSnapshots = shouldRecordSnapshots; }
1028     void recordAutomaticNavigationSnapshot();
1029     void recordNavigationSnapshot(WebBackForwardListItem&);
1030
1031 #if PLATFORM(COCOA)
1032     PassRefPtr<ViewSnapshot> takeViewSnapshot();
1033 #endif
1034
1035 #if ENABLE(SUBTLE_CRYPTO)
1036     void wrapCryptoKey(const Vector<uint8_t>&, bool& succeeded, Vector<uint8_t>&);
1037     void unwrapCryptoKey(const Vector<uint8_t>&, bool& succeeded, Vector<uint8_t>&);
1038 #endif
1039
1040     void takeSnapshot(WebCore::IntRect, WebCore::IntSize bitmapSize, SnapshotOptions, std::function<void (const ShareableBitmap::Handle&, CallbackBase::Error)>);
1041
1042     void navigationGestureDidBegin();
1043     void navigationGestureWillEnd(bool willNavigate, WebBackForwardListItem&);
1044     void navigationGestureDidEnd(bool willNavigate, WebBackForwardListItem&);
1045     void navigationGestureDidEnd();
1046     void navigationGestureSnapshotWasRemoved();
1047     void willRecordNavigationSnapshot(WebBackForwardListItem&);
1048
1049     bool isShowingNavigationGestureSnapshot() const { return m_isShowingNavigationGestureSnapshot; }
1050
1051     bool isPlayingAudio() const { return !!(m_mediaState & WebCore::MediaProducer::IsPlayingAudio); }
1052     void isPlayingMediaDidChange(WebCore::MediaProducer::MediaStateFlags, uint64_t);
1053     bool hasActiveAudioStream() const { return m_mediaState & WebCore::MediaProducer::HasActiveAudioCaptureDevice; }
1054     bool hasActiveVideoStream() const { return m_mediaState & WebCore::MediaProducer::HasActiveVideoCaptureDevice; }
1055     WebCore::MediaProducer::MediaStateFlags mediaStateFlags() const { return m_mediaState; }
1056
1057 #if PLATFORM(MAC)
1058     void videoControlsManagerDidChange();
1059     bool hasActiveVideoForControlsManager() const;
1060     void requestControlledElementID() const;
1061     void handleControlledElementIDResponse(const String&) const;
1062     void requestActiveNowPlayingSessionInfo();
1063     void handleActiveNowPlayingSessionInfoResponse(bool hasActiveSession, const String& title, double duration, double elapsedTime) const;
1064     bool isPlayingVideoInEnhancedFullscreen() const;
1065 #endif
1066
1067 #if ENABLE(MEDIA_SESSION)
1068     void hasMediaSessionWithActiveMediaElementsDidChange(bool);
1069     void mediaSessionMetadataDidChange(const WebCore::MediaSessionMetadata&);
1070     void focusedContentMediaElementDidChange(uint64_t);
1071 #endif
1072
1073 #if PLATFORM(MAC)
1074     void removeNavigationGestureSnapshot();
1075
1076     API::HitTestResult* lastMouseMoveHitTestResult() const { return m_lastMouseMoveHitTestResult.get(); }
1077     void performImmediateActionHitTestAtLocation(WebCore::FloatPoint);
1078
1079     void immediateActionDidUpdate();
1080     void immediateActionDidCancel();
1081     void immediateActionDidComplete();
1082
1083     void* immediateActionAnimationControllerForHitTestResult(RefPtr<API::HitTestResult>, uint64_t, RefPtr<API::Object>);
1084
1085     void installActivityStateChangeCompletionHandler(void(^completionHandler)());
1086
1087     void handleAcceptedCandidate(WebCore::TextCheckingResult);
1088     void didHandleAcceptedCandidate();
1089 #endif
1090
1091 #if PLATFORM(EFL) && HAVE(ACCESSIBILITY) && defined(HAVE_ECORE_X)
1092     bool accessibilityObjectReadByPoint(const WebCore::IntPoint&);
1093     bool accessibilityObjectReadPrevious();
1094     bool accessibilityObjectReadNext();
1095 #endif
1096
1097 #if USE(UNIFIED_TEXT_CHECKING)
1098     void checkTextOfParagraph(const String& text, uint64_t checkingTypes, int32_t insertionPoint, Vector<WebCore::TextCheckingResult>& results);
1099 #endif
1100     void getGuessesForWord(const String& word, const String& context, int32_t insertionPoint, Vector<String>& guesses);
1101
1102     void setShouldDispatchFakeMouseMoveEvents(bool);
1103
1104     // Diagnostic messages logging.
1105     void logDiagnosticMessage(const String& message, const String& description, bool shouldSample);
1106     void logDiagnosticMessageWithResult(const String& message, const String& description, uint32_t result, bool shouldSample);
1107     void logDiagnosticMessageWithValue(const String& message, const String& description, const String& value, bool shouldSample);
1108     void logSampledDiagnosticMessage(const String& message, const String& description);
1109     void logSampledDiagnosticMessageWithResult(const String& message, const String& description, uint32_t result);
1110     void logSampledDiagnosticMessageWithValue(const String& message, const String& description, const String& value);
1111
1112     // Form validation messages.
1113     void showValidationMessage(const WebCore::IntRect& anchorClientRect, const String& message);
1114     void hideValidationMessage();
1115 #if PLATFORM(COCOA)
1116     WebCore::ValidationBubble* validationBubble() const { return m_validationBubble.get(); } // For testing.
1117 #endif
1118
1119 #if PLATFORM(IOS)
1120     void setIsKeyboardAnimatingIn(bool isKeyboardAnimatingIn) { m_isKeyboardAnimatingIn = isKeyboardAnimatingIn; }
1121 #endif
1122
1123 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
1124     void addPlaybackTargetPickerClient(uint64_t);
1125     void removePlaybackTargetPickerClient(uint64_t);
1126     void showPlaybackTargetPicker(uint64_t, const WebCore::FloatRect&, bool hasVideo);
1127     void playbackTargetPickerClientStateDidChange(uint64_t, WebCore::MediaProducer::MediaStateFlags);
1128     void setMockMediaPlaybackTargetPickerEnabled(bool);
1129     void setMockMediaPlaybackTargetPickerState(const String&, WebCore::MediaPlaybackTargetContext::State);
1130
1131     // WebMediaSessionManagerClient
1132     void setPlaybackTarget(uint64_t, Ref<WebCore::MediaPlaybackTarget>&&) override;
1133     void externalOutputDeviceAvailableDidChange(uint64_t, bool) override;
1134     void setShouldPlayToPlaybackTarget(uint64_t, bool) override;
1135 #endif
1136
1137     void didChangeBackgroundColor();
1138     void didLayoutForCustomContentProvider();
1139
1140     // For testing
1141     void clearWheelEventTestTrigger();
1142     void callAfterNextPresentationUpdate(std::function<void (CallbackBase::Error)>);
1143
1144     void didReachLayoutMilestone(uint32_t layoutMilestones);
1145
1146     void didRestoreScrollPosition();
1147
1148     void getLoadDecisionForIcon(const WebCore::LinkIcon&, uint64_t callbackID);
1149     void finishedLoadingIcon(uint64_t callbackIdentifier, const IPC::DataReference&);
1150
1151     void setFocus(bool focused);
1152     void setWindowFrame(const WebCore::FloatRect&);
1153     void getWindowFrame(WebCore::FloatRect&);
1154
1155     bool isResourceCachingDisabled() const { return m_isResourceCachingDisabled; }
1156     void setResourceCachingDisabled(bool);
1157
1158     WebCore::UserInterfaceLayoutDirection userInterfaceLayoutDirection();
1159     void setUserInterfaceLayoutDirection(WebCore::UserInterfaceLayoutDirection);
1160
1161     bool hasHadSelectionChangesFromUserInteraction() const { return m_hasHadSelectionChangesFromUserInteraction; }
1162     bool needsHiddenContentEditableQuirk() const { return m_needsHiddenContentEditableQuirk; }
1163     bool needsPlainTextQuirk() const { return m_needsPlainTextQuirk; }
1164
1165     bool isAlwaysOnLoggingAllowed() const;
1166
1167     void canAuthenticateAgainstProtectionSpace(uint64_t loaderID, uint64_t frameID, const WebCore::ProtectionSpace&);
1168
1169 #if ENABLE(GAMEPAD)
1170     void gamepadActivity(const Vector<GamepadData>&);
1171 #endif
1172         
1173     WeakPtr<WebPageProxy> createWeakPtr() const { return m_weakPtrFactory.createWeakPtr(); }
1174
1175     void isLoadingChanged() { activityStateDidChange(WebCore::ActivityState::IsLoading); }
1176
1177     void clearUserMediaState();
1178
1179 private:
1180     WebPageProxy(PageClient&, WebProcessProxy&, uint64_t pageID, Ref<API::PageConfiguration>&&);
1181     void platformInitialize();
1182
1183     void updateActivityState(WebCore::ActivityState::Flags flagsToUpdate = WebCore::ActivityState::AllFlags);
1184     void updateThrottleState();
1185     void updateHiddenPageThrottlingAutoIncreases();
1186
1187     enum class ResetStateReason {
1188         PageInvalidated,
1189         WebProcessExited,
1190     };
1191     void resetState(ResetStateReason);
1192     void resetStateAfterProcessExited();
1193
1194     void setUserAgent(const String&);
1195
1196     // IPC::MessageReceiver
1197     // Implemented in generated WebPageProxyMessageReceiver.cpp
1198     void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override;
1199     void didReceiveSyncMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&) override;
1200
1201
1202     // IPC::MessageSender
1203     bool sendMessage(std::unique_ptr<IPC::Encoder>, OptionSet<IPC::SendOption>) override;
1204     IPC::Connection* messageSenderConnection() override;
1205     uint64_t messageSenderDestinationID() override;
1206
1207     // WebPopupMenuProxy::Client
1208     void valueChangedForPopupMenu(WebPopupMenuProxy*, int32_t newSelectedIndex) override;
1209     void setTextFromItemForPopupMenu(WebPopupMenuProxy*, int32_t index) override;
1210 #if PLATFORM(GTK)
1211     void failedToShowPopupMenu() override;
1212 #endif
1213
1214 #if ENABLE(POINTER_LOCK)
1215     void requestPointerLock();
1216     void requestPointerUnlock();
1217 #endif
1218
1219     void didCreateMainFrame(uint64_t frameID);
1220     void didCreateSubframe(uint64_t frameID);
1221
1222     void didStartProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, const String& url, const String& unreachableURL, const UserData&);
1223     void didReceiveServerRedirectForProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, const String&, const UserData&);
1224     void didChangeProvisionalURLForFrame(uint64_t frameID, uint64_t navigationID, const String& url);
1225     void didFailProvisionalLoadForFrame(uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, uint64_t navigationID, const String& provisionalURL, const WebCore::ResourceError&, const UserData&);
1226     void didCommitLoadForFrame(uint64_t frameID, uint64_t navigationID, const String& mimeType, bool frameHasCustomContentProvider, uint32_t frameLoadType, const WebCore::CertificateInfo&, bool containsPluginDocument, std::optional<WebCore::HasInsecureContent> forcedHasInsecureContent, const UserData&);
1227     void didFinishDocumentLoadForFrame(uint64_t frameID, uint64_t navigationID, const UserData&);
1228     void didFinishLoadForFrame(uint64_t frameID, uint64_t navigationID, const UserData&);
1229     void didFailLoadForFrame(uint64_t frameID, uint64_t navigationID, const WebCore::ResourceError&, const UserData&);
1230     void didSameDocumentNavigationForFrame(uint64_t frameID, uint64_t navigationID, uint32_t sameDocumentNavigationType, const String&, const UserData&);
1231     void didReceiveTitleForFrame(uint64_t frameID, const String&, const UserData&);
1232     void didFirstLayoutForFrame(uint64_t frameID, const UserData&);
1233     void didFirstVisuallyNonEmptyLayoutForFrame(uint64_t frameID, const UserData&);
1234     void didDisplayInsecureContentForFrame(uint64_t frameID, const UserData&);
1235     void didRunInsecureContentForFrame(uint64_t frameID, const UserData&);
1236     void didDetectXSSForFrame(uint64_t frameID, const UserData&);
1237     void mainFramePluginHandlesPageScaleGestureDidChange(bool);
1238     void frameDidBecomeFrameSet(uint64_t frameID, bool);
1239     void didStartProgress();
1240     void didChangeProgress(double);
1241     void didFinishProgress();
1242     void setNetworkRequestsInProgress(bool);
1243
1244     void hasInsecureContent(WebCore::HasInsecureContent&);
1245
1246     void didDestroyNavigation(uint64_t navigationID);
1247
1248     void decidePolicyForNavigationAction(uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, uint64_t navigationID, const NavigationActionData&, uint64_t originatingFrameID, const WebCore::SecurityOriginData& originatingFrameSecurityOrigin, const WebCore::ResourceRequest& originalRequest, const WebCore::ResourceRequest&, uint64_t listenerID, const UserData&, bool& receivedPolicyAction, uint64_t& newNavigationID, uint64_t& policyAction, DownloadID&, WebsitePolicies&);
1249     void decidePolicyForNewWindowAction(uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, const NavigationActionData&, const WebCore::ResourceRequest&, const String& frameName, uint64_t listenerID, const UserData&);
1250     void decidePolicyForResponse(uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, bool canShowMIMEType, uint64_t listenerID, const UserData&);
1251     void decidePolicyForResponseSync(uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, bool canShowMIMEType, uint64_t listenerID, const UserData&, bool& receivedPolicyAction, uint64_t& policyAction, DownloadID&);
1252     void unableToImplementPolicy(uint64_t frameID, const WebCore::ResourceError&, const UserData&);
1253
1254     void willSubmitForm(uint64_t frameID, uint64_t sourceFrameID, const Vector<std::pair<String, String>>& textFieldValues, uint64_t listenerID, const UserData&);
1255
1256     // History client
1257     void didNavigateWithNavigationData(const WebNavigationDataStore&, uint64_t frameID);
1258     void didPerformClientRedirect(const String& sourceURLString, const String& destinationURLString, uint64_t frameID);
1259     void didPerformServerRedirect(const String& sourceURLString, const String& destinationURLString, uint64_t frameID);
1260     void didUpdateHistoryTitle(const String& title, const String& url, uint64_t frameID);
1261
1262     // UI client
1263     void createNewPage(uint64_t frameID, const WebCore::SecurityOriginData&, const WebCore::ResourceRequest&, const WebCore::WindowFeatures&, const NavigationActionData&, uint64_t& newPageID, WebPageCreationParameters&);
1264     void showPage();
1265     void runJavaScriptAlert(uint64_t frameID, const WebCore::SecurityOriginData&, const String&, RefPtr<Messages::WebPageProxy::RunJavaScriptAlert::DelayedReply>);
1266     void runJavaScriptConfirm(uint64_t frameID, const WebCore::SecurityOriginData&, const String&, RefPtr<Messages::WebPageProxy::RunJavaScriptConfirm::DelayedReply>);
1267     void runJavaScriptPrompt(uint64_t frameID, const WebCore::SecurityOriginData&, const String&, const String&, RefPtr<Messages::WebPageProxy::RunJavaScriptPrompt::DelayedReply>);
1268     void setStatusText(const String&);
1269     void mouseDidMoveOverElement(const WebHitTestResultData&, uint32_t modifiers, const UserData&);
1270
1271 #if ENABLE(NETSCAPE_PLUGIN_API)
1272     void unavailablePluginButtonClicked(uint32_t opaquePluginUnavailabilityReason, const String& mimeType, const String& pluginURLString, const String& pluginsPageURLString, const String& frameURLString, const String& pageURLString);
1273 #endif // ENABLE(NETSCAPE_PLUGIN_API)
1274 #if ENABLE(WEBGL)
1275     void webGLPolicyForURL(const String& url, uint32_t& loadPolicy);
1276     void resolveWebGLPolicyForURL(const String& url, uint32_t& loadPolicy);
1277 #endif // ENABLE(WEBGL)
1278     void setToolbarsAreVisible(bool toolbarsAreVisible);
1279     void getToolbarsAreVisible(bool& toolbarsAreVisible);
1280     void setMenuBarIsVisible(bool menuBarIsVisible);
1281     void getMenuBarIsVisible(bool& menuBarIsVisible);
1282     void setStatusBarIsVisible(bool statusBarIsVisible);
1283     void getStatusBarIsVisible(bool& statusBarIsVisible);
1284     void setIsResizable(bool isResizable);
1285     void getIsResizable(bool& isResizable);
1286     void screenToRootView(const WebCore::IntPoint& screenPoint, WebCore::IntPoint& windowPoint);
1287     void rootViewToScreen(const WebCore::IntRect& viewRect, WebCore::IntRect& result);
1288 #if PLATFORM(IOS)
1289     void accessibilityScreenToRootView(const WebCore::IntPoint& screenPoint, WebCore::IntPoint& windowPoint);
1290     void rootViewToAccessibilityScreen(const WebCore::IntRect& viewRect, WebCore::IntRect& result);
1291 #endif
1292     void runBeforeUnloadConfirmPanel(const String& message, uint64_t frameID, RefPtr<Messages::WebPageProxy::RunBeforeUnloadConfirmPanel::DelayedReply>);
1293     void didChangeViewportProperties(const WebCore::ViewportAttributes&);
1294     void pageDidScroll();
1295     void runOpenPanel(uint64_t frameID, const WebCore::SecurityOriginData&, const WebCore::FileChooserSettings&);
1296     void printFrame(uint64_t frameID);
1297     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, PassRefPtr<Messages::WebPageProxy::ExceededDatabaseQuota::DelayedReply>);
1298     void reachedApplicationCacheOriginQuota(const String& originIdentifier, uint64_t currentQuota, uint64_t totalBytesNeeded, PassRefPtr<Messages::WebPageProxy::ReachedApplicationCacheOriginQuota::DelayedReply>);
1299     void requestGeolocationPermissionForFrame(uint64_t geolocationID, uint64_t frameID, String originIdentifier);
1300
1301 #if ENABLE(MEDIA_STREAM)
1302     UserMediaPermissionRequestManagerProxy& userMediaPermissionRequestManager();
1303 #endif
1304     void requestUserMediaPermissionForFrame(uint64_t userMediaID, uint64_t frameID, String userMediaDocumentOriginIdentifier, String topLevelDocumentOriginIdentifier, const WebCore::MediaConstraintsData& audioConstraints, const WebCore::MediaConstraintsData& videoConstraints);
1305     void enumerateMediaDevicesForFrame(uint64_t userMediaID, uint64_t frameID, String userMediaDocumentOriginIdentifier, String topLevelDocumentOriginIdentifier);
1306
1307     void runModal();
1308     void notifyScrollerThumbIsVisibleInRect(const WebCore::IntRect&);
1309     void recommendedScrollbarStyleDidChange(int32_t newStyle);
1310     void didChangeScrollbarsForMainFrame(bool hasHorizontalScrollbar, bool hasVerticalScrollbar);
1311     void didChangeScrollOffsetPinningForMainFrame(bool pinnedToLeftSide, bool pinnedToRightSide, bool pinnedToTopSide, bool pinnedToBottomSide);
1312     void didChangePageCount(unsigned);
1313     void pageExtendedBackgroundColorDidChange(const WebCore::Color&);
1314 #if ENABLE(NETSCAPE_PLUGIN_API)
1315     void didFailToInitializePlugin(const String& mimeType, const String& frameURLString, const String& pageURLString);
1316     void didBlockInsecurePluginVersion(const String& mimeType, const String& pluginURLString, const String& frameURLString, const String& pageURLString, bool replacementObscured);
1317 #endif // ENABLE(NETSCAPE_PLUGIN_API)
1318     void setCanShortCircuitHorizontalWheelEvents(bool canShortCircuitHorizontalWheelEvents) { m_canShortCircuitHorizontalWheelEvents = canShortCircuitHorizontalWheelEvents; }
1319
1320     void reattachToWebProcess();
1321     RefPtr<API::Navigation> reattachToWebProcessForReload();
1322     RefPtr<API::Navigation> reattachToWebProcessWithItem(WebBackForwardListItem*);
1323
1324     void requestNotificationPermission(uint64_t notificationID, const String& originString);
1325     void showNotification(const String& title, const String& body, const String& iconURL, const String& tag, const String& lang, const String& dir, const String& originString, uint64_t notificationID);
1326     void cancelNotification(uint64_t notificationID);
1327     void clearNotifications(const Vector<uint64_t>& notificationIDs);
1328     void didDestroyNotification(uint64_t notificationID);
1329
1330 #if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
1331     void pageDidRequestScroll(const WebCore::IntPoint&);
1332     void pageTransitionViewportReady();
1333     void didFindZoomableArea(const WebCore::IntPoint&, const WebCore::IntRect&);
1334 #endif
1335
1336     void didChangeContentSize(const WebCore::IntSize&);
1337
1338 #if ENABLE(INPUT_TYPE_COLOR)
1339     void showColorPicker(const WebCore::Color& initialColor, const WebCore::IntRect&);
1340     void didChooseColor(const WebCore::Color&) override;
1341     void didEndColorPicker() override;
1342 #endif
1343
1344     void editorStateChanged(const EditorState&);
1345     void compositionWasCanceled();
1346     void setHasHadSelectionChangesFromUserInteraction(bool);
1347     void setNeedsHiddenContentEditableQuirk(bool);
1348     void setNeedsPlainTextQuirk(bool);
1349
1350     // Back/Forward list management
1351     void backForwardAddItem(uint64_t itemID);
1352     void backForwardGoToItem(uint64_t itemID, SandboxExtension::Handle&);
1353     void backForwardItemAtIndex(int32_t index, uint64_t& itemID);
1354     void backForwardBackListCount(int32_t& count);
1355     void backForwardForwardListCount(int32_t& count);
1356     void backForwardClear();
1357
1358     // Undo management
1359     void registerEditCommandForUndo(uint64_t commandID, uint32_t editAction);
1360     void registerInsertionUndoGrouping();
1361     void clearAllEditCommands();
1362     void canUndoRedo(uint32_t action, bool& result);
1363     void executeUndoRedo(uint32_t action, bool& result);
1364
1365     // Keyboard handling
1366 #if PLATFORM(COCOA)
1367     void executeSavedCommandBySelector(const String& selector, bool& handled);
1368 #endif
1369
1370 #if PLATFORM(GTK)
1371     void getEditorCommandsForKeyEvent(const AtomicString&, Vector<String>&);
1372     void bindAccessibilityTree(const String&);
1373 #endif
1374 #if PLATFORM(EFL)
1375     void getEditorCommandsForKeyEvent(Vector<String>&);
1376 #endif
1377
1378     // Popup Menu.
1379     void showPopupMenu(const WebCore::IntRect& rect, uint64_t textDirection, const Vector<WebPopupItem>& items, int32_t selectedIndex, const PlatformPopupMenuData&);
1380     void hidePopupMenu();
1381
1382 #if ENABLE(CONTEXT_MENUS)
1383     void showContextMenu(const ContextMenuContextData&, const UserData&);
1384     void internalShowContextMenu(const ContextMenuContextData&, const UserData&);
1385 #endif
1386
1387 #if ENABLE(TELEPHONE_NUMBER_DETECTION)
1388 #if PLATFORM(MAC)
1389     void showTelephoneNumberMenu(const String& telephoneNumber, const WebCore::IntPoint&);
1390 #endif
1391 #endif
1392
1393     // Search popup results
1394     void saveRecentSearches(const String&, const Vector<WebCore::RecentSearch>&);
1395     void loadRecentSearches(const String&, Vector<WebCore::RecentSearch>&);
1396
1397 #if PLATFORM(COCOA)
1398     // Speech.
1399     void getIsSpeaking(bool&);
1400     void speak(const String&);
1401     void stopSpeaking();
1402
1403     // Spotlight.
1404     void searchWithSpotlight(const String&);
1405         
1406     void searchTheWeb(const String&);
1407
1408     // Dictionary.
1409     void didPerformDictionaryLookup(const WebCore::DictionaryPopupInfo&);
1410 #endif
1411
1412 #if PLATFORM(MAC)
1413     bool appleMailPaginationQuirkEnabled();
1414 #endif
1415
1416     // Spelling and grammar.
1417     void checkSpellingOfString(const String& text, int32_t& misspellingLocation, int32_t& misspellingLength);
1418     void checkGrammarOfString(const String& text, Vector<WebCore::GrammarDetail>&, int32_t& badGrammarLocation, int32_t& badGrammarLength);
1419     void spellingUIIsShowing(bool&);
1420     void updateSpellingUIWithMisspelledWord(const String& misspelledWord);
1421     void updateSpellingUIWithGrammarString(const String& badGrammarPhrase, const WebCore::GrammarDetail&);
1422     void learnWord(const String& word);
1423     void ignoreWord(const String& word);
1424     void requestCheckingOfString(uint64_t requestID, const WebCore::TextCheckingRequestData&, int32_t insertionPoint);
1425
1426     void takeFocus(uint32_t direction);
1427     void setToolTip(const String&);
1428     void setCursor(const WebCore::Cursor&);
1429     void setCursorHiddenUntilMouseMoves(bool);
1430
1431     void didReceiveEvent(uint32_t opaqueType, bool handled);
1432     void stopResponsivenessTimer();
1433
1434     void voidCallback(uint64_t);
1435     void dataCallback(const IPC::DataReference&, uint64_t);
1436     void imageCallback(const ShareableBitmap::Handle&, uint64_t);
1437     void stringCallback(const String&, uint64_t);
1438     void invalidateStringCallback(uint64_t);
1439     void scriptValueCallback(const IPC::DataReference&, bool hadException, const WebCore::ExceptionDetails&, uint64_t);
1440     void computedPagesCallback(const Vector<WebCore::IntRect>&, double totalScaleFactorForPrinting, uint64_t);
1441     void validateCommandCallback(const String&, bool, int, uint64_t);
1442     void unsignedCallback(uint64_t, uint64_t);
1443     void editingRangeCallback(const EditingRange&, uint64_t);
1444 #if PLATFORM(COCOA)
1445     void machSendRightCallback(const WebCore::MachSendRight&, uint64_t);
1446 #endif
1447     void rectForCharacterRangeCallback(const WebCore::IntRect&, const EditingRange&, uint64_t);
1448 #if PLATFORM(MAC)
1449     void attributedStringForCharacterRangeCallback(const AttributedString&, const EditingRange&, uint64_t);
1450     void fontAtSelectionCallback(const String&, double, bool, uint64_t);
1451 #endif
1452 #if PLATFORM(IOS)
1453     void gestureCallback(const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t, uint64_t);
1454     void touchesCallback(const WebCore::IntPoint&, uint32_t, uint32_t, uint64_t);
1455     void autocorrectionDataCallback(const Vector<WebCore::FloatRect>&, const String&, float, uint64_t, uint64_t);
1456     void autocorrectionContextCallback(const String&, const String&, const String&, const String&, uint64_t, uint64_t, uint64_t);
1457     void selectionContextCallback(const String&, const String&, const String&, uint64_t);
1458     void interpretKeyEvent(const EditorState&, bool isCharEvent, bool& handled);
1459     void showPlaybackTargetPicker(bool hasVideo, const WebCore::IntRect& elementRect);
1460 #endif
1461 #if PLATFORM(GTK)
1462     void printFinishedCallback(const WebCore::ResourceError&, uint64_t);
1463 #endif
1464
1465     void focusedFrameChanged(uint64_t frameID);
1466     void frameSetLargestFrameChanged(uint64_t frameID);
1467
1468     void didReceiveAuthenticationChallenge(uint64_t frameID, const WebCore::AuthenticationChallenge&, uint64_t challengeID);
1469
1470     void didFinishLoadingDataForCustomContentProvider(const String& suggestedFilename, const IPC::DataReference&);
1471
1472 #if PLATFORM(COCOA)
1473     void pluginFocusOrWindowFocusChanged(uint64_t pluginComplexTextInputIdentifier, bool pluginHasFocusAndWindowHasFocus);
1474     void setPluginComplexTextInputState(uint64_t pluginComplexTextInputIdentifier, uint64_t complexTextInputState);
1475 #endif
1476
1477     bool maybeInitializeSandboxExtensionHandle(const WebCore::URL&, SandboxExtension::Handle&);
1478
1479 #if USE(AUTOMATIC_TEXT_REPLACEMENT)
1480     void toggleSmartInsertDelete();
1481     void toggleAutomaticQuoteSubstitution();
1482     void toggleAutomaticLinkDetection();
1483     void toggleAutomaticDashSubstitution();
1484     void toggleAutomaticTextReplacement();
1485 #endif
1486
1487 #if PLATFORM(MAC)
1488     void substitutionsPanelIsShowing(bool&);
1489     void showCorrectionPanel(int32_t panelType, const WebCore::FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, const Vector<String>& alternativeReplacementStrings);
1490     void dismissCorrectionPanel(int32_t reason);
1491     void dismissCorrectionPanelSoon(int32_t reason, String& result);
1492     void recordAutocorrectionResponse(int32_t responseType, const String& replacedString, const String& replacementString);
1493
1494 #if USE(DICTATION_ALTERNATIVES)
1495     void showDictationAlternativeUI(const WebCore::FloatRect& boundingBoxOfDictatedText, uint64_t dictationContext);
1496     void removeDictationAlternatives(uint64_t dictationContext);
1497     void dictationAlternatives(uint64_t dictationContext, Vector<String>& result);
1498 #endif
1499
1500     void setEditableElementIsFocused(bool);
1501 #endif // PLATFORM(MAC)
1502
1503 #if PLATFORM(IOS)
1504     WebCore::FloatSize screenSize();
1505     WebCore::FloatSize availableScreenSize();
1506     float textAutosizingWidth();
1507
1508     void dynamicViewportUpdateChangedTarget(double newTargetScale, const WebCore::FloatPoint& newScrollPosition, uint64_t dynamicViewportSizeUpdateID);
1509     void couldNotRestorePageState();
1510     void restorePageState(const WebCore::FloatPoint& scrollPosition, const WebCore::FloatPoint& scrollOrigin, const WebCore::FloatSize& obscuredInsetOnSave, double scale);
1511     void restorePageCenterAndScale(const WebCore::FloatPoint&, double scale);
1512
1513     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);
1514
1515     void startAssistingNode(const AssistedNodeInformation&, bool userIsInteracting, bool blurPreviousNode, const UserData&);
1516     void stopAssistingNode();
1517
1518     void showInspectorHighlight(const WebCore::Highlight&);
1519     void hideInspectorHighlight();
1520
1521     void showInspectorIndication();
1522     void hideInspectorIndication();
1523
1524     void enableInspectorNodeSearch();
1525     void disableInspectorNodeSearch();
1526 #endif // PLATFORM(IOS)
1527
1528 #if ENABLE(DATA_DETECTION)
1529     RetainPtr<NSArray> m_dataDetectionResults;
1530 #endif
1531
1532     void clearLoadDependentCallbacks();
1533
1534     void performDragControllerAction(DragControllerAction, WebCore::DragData&, const String& dragStorageName, const SandboxExtension::Handle&, const SandboxExtension::HandleArray&);
1535
1536     void updateBackingStoreDiscardableState();
1537
1538     void setRenderTreeSize(uint64_t treeSize) { m_renderTreeSize = treeSize; }
1539
1540 #if PLUGIN_ARCHITECTURE(X11)
1541     void createPluginContainer(uint64_t& windowID);
1542     void windowedPluginGeometryDidChange(const WebCore::IntRect& frameRect, const WebCore::IntRect& clipRect, uint64_t windowID);
1543     void windowedPluginVisibilityDidChange(bool isVisible, uint64_t windowID);
1544 #endif
1545
1546     void processNextQueuedWheelEvent();
1547     void sendWheelEvent(const WebWheelEvent&);
1548
1549 #if ENABLE(TOUCH_EVENTS)
1550     void updateTouchEventTracking(const WebTouchEvent&);
1551     WebCore::TrackingType touchEventTrackingType(const WebTouchEvent&) const;
1552 #endif
1553
1554 #if ENABLE(NETSCAPE_PLUGIN_API)
1555     void findPlugin(const String& mimeType, uint32_t processType, const String& urlString, const String& frameURLString, const String& pageURLString, bool allowOnlyApplicationPlugins, uint64_t& pluginProcessToken, String& newMIMEType, uint32_t& pluginLoadPolicy, String& unavailabilityDescription);
1556 #endif
1557
1558 #if USE(QUICK_LOOK)
1559     void didStartLoadForQuickLookDocumentInMainFrame(const String& fileName, const String& uti);
1560     void didFinishLoadForQuickLookDocumentInMainFrame(const QuickLookDocumentData&);
1561 #endif
1562
1563 #if ENABLE(CONTENT_FILTERING)
1564     void contentFilterDidBlockLoadForFrame(const WebCore::ContentFilterUnblockHandler&, uint64_t frameID);
1565 #endif
1566
1567     uint64_t generateNavigationID();
1568
1569     WebPreferencesStore preferencesStore() const;
1570
1571     void dispatchActivityStateChange();
1572     void viewDidLeaveWindow();
1573     void viewDidEnterWindow();
1574
1575 #if PLATFORM(MAC)
1576     void didPerformImmediateActionHitTest(const WebHitTestResultData&, bool contentPreventsDefault, const UserData&);
1577 #endif
1578
1579     void useFixedLayoutDidChange(bool useFixedLayout) { m_useFixedLayout = useFixedLayout; }
1580     void fixedLayoutSizeDidChange(WebCore::IntSize fixedLayoutSize) { m_fixedLayoutSize = fixedLayoutSize; }
1581
1582     void imageOrMediaDocumentSizeChanged(const WebCore::IntSize&);
1583 #if ENABLE(VIDEO)
1584 #if USE(GSTREAMER)
1585     void requestInstallMissingMediaPlugins(const String& details, const String& description);
1586 #endif
1587 #endif
1588
1589     void handleAutoFillButtonClick(const UserData&);
1590
1591     void finishInitializingWebPageAfterProcessLaunch();
1592
1593     void handleMessage(IPC::Connection&, const String& messageName, const UserData& messageBody);
1594     void handleSynchronousMessage(IPC::Connection&, const String& messageName, const UserData& messageBody, UserData& returnUserData);
1595
1596     PageClient& m_pageClient;
1597     Ref<API::PageConfiguration> m_configuration;
1598
1599     std::unique_ptr<API::LoaderClient> m_loaderClient;
1600     std::unique_ptr<API::PolicyClient> m_policyClient;
1601     std::unique_ptr<API::NavigationClient> m_navigationClient;
1602     std::unique_ptr<API::HistoryClient> m_historyClient;
1603     std::unique_ptr<API::IconLoadingClient> m_iconLoadingClient;
1604     std::unique_ptr<API::FormClient> m_formClient;
1605     std::unique_ptr<API::UIClient> m_uiClient;
1606     std::unique_ptr<API::FindClient> m_findClient;
1607     std::unique_ptr<API::FindMatchesClient> m_findMatchesClient;
1608     std::unique_ptr<API::DiagnosticLoggingClient> m_diagnosticLoggingClient;
1609 #if ENABLE(CONTEXT_MENUS)
1610     std::unique_ptr<API::ContextMenuClient> m_contextMenuClient;
1611 #endif
1612     std::unique_ptr<WebPageInjectedBundleClient> m_injectedBundleClient;
1613
1614     std::unique_ptr<WebNavigationState> m_navigationState;
1615     String m_failingProvisionalLoadURL;
1616     bool m_isLoadingAlternateHTMLStringForFailingProvisionalLoad { false };
1617
1618     std::unique_ptr<DrawingAreaProxy> m_drawingArea;
1619 #if ENABLE(ASYNC_SCROLLING)
1620     std::unique_ptr<RemoteScrollingCoordinatorProxy> m_scrollingCoordinatorProxy;
1621 #endif
1622
1623     Ref<WebProcessProxy> m_process;
1624     Ref<WebPageGroup> m_pageGroup;
1625     Ref<WebPreferences> m_preferences;
1626
1627     WebProcessLifetimeTracker m_webProcessLifetimeTracker { *this };
1628
1629     Ref<WebUserContentControllerProxy> m_userContentController;
1630     Ref<VisitedLinkStore> m_visitedLinkStore;
1631     Ref<WebsiteDataStore> m_websiteDataStore;
1632
1633     RefPtr<WebFrameProxy> m_mainFrame;
1634     RefPtr<WebFrameProxy> m_focusedFrame;
1635     RefPtr<WebFrameProxy> m_frameSetLargestFrame;
1636
1637     String m_userAgent;
1638     String m_applicationNameForUserAgent;
1639     String m_customUserAgent;
1640     String m_customTextEncodingName;
1641
1642     bool m_treatsSHA1CertificatesAsInsecure;
1643
1644     RefPtr<WebInspectorProxy> m_inspector;
1645
1646 #if ENABLE(FULLSCREEN_API)
1647     RefPtr<WebFullScreenManagerProxy> m_fullScreenManager;
1648     std::unique_ptr<API::FullscreenClient> m_fullscreenClient;
1649 #endif
1650 #if (PLATFORM(IOS) && HAVE(AVKIT)) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
1651     RefPtr<WebPlaybackSessionManagerProxy> m_playbackSessionManager;
1652     RefPtr<WebVideoFullscreenManagerProxy> m_videoFullscreenManager;
1653 #endif
1654 #if PLATFORM(IOS)
1655     VisibleContentRectUpdateInfo m_lastVisibleContentRectUpdate;
1656     bool m_hasReceivedLayerTreeTransactionAfterDidCommitLoad;
1657     uint64_t m_firstLayerTreeTransactionIdAfterDidCommitLoad;
1658     int32_t m_deviceOrientation;
1659     bool m_dynamicViewportSizeUpdateWaitingForTarget;
1660     bool m_dynamicViewportSizeUpdateWaitingForLayerTreeCommit;
1661     uint64_t m_dynamicViewportSizeUpdateLayerTreeTransactionID;
1662     uint64_t m_layerTreeTransactionIdAtLastTouchStart;
1663     uint64_t m_currentDynamicViewportSizeUpdateID { 0 };
1664     bool m_hasNetworkRequestsOnSuspended;
1665     bool m_isKeyboardAnimatingIn { false };
1666     bool m_isScrollingOrZooming { false };
1667 #endif
1668
1669 #if ENABLE(VIBRATION)
1670     RefPtr<WebVibrationProxy> m_vibration;
1671 #endif
1672
1673 #if ENABLE(APPLE_PAY)
1674     std::unique_ptr<WebPaymentCoordinatorProxy> m_paymentCoordinator;
1675 #endif
1676
1677     CallbackMap m_callbacks;
1678     HashSet<uint64_t> m_loadDependentStringCallbackIDs;
1679
1680     HashSet<WebEditCommandProxy*> m_editCommandSet;
1681
1682 #if PLATFORM(COCOA)
1683     HashSet<String> m_knownKeypressCommandNames;
1684 #endif
1685
1686     RefPtr<WebPopupMenuProxy> m_activePopupMenu;
1687 #if ENABLE(CONTEXT_MENUS)
1688     std::unique_ptr<WebContextMenuProxy> m_activeContextMenu;
1689     ContextMenuContextData m_activeContextMenuContextData;
1690 #endif
1691     RefPtr<API::HitTestResult> m_lastMouseMoveHitTestResult;
1692
1693     RefPtr<WebOpenPanelResultListenerProxy> m_openPanelResultListener;
1694     GeolocationPermissionRequestManagerProxy m_geolocationPermissionRequestManager;
1695     NotificationPermissionRequestManagerProxy m_notificationPermissionRequestManager;
1696
1697 #if ENABLE(MEDIA_STREAM)
1698     std::unique_ptr<UserMediaPermissionRequestManagerProxy> m_userMediaPermissionRequestManager;
1699 #endif
1700
1701     WebCore::ActivityState::Flags m_activityState;
1702     bool m_viewWasEverInWindow;
1703 #if PLATFORM(IOS)
1704     bool m_allowsMediaDocumentInlinePlayback { false };
1705     bool m_alwaysRunsAtForegroundPriority;
1706     ProcessThrottler::ForegroundActivityToken m_activityToken;
1707 #endif
1708     bool m_initialCapitalizationEnabled;
1709     Ref<WebBackForwardList> m_backForwardList;
1710         
1711     bool m_maintainsInactiveSelection;
1712
1713     bool m_waitsForPaintAfterViewDidMoveToWindow;
1714
1715     String m_toolTip;
1716
1717     EditorState m_editorState;
1718     bool m_isEditable;
1719
1720     double m_textZoomFactor;
1721     double m_pageZoomFactor;
1722     double m_pageScaleFactor;
1723     double m_pluginZoomFactor;
1724     double m_pluginScaleFactor;
1725     double m_viewScaleFactor { 1 };
1726     float m_intrinsicDeviceScaleFactor;
1727     float m_customDeviceScaleFactor;
1728     float m_topContentInset;
1729
1730     LayerHostingMode m_layerHostingMode;
1731
1732     bool m_drawsBackground;
1733
1734     WebCore::Color m_underlayColor;
1735     WebCore::Color m_pageExtendedBackgroundColor;
1736
1737     bool m_useFixedLayout;
1738     WebCore::IntSize m_fixedLayoutSize;
1739
1740     WebCore::LayoutMilestones m_observedLayoutMilestones { 0 };
1741
1742     bool m_suppressScrollbarAnimations;
1743
1744     WebCore::Pagination::Mode m_paginationMode;
1745     bool m_paginationBehavesLikeColumns;
1746     double m_pageLength;
1747     double m_gapBetweenPages;
1748     bool m_paginationLineGridEnabled;
1749         
1750     // If the process backing the web page is alive and kicking.
1751     bool m_isValid;
1752
1753     // Whether WebPageProxy::close() has been called on this page.
1754     bool m_isClosed;
1755
1756     // Whether it can run modal child web pages.
1757     bool m_canRunModal;
1758
1759     bool m_needsToFinishInitializingWebPageAfterProcessLaunch { false };
1760
1761     bool m_isInPrintingMode;
1762     bool m_isPerformingDOMPrintOperation;
1763
1764     bool m_inDecidePolicyForResponseSync;
1765     const WebCore::ResourceRequest* m_decidePolicyForResponseRequest;
1766     bool m_syncMimeTypePolicyActionIsValid;
1767     WebCore::PolicyAction m_syncMimeTypePolicyAction;
1768     DownloadID m_syncMimeTypePolicyDownloadID;
1769
1770     bool m_inDecidePolicyForNavigationAction;
1771     bool m_syncNavigationActionPolicyActionIsValid;
1772     WebCore::PolicyAction m_syncNavigationActionPolicyAction;
1773     DownloadID m_syncNavigationActionPolicyDownloadID;
1774     WebsitePolicies m_syncNavigationActionPolicyWebsitePolicies;
1775     bool m_shouldSuppressAppLinksInNextNavigationPolicyDecision { false };
1776
1777     Deque<NativeWebKeyboardEvent> m_keyEventQueue;
1778     Deque<NativeWebWheelEvent> m_wheelEventQueue;
1779     Deque<std::unique_ptr<Vector<NativeWebWheelEvent>>> m_currentlyProcessedWheelEvents;
1780 #if ENABLE(MAC_GESTURE_EVENTS)
1781     Deque<NativeWebGestureEvent> m_gestureEventQueue;
1782 #endif
1783
1784     bool m_processingMouseMoveEvent;
1785     std::unique_ptr<NativeWebMouseEvent> m_nextMouseMoveEvent;
1786     std::unique_ptr<NativeWebMouseEvent> m_currentlyProcessedMouseDownEvent;
1787
1788 #if ENABLE(TOUCH_EVENTS)
1789     struct TouchEventTracking {
1790         WebCore::TrackingType touchForceChangedTracking { WebCore::TrackingType::NotTracking };
1791         WebCore::TrackingType touchStartTracking { WebCore::TrackingType::NotTracking };
1792         WebCore::TrackingType touchMoveTracking { WebCore::TrackingType::NotTracking };
1793         WebCore::TrackingType touchEndTracking { WebCore::TrackingType::NotTracking };
1794
1795         bool isTrackingAnything() const
1796         {
1797             return touchForceChangedTracking != WebCore::TrackingType::NotTracking
1798                 || touchStartTracking != WebCore::TrackingType::NotTracking
1799                 || touchMoveTracking != WebCore::TrackingType::NotTracking
1800                 || touchEndTracking != WebCore::TrackingType::NotTracking;
1801         }
1802
1803         void reset()
1804         {
1805             touchForceChangedTracking = WebCore::TrackingType::NotTracking;
1806             touchStartTracking = WebCore::TrackingType::NotTracking;
1807             touchMoveTracking = WebCore::TrackingType::NotTracking;
1808             touchEndTracking = WebCore::TrackingType::NotTracking;
1809         }
1810     };
1811     TouchEventTracking m_touchEventTracking;
1812 #endif
1813 #if ENABLE(TOUCH_EVENTS) && !ENABLE(IOS_TOUCH_EVENTS)
1814     Deque<QueuedTouchEvents> m_touchEventQueue;
1815 #endif
1816
1817 #if ENABLE(INPUT_TYPE_COLOR)
1818     RefPtr<WebColorPicker> m_colorPicker;
1819 #endif
1820 #if PLATFORM(COCOA)
1821     std::unique_ptr<WebCore::ValidationBubble> m_validationBubble;
1822 #endif
1823
1824     const uint64_t m_pageID;
1825     const WebCore::SessionID m_sessionID;
1826
1827     bool m_isPageSuspended;
1828     bool m_addsVisitedLinks;
1829
1830     bool m_controlledByAutomation { false };
1831
1832 #if ENABLE(REMOTE_INSPECTOR)
1833     bool m_allowsRemoteInspection;
1834     String m_remoteInspectionNameOverride;
1835 #endif
1836
1837 #if PLATFORM(COCOA)
1838     bool m_isSmartInsertDeleteEnabled;
1839 #endif
1840
1841 #if PLATFORM(GTK)
1842     String m_accessibilityPlugID;
1843     WebCore::Color m_backgroundColor;
1844 #endif
1845
1846     int64_t m_spellDocumentTag;
1847     bool m_hasSpellDocumentTag;
1848     unsigned m_pendingLearnOrIgnoreWordMessageCount;
1849
1850     bool m_mainFrameHasCustomContentProvider;
1851
1852 #if ENABLE(DRAG_SUPPORT)
1853     // Current drag destination details are delivered as an asynchronous response,
1854     // so we preserve them to be used when the next dragging delegate call is made.
1855     WebCore::DragOperation m_currentDragOperation;
1856     bool m_currentDragIsOverFileInput;
1857     unsigned m_currentDragNumberOfFilesToBeAccepted;
1858 #endif
1859
1860     PageLoadState m_pageLoadState;
1861     
1862     bool m_delegatesScrolling;
1863
1864     bool m_mainFrameHasHorizontalScrollbar;
1865     bool m_mainFrameHasVerticalScrollbar;
1866
1867     // Whether horizontal wheel events can be handled directly for swiping purposes.
1868     bool m_canShortCircuitHorizontalWheelEvents;
1869
1870     bool m_mainFrameIsPinnedToLeftSide;
1871     bool m_mainFrameIsPinnedToRightSide;
1872     bool m_mainFrameIsPinnedToTopSide;
1873     bool m_mainFrameIsPinnedToBottomSide;
1874
1875     bool m_shouldUseImplicitRubberBandControl;
1876     bool m_rubberBandsAtLeft;
1877     bool m_rubberBandsAtRight;
1878     bool m_rubberBandsAtTop;
1879     bool m_rubberBandsAtBottom;
1880         
1881     bool m_enableVerticalRubberBanding;
1882     bool m_enableHorizontalRubberBanding;
1883
1884     bool m_backgroundExtendsBeyondPage;
1885
1886     bool m_shouldRecordNavigationSnapshots;
1887     bool m_isShowingNavigationGestureSnapshot;
1888
1889     bool m_mainFramePluginHandlesPageScaleGesture { false };
1890
1891     unsigned m_pageCount;
1892
1893     WebCore::IntRect m_visibleScrollerThumbRect;
1894
1895     uint64_t m_renderTreeSize;
1896     uint64_t m_sessionRestorationRenderTreeSize;
1897     bool m_hitRenderTreeSizeThreshold;
1898
1899     bool m_suppressVisibilityUpdates;
1900     bool m_autoSizingShouldExpandToViewHeight;
1901     WebCore::IntSize m_minimumLayoutSize;
1902
1903     // Visual viewports
1904     WebCore::LayoutSize m_baseLayoutViewportSize;
1905     WebCore::LayoutPoint m_minStableLayoutViewportOrigin;
1906     WebCore::LayoutPoint m_maxStableLayoutViewportOrigin;
1907
1908     float m_mediaVolume;
1909     WebCore::MediaProducer::MutedStateFlags m_mutedState { WebCore::MediaProducer::NoneMuted };
1910     bool m_mayStartMediaWhenInWindow;
1911
1912     bool m_waitingForDidUpdateActivityState;
1913
1914     bool m_shouldScaleViewToFitDocument { false };
1915     bool m_suppressAutomaticNavigationSnapshotting { false };
1916
1917 #if PLATFORM(COCOA)
1918     HashMap<String, String> m_temporaryPDFFiles;
1919     std::unique_ptr<WebCore::RunLoopObserver> m_activityStateChangeDispatcher;
1920
1921     std::unique_ptr<RemoteLayerTreeScrollingPerformanceData> m_scrollingPerformanceData;
1922     bool m_scrollPerformanceDataCollectionEnabled;
1923 #endif
1924     UserObservablePageCounter::Token m_pageIsUserObservableCount;
1925     ProcessSuppressionDisabledToken m_preventProcessSuppressionCount;
1926     HiddenPageThrottlingAutoIncreasesCounter::Token m_hiddenPageDOMTimerThrottlingAutoIncreasesCount;
1927         
1928     WebCore::ScrollPinningBehavior m_scrollPinningBehavior;
1929     std::optional<WebCore::ScrollbarOverlayStyle> m_scrollbarOverlayStyle;
1930
1931     uint64_t m_navigationID;
1932
1933     WebPreferencesStore::ValueMap m_configurationPreferenceValues;
1934     WebCore::ActivityState::Flags m_potentiallyChangedActivityStateFlags;
1935     bool m_activityStateChangeWantsSynchronousReply;
1936     Vector<uint64_t> m_nextActivityStateChangeCallbacks;
1937
1938     WebCore::MediaProducer::MediaStateFlags m_mediaState { WebCore::MediaProducer::IsNotPlaying };
1939
1940     bool m_isResourceCachingDisabled { false };
1941
1942     bool m_hasHadSelectionChangesFromUserInteraction { false };
1943     bool m_needsHiddenContentEditableQuirk { false };
1944     bool m_needsPlainTextQuirk { false };
1945
1946 #if ENABLE(MEDIA_SESSION)
1947     bool m_hasMediaSessionWithActiveMediaElements { false };
1948 #endif
1949
1950 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
1951     bool m_requiresTargetMonitoring { false };
1952 #endif
1953
1954 #if PLATFORM(IOS)
1955     bool m_hasDeferredStartAssistingNode { false };
1956     std::unique_ptr<NodeAssistanceArguments> m_deferredNodeAssistanceArguments;
1957     bool m_forceAlwaysUserScalable { false };
1958 #endif
1959
1960 #if ENABLE(POINTER_LOCK)
1961     bool m_isPointerLockPending { false };
1962     bool m_isPointerLocked { false };
1963 #endif
1964
1965 #if ENABLE(DOWNLOAD_ATTRIBUTE)
1966     bool m_syncNavigationActionHasDownloadAttribute { false };
1967 #endif
1968         
1969     WeakPtrFactory<WebPageProxy> m_weakPtrFactory;
1970 };
1971
1972 } // namespace WebKit