/* * Copyright (C) 2006 Eric Seidel * Copyright (C) 2008-2019 Apple Inc. All rights reserved. * Copyright (C) Research In Motion Limited 2011. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "config.h" #include "EmptyClients.h" #include "AppHighlight.h" #include "ApplicationCacheStorage.h" #include "BackForwardClient.h" #include "BroadcastChannelRegistry.h" #include "CacheStorageProvider.h" #include "ColorChooser.h" #include "ContextMenuClient.h" #include "CookieJar.h" #include "DOMPasteAccess.h" #include "DataListSuggestionPicker.h" #include "DatabaseProvider.h" #include "DateTimeChooser.h" #include "DiagnosticLoggingClient.h" #include "DisplayRefreshMonitorFactory.h" #include "DocumentFragment.h" #include "DocumentLoader.h" #include "DragClient.h" #include "DummySpeechRecognitionProvider.h" #include "EditorClient.h" #include "EmptyFrameLoaderClient.h" #include "FileChooser.h" #include "FormState.h" #include "Frame.h" #include "FrameLoaderClient.h" #include "FrameNetworkingContext.h" #include "HTMLFormElement.h" #include "HistoryItem.h" #include "IDBConnectionToServer.h" #include "InspectorClient.h" #include "LibWebRTCProvider.h" #include "MediaRecorderPrivate.h" #include "MediaRecorderProvider.h" #include "NetworkStorageSession.h" #include "Page.h" #include "PageConfiguration.h" #include "PaymentCoordinatorClient.h" #include "PluginInfoProvider.h" #include "ProgressTrackerClient.h" #include "SecurityOriginData.h" #include "SocketProvider.h" #include "StorageArea.h" #include "StorageNamespace.h" #include "StorageNamespaceProvider.h" #include "StorageType.h" #include "TextCheckerClient.h" #include "ThreadableWebSocketChannel.h" #include "UserContentProvider.h" #include "VisitedLinkStore.h" #include #include #include #if ENABLE(CONTENT_EXTENSIONS) #include "CompiledContentExtension.h" #endif #if USE(QUICK_LOOK) #include "LegacyPreviewLoaderClient.h" #endif #if ENABLE(DATE_AND_TIME_INPUT_TYPES) #include "DateTimeChooser.h" #endif namespace WebCore { class UserMessageHandlerDescriptor; class EmptyBackForwardClient final : public BackForwardClient { void addItem(Ref&&) final { } void goToItem(HistoryItem&) final { } RefPtr itemAtIndex(int) final { return nullptr; } unsigned backListCount() const final { return 0; } unsigned forwardListCount() const final { return 0; } void close() final { } }; #if ENABLE(CONTEXT_MENUS) class EmptyContextMenuClient final : public ContextMenuClient { void contextMenuDestroyed() final { } void downloadURL(const URL&) final { } void searchWithGoogle(const Frame*) final { } void lookUpInDictionary(Frame*) final { } bool isSpeaking() final { return false; } void speak(const String&) final { } void stopSpeaking() final { } #if PLATFORM(COCOA) void searchWithSpotlight() final { } #endif #if HAVE(TRANSLATION_UI_SERVICES) void handleTranslation(const TranslationContextMenuInfo&) final { } #endif #if PLATFORM(GTK) void insertEmoji(Frame&) final { } #endif #if USE(ACCESSIBILITY_CONTEXT_MENUS) void showContextMenu() final { } #endif #if ENABLE(IMAGE_ANALYSIS) bool supportsLookUpInImages() final { return false; } #endif }; #endif // ENABLE(CONTEXT_MENUS) class EmptyDisplayRefreshMonitor final : public DisplayRefreshMonitor { public: static Ref create(PlatformDisplayID displayID) { return adoptRef(*new EmptyDisplayRefreshMonitor(displayID)); } void displayLinkFired(const DisplayUpdate&) final { } bool requestRefreshCallback() final { return false; } void stop() final { } bool startNotificationMechanism() final { return true; } void stopNotificationMechanism() final { } private: explicit EmptyDisplayRefreshMonitor(PlatformDisplayID displayID) : DisplayRefreshMonitor(displayID) { } }; class EmptyDisplayRefreshMonitorFactory final : public DisplayRefreshMonitorFactory { public: static DisplayRefreshMonitorFactory* sharedEmptyDisplayRefreshMonitorFactory() { static NeverDestroyed emptyFactory; return &emptyFactory.get(); } private: RefPtr createDisplayRefreshMonitor(PlatformDisplayID displayID) final { return EmptyDisplayRefreshMonitor::create(displayID); } }; class EmptyDatabaseProvider final : public DatabaseProvider { struct EmptyIDBConnectionToServerDeletegate final : public IDBClient::IDBConnectionToServerDelegate { IDBConnectionIdentifier identifier() const final { return { }; } void deleteDatabase(const IDBRequestData&) final { } void openDatabase(const IDBRequestData&) final { } void abortTransaction(const IDBResourceIdentifier&) final { } void commitTransaction(const IDBResourceIdentifier&, uint64_t) final { } void didFinishHandlingVersionChangeTransaction(uint64_t, const IDBResourceIdentifier&) final { } void createObjectStore(const IDBRequestData&, const IDBObjectStoreInfo&) final { } void deleteObjectStore(const IDBRequestData&, const String&) final { } void renameObjectStore(const IDBRequestData&, uint64_t, const String&) final { } void clearObjectStore(const IDBRequestData&, uint64_t) final { } void createIndex(const IDBRequestData&, const IDBIndexInfo&) final { } void deleteIndex(const IDBRequestData&, uint64_t, const String&) final { } void renameIndex(const IDBRequestData&, uint64_t, uint64_t, const String&) final { } void putOrAdd(const IDBRequestData&, const IDBKeyData&, const IDBValue&, const IndexedDB::ObjectStoreOverwriteMode) final { } void getRecord(const IDBRequestData&, const IDBGetRecordData&) final { } void getAllRecords(const IDBRequestData&, const IDBGetAllRecordsData&) final { } void getCount(const IDBRequestData&, const IDBKeyRangeData&) final { } void deleteRecord(const IDBRequestData&, const IDBKeyRangeData&) final { } void openCursor(const IDBRequestData&, const IDBCursorInfo&) final { } void iterateCursor(const IDBRequestData&, const IDBIterateCursorData&) final { } void establishTransaction(uint64_t, const IDBTransactionInfo&) final { } void databaseConnectionPendingClose(uint64_t) final { } void databaseConnectionClosed(uint64_t) final { } void abortOpenAndUpgradeNeeded(uint64_t, const IDBResourceIdentifier&) final { } void didFireVersionChangeEvent(uint64_t, const IDBResourceIdentifier&, const IndexedDB::ConnectionClosedOnBehalfOfServer) final { } void openDBRequestCancelled(const IDBRequestData&) final { } void getAllDatabaseNamesAndVersions(const IDBResourceIdentifier&, const ClientOrigin&) final { } ~EmptyIDBConnectionToServerDeletegate() { } }; IDBClient::IDBConnectionToServer& idbConnectionToServerForSession(PAL::SessionID) final { static NeverDestroyed emptyDelegate; static auto& emptyConnection = IDBClient::IDBConnectionToServer::create(emptyDelegate.get()).leakRef(); return emptyConnection; } }; class EmptyDiagnosticLoggingClient final : public DiagnosticLoggingClient { void logDiagnosticMessage(const String&, const String&, ShouldSample) final { } void logDiagnosticMessageWithResult(const String&, const String&, DiagnosticLoggingResultType, ShouldSample) final { } void logDiagnosticMessageWithValue(const String&, const String&, double, unsigned, ShouldSample) final { } void logDiagnosticMessageWithEnhancedPrivacy(const String&, const String&, ShouldSample) final { } void logDiagnosticMessageWithValueDictionary(const String&, const String&, const ValueDictionary&, ShouldSample) final { } void logDiagnosticMessageWithDomain(const String&, DiagnosticLoggingDomain) final { }; }; #if ENABLE(DRAG_SUPPORT) class EmptyDragClient final : public DragClient { void willPerformDragDestinationAction(DragDestinationAction, const DragData&) final { } void willPerformDragSourceAction(DragSourceAction, const IntPoint&, DataTransfer&) final { } OptionSet dragSourceActionMaskForPoint(const IntPoint&) final { return { }; } void startDrag(DragItem, DataTransfer&, Frame&) final { } }; #endif // ENABLE(DRAG_SUPPORT) class EmptyEditorClient final : public EditorClient { WTF_MAKE_FAST_ALLOCATED; public: EmptyEditorClient() = default; private: bool shouldDeleteRange(const std::optional&) final { return false; } bool smartInsertDeleteEnabled() final { return false; } bool isSelectTrailingWhitespaceEnabled() const final { return false; } bool isContinuousSpellCheckingEnabled() final { return false; } void toggleContinuousSpellChecking() final { } bool isGrammarCheckingEnabled() final { return false; } void toggleGrammarChecking() final { } int spellCheckerDocumentTag() final { return -1; } bool shouldBeginEditing(const SimpleRange&) final { return false; } bool shouldEndEditing(const SimpleRange&) final { return false; } bool shouldInsertNode(Node&, const std::optional&, EditorInsertAction) final { return false; } bool shouldInsertText(const String&, const std::optional&, EditorInsertAction) final { return false; } bool shouldChangeSelectedRange(const std::optional&, const std::optional&, Affinity, bool) final { return false; } bool shouldApplyStyle(const StyleProperties&, const std::optional&) final { return false; } void didApplyStyle() final { } bool shouldMoveRangeAfterDelete(const SimpleRange&, const SimpleRange&) final { return false; } void didBeginEditing() final { } void respondToChangedContents() final { } void respondToChangedSelection(Frame*) final { } void updateEditorStateAfterLayoutIfEditabilityChanged() final { } void discardedComposition(Frame*) final { } void canceledComposition() final { } void didUpdateComposition() final { } void didEndEditing() final { } void didEndUserTriggeredSelectionChanges() final { } void willWriteSelectionToPasteboard(const std::optional&) final { } void didWriteSelectionToPasteboard() final { } void getClientPasteboardData(const std::optional&, Vector&, Vector>&) final { } void requestCandidatesForSelection(const VisibleSelection&) final { } void handleAcceptedCandidateWithSoftSpaces(TextCheckingResult) final { } void registerUndoStep(UndoStep&) final; void registerRedoStep(UndoStep&) final; void clearUndoRedoOperations() final { } DOMPasteAccessResponse requestDOMPasteAccess(const String&) final { return DOMPasteAccessResponse::DeniedForGesture; } bool canCopyCut(Frame*, bool defaultValue) const final { return defaultValue; } bool canPaste(Frame*, bool defaultValue) const final { return defaultValue; } bool canUndo() const final { return false; } bool canRedo() const final { return false; } void undo() final { } void redo() final { } void handleKeyboardEvent(KeyboardEvent&) final { } void handleInputMethodKeydown(KeyboardEvent&) final { } void textFieldDidBeginEditing(Element*) final { } void textFieldDidEndEditing(Element*) final { } void textDidChangeInTextField(Element*) final { } bool doTextFieldCommandFromEvent(Element*, KeyboardEvent*) final { return false; } void textWillBeDeletedInTextField(Element*) final { } void textDidChangeInTextArea(Element*) final { } void overflowScrollPositionChanged() final { } void subFrameScrollPositionChanged() final { } #if PLATFORM(IOS_FAMILY) void startDelayingAndCoalescingContentChangeNotifications() final { } void stopDelayingAndCoalescingContentChangeNotifications() final { } bool hasRichlyEditableSelection() final { return false; } int getPasteboardItemsCount() final { return 0; } RefPtr documentFragmentFromDelegate(int) final { return nullptr; } bool performsTwoStepPaste(DocumentFragment*) final { return false; } void updateStringForFind(const String&) final { } #endif bool performTwoStepDrop(DocumentFragment&, const SimpleRange&, bool) final { return false; } #if PLATFORM(COCOA) void setInsertionPasteboard(const String&) final { }; #endif #if USE(APPKIT) void uppercaseWord() final { } void lowercaseWord() final { } void capitalizeWord() final { } #endif #if USE(AUTOMATIC_TEXT_REPLACEMENT) void showSubstitutionsPanel(bool) final { } bool substitutionsPanelIsShowing() final { return false; } void toggleSmartInsertDelete() final { } bool isAutomaticQuoteSubstitutionEnabled() final { return false; } void toggleAutomaticQuoteSubstitution() final { } bool isAutomaticLinkDetectionEnabled() final { return false; } void toggleAutomaticLinkDetection() final { } bool isAutomaticDashSubstitutionEnabled() final { return false; } void toggleAutomaticDashSubstitution() final { } bool isAutomaticTextReplacementEnabled() final { return false; } void toggleAutomaticTextReplacement() final { } bool isAutomaticSpellingCorrectionEnabled() final { return false; } void toggleAutomaticSpellingCorrection() final { } #endif #if PLATFORM(GTK) bool shouldShowUnicodeMenu() final { return false; } #endif TextCheckerClient* textChecker() final { return &m_textCheckerClient; } void updateSpellingUIWithGrammarString(const String&, const GrammarDetail&) final { } void updateSpellingUIWithMisspelledWord(const String&) final { } void showSpellingUI(bool) final { } bool spellingUIIsShowing() final { return false; } void willSetInputMethodState() final { } void setInputMethodState(Element*) final { } bool canShowFontPanel() const final { return false; } class EmptyTextCheckerClient final : public TextCheckerClient { bool shouldEraseMarkersAfterChangeSelection(TextCheckingType) const final { return true; } void ignoreWordInSpellDocument(const String&) final { } void learnWord(const String&) final { } void checkSpellingOfString(StringView, int*, int*) final { } String getAutoCorrectSuggestionForMisspelledWord(const String&) final { return { }; } void checkGrammarOfString(StringView, Vector&, int*, int*) final { } #if USE(UNIFIED_TEXT_CHECKING) Vector checkTextOfParagraph(StringView, OptionSet, const VisibleSelection&) final { return Vector(); } #endif void getGuessesForWord(const String&, const String&, const VisibleSelection&, Vector&) final { } void requestCheckingOfString(TextCheckingRequest&, const VisibleSelection&) final; }; EmptyTextCheckerClient m_textCheckerClient; }; class EmptyFrameNetworkingContext final : public FrameNetworkingContext { public: static Ref create() { return adoptRef(*new EmptyFrameNetworkingContext); } private: EmptyFrameNetworkingContext(); bool shouldClearReferrerOnHTTPSToHTTPRedirect() const { return true; } NetworkStorageSession* storageSession() const final { return nullptr; } #if PLATFORM(COCOA) bool localFileContentSniffingEnabled() const { return false; } SchedulePairHashSet* scheduledRunLoopPairs() const { return nullptr; } RetainPtr sourceApplicationAuditData() const { return nullptr; }; #endif #if PLATFORM(COCOA) || PLATFORM(WIN) ResourceError blockedError(const ResourceRequest&) const final { return { }; } #endif }; class EmptyInspectorClient final : public InspectorClient { void inspectedPageDestroyed() final { } Inspector::FrontendChannel* openLocalFrontend(InspectorController*) final { return nullptr; } void bringFrontendToFront() final { } void highlight() final { } void hideHighlight() final { } }; #if ENABLE(APPLE_PAY) class EmptyPaymentCoordinatorClient final : public PaymentCoordinatorClient { std::optional validatedPaymentNetwork(const String&) final { return std::nullopt; } bool canMakePayments() final { return false; } void canMakePaymentsWithActiveCard(const String&, const String&, CompletionHandler&& completionHandler) final { callOnMainThread([completionHandler = WTFMove(completionHandler)]() mutable { completionHandler(false); }); } void openPaymentSetup(const String&, const String&, CompletionHandler&& completionHandler) final { callOnMainThread([completionHandler = WTFMove(completionHandler)]() mutable { completionHandler(false); }); } bool showPaymentUI(const URL&, const Vector&, const ApplePaySessionPaymentRequest&) final { return false; } void completeMerchantValidation(const PaymentMerchantSession&) final { } void completeShippingMethodSelection(std::optional&&) final { } void completeShippingContactSelection(std::optional&&) final { } void completePaymentMethodSelection(std::optional&&) final { } #if ENABLE(APPLE_PAY_COUPON_CODE) void completeCouponCodeChange(std::optional&&) final { } #endif void completePaymentSession(std::optional&&) final { } void cancelPaymentSession() final { } void abortPaymentSession() final { } void paymentCoordinatorDestroyed() final { } bool supportsUnrestrictedApplePay() const final { return false; } }; #endif class EmptyPluginInfoProvider final : public PluginInfoProvider { void refreshPlugins() final { }; Vector pluginInfo(Page&, std::optional>&) final { return { }; } Vector webVisiblePluginInfo(Page&, const URL&) final { return { }; } }; class EmptyPopupMenu : public PopupMenu { public: EmptyPopupMenu() = default; private: void show(const IntRect&, FrameView*, int) final { } void hide() final { } void updateFromElement() final { } void disconnectClient() final { } }; class EmptyProgressTrackerClient final : public ProgressTrackerClient { void willChangeEstimatedProgress() final { } void didChangeEstimatedProgress() final { } void progressStarted(Frame&) final { } void progressEstimateChanged(Frame&) final { } void progressFinished(Frame&) final { } }; class EmptySearchPopupMenu : public SearchPopupMenu { public: EmptySearchPopupMenu() : m_popup(adoptRef(*new EmptyPopupMenu)) { } private: PopupMenu* popupMenu() final { return m_popup.ptr(); } void saveRecentSearches(const AtomString&, const Vector&) final { } void loadRecentSearches(const AtomString&, Vector&) final { } bool enabled() final { return false; } Ref m_popup; }; class EmptyStorageNamespaceProvider final : public StorageNamespaceProvider { struct EmptyStorageArea : public StorageArea { unsigned length() final { return 0; } String key(unsigned) final { return { }; } String item(const String&) final { return { }; } void setItem(Frame*, const String&, const String&, bool&) final { } void removeItem(Frame*, const String&) final { } void clear(Frame*) final { } bool contains(const String&) final { return false; } StorageType storageType() const final { return StorageType::Local; } size_t memoryBytesUsedByCache() final { return 0; } }; struct EmptyStorageNamespace final : public StorageNamespace { explicit EmptyStorageNamespace(PAL::SessionID sessionID) : m_sessionID(sessionID) { } private: Ref storageArea(const SecurityOriginData&) final { return adoptRef(*new EmptyStorageArea); } Ref copy(Page&) final { return adoptRef(*new EmptyStorageNamespace { m_sessionID }); } PAL::SessionID sessionID() const final { return m_sessionID; } void setSessionIDForTesting(PAL::SessionID sessionID) final { m_sessionID = sessionID; }; PAL::SessionID m_sessionID; }; Ref createSessionStorageNamespace(Page&, unsigned) final; Ref createLocalStorageNamespace(unsigned, PAL::SessionID) final; Ref createTransientLocalStorageNamespace(SecurityOrigin&, unsigned, PAL::SessionID) final; }; class EmptyUserContentProvider final : public UserContentProvider { void forEachUserScript(Function&&) const final { } void forEachUserStyleSheet(Function&&) const final { } #if ENABLE(USER_MESSAGE_HANDLERS) void forEachUserMessageHandler(Function&&) const final { } #endif #if ENABLE(CONTENT_EXTENSIONS) ContentExtensions::ContentExtensionsBackend& userContentExtensionBackend() final { static NeverDestroyed backend; return backend.get(); }; #endif }; class EmptyVisitedLinkStore final : public VisitedLinkStore { bool isLinkVisited(Page&, SharedStringHash, const URL&, const AtomString&) final { return false; } void addVisitedLink(Page&, SharedStringHash) final { } }; RefPtr EmptyChromeClient::createPopupMenu(PopupMenuClient&) const { return adoptRef(*new EmptyPopupMenu); } RefPtr EmptyChromeClient::createSearchPopupMenu(PopupMenuClient&) const { return adoptRef(*new EmptySearchPopupMenu); } #if ENABLE(INPUT_TYPE_COLOR) std::unique_ptr EmptyChromeClient::createColorChooser(ColorChooserClient&, const Color&) { return nullptr; } #endif #if ENABLE(DATALIST_ELEMENT) std::unique_ptr EmptyChromeClient::createDataListSuggestionPicker(DataListSuggestionsClient&) { return nullptr; } #endif #if ENABLE(DATE_AND_TIME_INPUT_TYPES) std::unique_ptr EmptyChromeClient::createDateTimeChooser(DateTimeChooserClient&) { return nullptr; } #endif #if ENABLE(APP_HIGHLIGHTS) void EmptyChromeClient::storeAppHighlight(AppHighlight&&) const { } #endif void EmptyChromeClient::setTextIndicator(const TextIndicatorData&) const { } DisplayRefreshMonitorFactory* EmptyChromeClient::displayRefreshMonitorFactory() const { return EmptyDisplayRefreshMonitorFactory::sharedEmptyDisplayRefreshMonitorFactory(); } void EmptyChromeClient::runOpenPanel(Frame&, FileChooser&) { } void EmptyChromeClient::showShareSheet(ShareDataWithParsedURL&, CompletionHandler&&) { } #if HAVE(ARKIT_INLINE_PREVIEW_IOS) void EmptyChromeClient::takeModelElementFullscreen(WebCore::GraphicsLayer::PlatformLayerID) const { } #endif #if HAVE(ARKIT_INLINE_PREVIEW_MAC) void EmptyChromeClient::modelElementDidCreatePreview(WebCore::HTMLModelElement&, const URL&, const String&, const WebCore::FloatSize&) const { } #endif void EmptyFrameLoaderClient::dispatchDecidePolicyForNewWindowAction(const NavigationAction&, const ResourceRequest&, FormState*, const String&, PolicyCheckIdentifier, FramePolicyFunction&&) { } void EmptyFrameLoaderClient::dispatchDecidePolicyForNavigationAction(const NavigationAction&, const ResourceRequest&, const ResourceResponse&, FormState*, PolicyDecisionMode, PolicyCheckIdentifier, FramePolicyFunction&&) { } void EmptyFrameLoaderClient::dispatchWillSendSubmitEvent(Ref&&) { } void EmptyFrameLoaderClient::dispatchWillSubmitForm(FormState&, CompletionHandler&& completionHandler) { completionHandler(); } Ref EmptyFrameLoaderClient::createDocumentLoader(const ResourceRequest& request, const SubstituteData& substituteData) { return DocumentLoader::create(request, substituteData); } RefPtr EmptyFrameLoaderClient::createFrame(const String&, HTMLFrameOwnerElement&) { return nullptr; } RefPtr EmptyFrameLoaderClient::createPlugin(const IntSize&, HTMLPlugInElement&, const URL&, const Vector&, const Vector&, const String&, bool) { return nullptr; } std::optional EmptyFrameLoaderClient::frameID() const { return std::nullopt; } std::optional EmptyFrameLoaderClient::pageID() const { return std::nullopt; } bool EmptyFrameLoaderClient::hasWebView() const { return true; // mainly for assertions } void EmptyFrameLoaderClient::makeRepresentation(DocumentLoader*) { } #if PLATFORM(IOS_FAMILY) bool EmptyFrameLoaderClient::forceLayoutOnRestoreFromBackForwardCache() { return false; } #endif void EmptyFrameLoaderClient::forceLayoutForNonHTML() { } void EmptyFrameLoaderClient::setCopiesOnScroll() { } void EmptyFrameLoaderClient::detachedFromParent2() { } void EmptyFrameLoaderClient::detachedFromParent3() { } void EmptyFrameLoaderClient::convertMainResourceLoadToDownload(DocumentLoader*, const ResourceRequest&, const ResourceResponse&) { } void EmptyFrameLoaderClient::assignIdentifierToInitialRequest(unsigned long, DocumentLoader*, const ResourceRequest&) { } bool EmptyFrameLoaderClient::shouldUseCredentialStorage(DocumentLoader*, unsigned long) { return false; } void EmptyFrameLoaderClient::dispatchWillSendRequest(DocumentLoader*, unsigned long, ResourceRequest&, const ResourceResponse&) { } void EmptyFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge(DocumentLoader*, unsigned long, const AuthenticationChallenge&) { } #if USE(PROTECTION_SPACE_AUTH_CALLBACK) bool EmptyFrameLoaderClient::canAuthenticateAgainstProtectionSpace(DocumentLoader*, unsigned long, const ProtectionSpace&) { return false; } #endif #if PLATFORM(IOS_FAMILY) RetainPtr EmptyFrameLoaderClient::connectionProperties(DocumentLoader*, unsigned long) { return nullptr; } #endif void EmptyFrameLoaderClient::dispatchDidReceiveResponse(DocumentLoader*, unsigned long, const ResourceResponse&) { } void EmptyFrameLoaderClient::dispatchDidReceiveContentLength(DocumentLoader*, unsigned long, int) { } void EmptyFrameLoaderClient::dispatchDidFinishLoading(DocumentLoader*, unsigned long) { } #if ENABLE(DATA_DETECTION) void EmptyFrameLoaderClient::dispatchDidFinishDataDetection(NSArray *) { } #endif void EmptyFrameLoaderClient::dispatchDidFailLoading(DocumentLoader*, unsigned long, const ResourceError&) { } bool EmptyFrameLoaderClient::dispatchDidLoadResourceFromMemoryCache(DocumentLoader*, const ResourceRequest&, const ResourceResponse&, int) { return false; } void EmptyFrameLoaderClient::dispatchDidDispatchOnloadEvents() { } void EmptyFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad() { } void EmptyFrameLoaderClient::dispatchDidCancelClientRedirect() { } void EmptyFrameLoaderClient::dispatchWillPerformClientRedirect(const URL&, double, WallTime, LockBackForwardList) { } void EmptyFrameLoaderClient::dispatchDidChangeLocationWithinPage() { } void EmptyFrameLoaderClient::dispatchDidPushStateWithinPage() { } void EmptyFrameLoaderClient::dispatchDidReplaceStateWithinPage() { } void EmptyFrameLoaderClient::dispatchDidPopStateWithinPage() { } void EmptyFrameLoaderClient::dispatchWillClose() { } void EmptyFrameLoaderClient::dispatchDidStartProvisionalLoad() { } void EmptyFrameLoaderClient::dispatchDidReceiveTitle(const StringWithDirection&) { } void EmptyFrameLoaderClient::dispatchDidCommitLoad(std::optional, std::optional) { } void EmptyFrameLoaderClient::dispatchDidFailProvisionalLoad(const ResourceError&, WillContinueLoading) { } void EmptyFrameLoaderClient::dispatchDidFailLoad(const ResourceError&) { } void EmptyFrameLoaderClient::dispatchDidFinishDocumentLoad() { } void EmptyFrameLoaderClient::dispatchDidFinishLoad() { } void EmptyFrameLoaderClient::dispatchDidReachLayoutMilestone(OptionSet) { } void EmptyFrameLoaderClient::dispatchDidReachVisuallyNonEmptyState() { } Frame* EmptyFrameLoaderClient::dispatchCreatePage(const NavigationAction&, NewFrameOpenerPolicy) { return nullptr; } void EmptyFrameLoaderClient::dispatchShow() { } void EmptyFrameLoaderClient::dispatchDecidePolicyForResponse(const ResourceResponse&, const ResourceRequest&, PolicyCheckIdentifier, const String&, FramePolicyFunction&&) { } void EmptyFrameLoaderClient::cancelPolicyCheck() { } void EmptyFrameLoaderClient::dispatchUnableToImplementPolicy(const ResourceError&) { } void EmptyFrameLoaderClient::revertToProvisionalState(DocumentLoader*) { } void EmptyFrameLoaderClient::setMainDocumentError(DocumentLoader*, const ResourceError&) { } void EmptyFrameLoaderClient::setMainFrameDocumentReady(bool) { } void EmptyFrameLoaderClient::startDownload(const ResourceRequest&, const String&) { } void EmptyFrameLoaderClient::willChangeTitle(DocumentLoader*) { } void EmptyFrameLoaderClient::didChangeTitle(DocumentLoader*) { } void EmptyFrameLoaderClient::willReplaceMultipartContent() { } void EmptyFrameLoaderClient::didReplaceMultipartContent() { } void EmptyFrameLoaderClient::committedLoad(DocumentLoader*, const uint8_t*, int) { } void EmptyFrameLoaderClient::finishedLoading(DocumentLoader*) { } ResourceError EmptyFrameLoaderClient::cancelledError(const ResourceRequest&) const { return { ResourceError::Type::Cancellation }; } ResourceError EmptyFrameLoaderClient::blockedError(const ResourceRequest&) const { return { }; } ResourceError EmptyFrameLoaderClient::blockedByContentBlockerError(const ResourceRequest&) const { return { }; } ResourceError EmptyFrameLoaderClient::cannotShowURLError(const ResourceRequest&) const { return { }; } ResourceError EmptyFrameLoaderClient::interruptedForPolicyChangeError(const ResourceRequest&) const { return { }; } #if ENABLE(CONTENT_FILTERING) ResourceError EmptyFrameLoaderClient::blockedByContentFilterError(const ResourceRequest&) const { return { }; } #endif ResourceError EmptyFrameLoaderClient::cannotShowMIMETypeError(const ResourceResponse&) const { return { }; } ResourceError EmptyFrameLoaderClient::fileDoesNotExistError(const ResourceResponse&) const { return { }; } ResourceError EmptyFrameLoaderClient::pluginWillHandleLoadError(const ResourceResponse&) const { return { }; } bool EmptyFrameLoaderClient::shouldFallBack(const ResourceError&) const { return false; } bool EmptyFrameLoaderClient::canHandleRequest(const ResourceRequest&) const { return false; } bool EmptyFrameLoaderClient::canShowMIMEType(const String&) const { return false; } bool EmptyFrameLoaderClient::canShowMIMETypeAsHTML(const String&) const { return false; } bool EmptyFrameLoaderClient::representationExistsForURLScheme(const String&) const { return false; } String EmptyFrameLoaderClient::generatedMIMETypeForURLScheme(const String&) const { return emptyString(); } void EmptyFrameLoaderClient::frameLoadCompleted() { } void EmptyFrameLoaderClient::restoreViewState() { } void EmptyFrameLoaderClient::provisionalLoadStarted() { } void EmptyFrameLoaderClient::didFinishLoad() { } void EmptyFrameLoaderClient::prepareForDataSourceReplacement() { } void EmptyFrameLoaderClient::updateCachedDocumentLoader(DocumentLoader&) { } void EmptyFrameLoaderClient::setTitle(const StringWithDirection&, const URL&) { } String EmptyFrameLoaderClient::userAgent(const URL&) const { return emptyString(); } void EmptyFrameLoaderClient::savePlatformDataToCachedFrame(CachedFrame*) { } void EmptyFrameLoaderClient::transitionToCommittedFromCachedFrame(CachedFrame*) { } #if PLATFORM(IOS_FAMILY) void EmptyFrameLoaderClient::didRestoreFrameHierarchyForCachedFrame() { } #endif void EmptyFrameLoaderClient::transitionToCommittedForNewPage() { } void EmptyFrameLoaderClient::didRestoreFromBackForwardCache() { } void EmptyFrameLoaderClient::updateGlobalHistory() { } void EmptyFrameLoaderClient::updateGlobalHistoryRedirectLinks() { } bool EmptyFrameLoaderClient::shouldGoToHistoryItem(HistoryItem&) const { return false; } void EmptyFrameLoaderClient::saveViewStateToItem(HistoryItem&) { } bool EmptyFrameLoaderClient::canCachePage() const { return false; } void EmptyFrameLoaderClient::didDisplayInsecureContent() { } void EmptyFrameLoaderClient::didRunInsecureContent(SecurityOrigin&, const URL&) { } void EmptyFrameLoaderClient::didDetectXSS(const URL&, bool) { } ObjectContentType EmptyFrameLoaderClient::objectContentType(const URL&, const String&) { return ObjectContentType::None; } String EmptyFrameLoaderClient::overrideMediaType() const { return { }; } void EmptyFrameLoaderClient::redirectDataToPlugin(Widget&) { } void EmptyFrameLoaderClient::dispatchDidClearWindowObjectInWorld(DOMWrapperWorld&) { } #if PLATFORM(COCOA) RemoteAXObjectRef EmptyFrameLoaderClient::accessibilityRemoteObject() { return nullptr; } void EmptyFrameLoaderClient::willCacheResponse(DocumentLoader*, unsigned long, NSCachedURLResponse *response, CompletionHandler&& completionHandler) const { completionHandler(response); } #endif #if USE(CFURLCONNECTION) bool EmptyFrameLoaderClient::shouldCacheResponse(DocumentLoader*, unsigned long, const ResourceResponse&, const unsigned char*, unsigned long long) { return true; } #endif bool EmptyFrameLoaderClient::isEmptyFrameLoaderClient() const { return true; } void EmptyFrameLoaderClient::prefetchDNS(const String&) { } #if USE(QUICK_LOOK) RefPtr EmptyFrameLoaderClient::createPreviewLoaderClient(const String&, const String&) { return nullptr; } #endif #if ENABLE(RESOURCE_LOAD_STATISTICS) bool EmptyFrameLoaderClient::hasFrameSpecificStorageAccess() { return false; } #endif inline EmptyFrameNetworkingContext::EmptyFrameNetworkingContext() : FrameNetworkingContext { nullptr } { } Ref EmptyFrameLoaderClient::createNetworkingContext() { return EmptyFrameNetworkingContext::create(); } void EmptyFrameLoaderClient::sendH2Ping(const URL& url, CompletionHandler&&)>&& completionHandler) { ASSERT_NOT_REACHED(); completionHandler(makeUnexpected(internalError(url))); } void EmptyEditorClient::EmptyTextCheckerClient::requestCheckingOfString(TextCheckingRequest&, const VisibleSelection&) { } void EmptyEditorClient::registerUndoStep(UndoStep&) { } void EmptyEditorClient::registerRedoStep(UndoStep&) { } Ref EmptyStorageNamespaceProvider::createSessionStorageNamespace(Page& page, unsigned) { return adoptRef(*new EmptyStorageNamespace { page.sessionID() }); } Ref EmptyStorageNamespaceProvider::createLocalStorageNamespace(unsigned, PAL::SessionID sessionID) { return adoptRef(*new EmptyStorageNamespace { sessionID }); } Ref EmptyStorageNamespaceProvider::createTransientLocalStorageNamespace(SecurityOrigin&, unsigned, PAL::SessionID sessionID) { return adoptRef(*new EmptyStorageNamespace { sessionID }); } class EmptyStorageSessionProvider final : public StorageSessionProvider { NetworkStorageSession* storageSession() const final { return nullptr; } }; class EmptyMediaRecorderProvider final : public MediaRecorderProvider { public: EmptyMediaRecorderProvider() = default; private: #if ENABLE(MEDIA_STREAM) && PLATFORM(COCOA) std::unique_ptr createMediaRecorderPrivate(MediaStreamPrivate&, const MediaRecorderPrivateOptions&) final { return nullptr; } #endif }; class EmptyBroadcastChannelRegistry final : public BroadcastChannelRegistry { public: static Ref create() { return adoptRef(*new EmptyBroadcastChannelRegistry); } private: EmptyBroadcastChannelRegistry() = default; void registerChannel(const SecurityOriginData&, const String&, BroadcastChannelIdentifier) final { } void unregisterChannel(const SecurityOriginData&, const String&, BroadcastChannelIdentifier) final { } void postMessage(const SecurityOriginData&, const String&, BroadcastChannelIdentifier, Ref&&, CompletionHandler&&) final { } }; PageConfiguration pageConfigurationWithEmptyClients(PAL::SessionID sessionID) { PageConfiguration pageConfiguration { sessionID, makeUniqueRef(), SocketProvider::create(), LibWebRTCProvider::create(), CacheStorageProvider::create(), adoptRef(*new EmptyUserContentProvider), adoptRef(*new EmptyBackForwardClient), CookieJar::create(adoptRef(*new EmptyStorageSessionProvider)), makeUniqueRef(), makeUniqueRef(), makeUniqueRef(), makeUniqueRef(), EmptyBroadcastChannelRegistry::create() }; static NeverDestroyed dummyChromeClient; pageConfiguration.chromeClient = &dummyChromeClient.get(); #if ENABLE(APPLE_PAY) static NeverDestroyed dummyPaymentCoordinatorClient; pageConfiguration.paymentCoordinatorClient = &dummyPaymentCoordinatorClient.get(); #endif #if ENABLE(CONTEXT_MENUS) static NeverDestroyed dummyContextMenuClient; pageConfiguration.contextMenuClient = &dummyContextMenuClient.get(); #endif #if ENABLE(DRAG_SUPPORT) pageConfiguration.dragClient = makeUnique(); #endif static NeverDestroyed dummyInspectorClient; pageConfiguration.inspectorClient = &dummyInspectorClient.get(); pageConfiguration.diagnosticLoggingClient = makeUnique(); pageConfiguration.applicationCacheStorage = ApplicationCacheStorage::create({ }, { }); pageConfiguration.databaseProvider = adoptRef(*new EmptyDatabaseProvider); pageConfiguration.pluginInfoProvider = adoptRef(*new EmptyPluginInfoProvider); pageConfiguration.storageNamespaceProvider = adoptRef(*new EmptyStorageNamespaceProvider); pageConfiguration.visitedLinkStore = adoptRef(*new EmptyVisitedLinkStore); return pageConfiguration; } DiagnosticLoggingClient& emptyDiagnosticLoggingClient() { static NeverDestroyed client; return client; } }