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