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