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