commit-queue@webkit.org | c7c21c9 | 2017-10-25 21:17:46 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2017 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. ``AS IS'' AND ANY |
| 14 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 16 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR |
| 17 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| 18 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 19 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
| 20 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
| 21 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 | */ |
| 25 | |
| 26 | #include "FrameLoaderClient.h" |
| 27 | |
| 28 | namespace WebCore { |
| 29 | |
| 30 | class WEBCORE_EXPORT EmptyFrameLoaderClient : public FrameLoaderClient { |
| 31 | Ref<DocumentLoader> createDocumentLoader(const ResourceRequest&, const SubstituteData&) override; |
| 32 | |
commit-queue@webkit.org | 37d33e2 | 2017-12-09 01:05:58 +0000 | [diff] [blame] | 33 | void frameLoaderDestroyed() override { } |
commit-queue@webkit.org | c7c21c9 | 2017-10-25 21:17:46 +0000 | [diff] [blame] | 34 | |
cdumez@apple.com | 8b7a022 | 2018-12-20 04:41:11 +0000 | [diff] [blame] | 35 | Optional<uint64_t> frameID() const override { return WTF::nullopt; } |
| 36 | Optional<uint64_t> pageID() const override { return WTF::nullopt; } |
commit-queue@webkit.org | c7c21c9 | 2017-10-25 21:17:46 +0000 | [diff] [blame] | 37 | PAL::SessionID sessionID() const override; |
| 38 | |
| 39 | bool hasWebView() const final { return true; } // mainly for assertions |
| 40 | |
| 41 | void makeRepresentation(DocumentLoader*) final { } |
ap@apple.com | 1e847592 | 2018-10-18 21:38:50 +0000 | [diff] [blame] | 42 | #if PLATFORM(IOS_FAMILY) |
commit-queue@webkit.org | c7c21c9 | 2017-10-25 21:17:46 +0000 | [diff] [blame] | 43 | bool forceLayoutOnRestoreFromPageCache() final { return false; } |
| 44 | #endif |
| 45 | void forceLayoutForNonHTML() final { } |
| 46 | |
| 47 | void setCopiesOnScroll() final { } |
| 48 | |
| 49 | void detachedFromParent2() final { } |
| 50 | void detachedFromParent3() final { } |
| 51 | |
| 52 | void convertMainResourceLoadToDownload(DocumentLoader*, PAL::SessionID, const ResourceRequest&, const ResourceResponse&) final { } |
| 53 | |
| 54 | void assignIdentifierToInitialRequest(unsigned long, DocumentLoader*, const ResourceRequest&) final { } |
commit-queue@webkit.org | c4f892f | 2017-12-22 05:36:13 +0000 | [diff] [blame] | 55 | bool shouldUseCredentialStorage(DocumentLoader*, unsigned long) override { return false; } |
commit-queue@webkit.org | c7c21c9 | 2017-10-25 21:17:46 +0000 | [diff] [blame] | 56 | void dispatchWillSendRequest(DocumentLoader*, unsigned long, ResourceRequest&, const ResourceResponse&) final { } |
| 57 | void dispatchDidReceiveAuthenticationChallenge(DocumentLoader*, unsigned long, const AuthenticationChallenge&) final { } |
| 58 | #if USE(PROTECTION_SPACE_AUTH_CALLBACK) |
| 59 | bool canAuthenticateAgainstProtectionSpace(DocumentLoader*, unsigned long, const ProtectionSpace&) final { return false; } |
| 60 | #endif |
| 61 | |
ap@apple.com | 1e847592 | 2018-10-18 21:38:50 +0000 | [diff] [blame] | 62 | #if PLATFORM(IOS_FAMILY) |
commit-queue@webkit.org | c7c21c9 | 2017-10-25 21:17:46 +0000 | [diff] [blame] | 63 | RetainPtr<CFDictionaryRef> connectionProperties(DocumentLoader*, unsigned long) final { return nullptr; } |
| 64 | #endif |
| 65 | |
| 66 | void dispatchDidReceiveResponse(DocumentLoader*, unsigned long, const ResourceResponse&) final { } |
| 67 | void dispatchDidReceiveContentLength(DocumentLoader*, unsigned long, int) final { } |
| 68 | void dispatchDidFinishLoading(DocumentLoader*, unsigned long) final { } |
| 69 | #if ENABLE(DATA_DETECTION) |
| 70 | void dispatchDidFinishDataDetection(NSArray *) final { } |
| 71 | #endif |
| 72 | void dispatchDidFailLoading(DocumentLoader*, unsigned long, const ResourceError&) final { } |
| 73 | bool dispatchDidLoadResourceFromMemoryCache(DocumentLoader*, const ResourceRequest&, const ResourceResponse&, int) final { return false; } |
| 74 | |
| 75 | void dispatchDidDispatchOnloadEvents() final { } |
| 76 | void dispatchDidReceiveServerRedirectForProvisionalLoad() final { } |
| 77 | void dispatchDidCancelClientRedirect() final { } |
achristensen@apple.com | 6fddc91 | 2018-10-18 21:16:52 +0000 | [diff] [blame] | 78 | void dispatchWillPerformClientRedirect(const URL&, double, WallTime, LockBackForwardList) final { } |
commit-queue@webkit.org | c7c21c9 | 2017-10-25 21:17:46 +0000 | [diff] [blame] | 79 | void dispatchDidChangeLocationWithinPage() final { } |
| 80 | void dispatchDidPushStateWithinPage() final { } |
| 81 | void dispatchDidReplaceStateWithinPage() final { } |
| 82 | void dispatchDidPopStateWithinPage() final { } |
| 83 | void dispatchWillClose() final { } |
achristensen@apple.com | 72b42db | 2018-12-03 21:47:08 +0000 | [diff] [blame] | 84 | void dispatchDidStartProvisionalLoad(CompletionHandler<void()>&& completionHandler) final { completionHandler(); } |
commit-queue@webkit.org | c7c21c9 | 2017-10-25 21:17:46 +0000 | [diff] [blame] | 85 | void dispatchDidReceiveTitle(const StringWithDirection&) final { } |
cdumez@apple.com | 8b7a022 | 2018-12-20 04:41:11 +0000 | [diff] [blame] | 86 | void dispatchDidCommitLoad(Optional<HasInsecureContent>) final { } |
commit-queue@webkit.org | c7c21c9 | 2017-10-25 21:17:46 +0000 | [diff] [blame] | 87 | void dispatchDidFailProvisionalLoad(const ResourceError&) final { } |
| 88 | void dispatchDidFailLoad(const ResourceError&) final { } |
| 89 | void dispatchDidFinishDocumentLoad() final { } |
| 90 | void dispatchDidFinishLoad() final { } |
antti@apple.com | 8e03f74 | 2018-11-09 19:47:15 +0000 | [diff] [blame] | 91 | void dispatchDidReachLayoutMilestone(OptionSet<LayoutMilestone>) final { } |
commit-queue@webkit.org | c7c21c9 | 2017-10-25 21:17:46 +0000 | [diff] [blame] | 92 | |
| 93 | Frame* dispatchCreatePage(const NavigationAction&) final { return nullptr; } |
| 94 | void dispatchShow() final { } |
| 95 | |
| 96 | void dispatchDecidePolicyForResponse(const ResourceResponse&, const ResourceRequest&, FramePolicyFunction&&) final { } |
| 97 | void dispatchDecidePolicyForNewWindowAction(const NavigationAction&, const ResourceRequest&, FormState*, const String&, FramePolicyFunction&&) final; |
achristensen@apple.com | 10e4a7b | 2018-11-28 21:14:43 +0000 | [diff] [blame] | 98 | void dispatchDecidePolicyForNavigationAction(const NavigationAction&, const ResourceRequest&, const ResourceResponse& redirectResponse, FormState*, PolicyDecisionMode, FramePolicyFunction&&) final; |
commit-queue@webkit.org | c7c21c9 | 2017-10-25 21:17:46 +0000 | [diff] [blame] | 99 | void cancelPolicyCheck() final { } |
| 100 | |
| 101 | void dispatchUnableToImplementPolicy(const ResourceError&) final { } |
| 102 | |
| 103 | void dispatchWillSendSubmitEvent(Ref<FormState>&&) final; |
cdumez@apple.com | e8b32b4 | 2018-08-31 19:00:23 +0000 | [diff] [blame] | 104 | void dispatchWillSubmitForm(FormState&, CompletionHandler<void()>&&) final; |
commit-queue@webkit.org | c7c21c9 | 2017-10-25 21:17:46 +0000 | [diff] [blame] | 105 | |
| 106 | void revertToProvisionalState(DocumentLoader*) final { } |
| 107 | void setMainDocumentError(DocumentLoader*, const ResourceError&) final { } |
| 108 | |
| 109 | void setMainFrameDocumentReady(bool) final { } |
| 110 | |
| 111 | void startDownload(const ResourceRequest&, const String&) final { } |
| 112 | |
| 113 | void willChangeTitle(DocumentLoader*) final { } |
| 114 | void didChangeTitle(DocumentLoader*) final { } |
| 115 | |
| 116 | void willReplaceMultipartContent() final { } |
| 117 | void didReplaceMultipartContent() final { } |
| 118 | |
| 119 | void committedLoad(DocumentLoader*, const char*, int) final { } |
| 120 | void finishedLoading(DocumentLoader*) final { } |
| 121 | |
| 122 | ResourceError cancelledError(const ResourceRequest&) final { return { ResourceError::Type::Cancellation }; } |
| 123 | ResourceError blockedError(const ResourceRequest&) final { return { }; } |
| 124 | ResourceError blockedByContentBlockerError(const ResourceRequest&) final { return { }; } |
| 125 | ResourceError cannotShowURLError(const ResourceRequest&) final { return { }; } |
| 126 | ResourceError interruptedForPolicyChangeError(const ResourceRequest&) final { return { }; } |
| 127 | #if ENABLE(CONTENT_FILTERING) |
| 128 | ResourceError blockedByContentFilterError(const ResourceRequest&) final { return { }; } |
| 129 | #endif |
| 130 | |
| 131 | ResourceError cannotShowMIMETypeError(const ResourceResponse&) final { return { }; } |
| 132 | ResourceError fileDoesNotExistError(const ResourceResponse&) final { return { }; } |
| 133 | ResourceError pluginWillHandleLoadError(const ResourceResponse&) final { return { }; } |
| 134 | |
| 135 | bool shouldFallBack(const ResourceError&) final { return false; } |
| 136 | |
| 137 | bool canHandleRequest(const ResourceRequest&) const final { return false; } |
| 138 | bool canShowMIMEType(const String&) const final { return false; } |
| 139 | bool canShowMIMETypeAsHTML(const String&) const final { return false; } |
| 140 | bool representationExistsForURLScheme(const String&) const final { return false; } |
| 141 | String generatedMIMETypeForURLScheme(const String&) const final { return emptyString(); } |
| 142 | |
| 143 | void frameLoadCompleted() final { } |
| 144 | void restoreViewState() final { } |
| 145 | void provisionalLoadStarted() final { } |
| 146 | void didFinishLoad() final { } |
| 147 | void prepareForDataSourceReplacement() final { } |
| 148 | |
| 149 | void updateCachedDocumentLoader(DocumentLoader&) final { } |
| 150 | void setTitle(const StringWithDirection&, const URL&) final { } |
| 151 | |
commit-queue@webkit.org | 37d33e2 | 2017-12-09 01:05:58 +0000 | [diff] [blame] | 152 | String userAgent(const URL&) override { return emptyString(); } |
commit-queue@webkit.org | c7c21c9 | 2017-10-25 21:17:46 +0000 | [diff] [blame] | 153 | |
| 154 | void savePlatformDataToCachedFrame(CachedFrame*) final { } |
| 155 | void transitionToCommittedFromCachedFrame(CachedFrame*) final { } |
ap@apple.com | 1e847592 | 2018-10-18 21:38:50 +0000 | [diff] [blame] | 156 | #if PLATFORM(IOS_FAMILY) |
commit-queue@webkit.org | c7c21c9 | 2017-10-25 21:17:46 +0000 | [diff] [blame] | 157 | void didRestoreFrameHierarchyForCachedFrame() final { } |
| 158 | #endif |
| 159 | void transitionToCommittedForNewPage() final { } |
| 160 | |
| 161 | void didSaveToPageCache() final { } |
| 162 | void didRestoreFromPageCache() final { } |
| 163 | |
| 164 | void dispatchDidBecomeFrameset(bool) final { } |
| 165 | |
| 166 | void updateGlobalHistory() final { } |
| 167 | void updateGlobalHistoryRedirectLinks() final { } |
achristensen@apple.com | dce632c | 2018-10-15 14:29:53 +0000 | [diff] [blame] | 168 | bool shouldGoToHistoryItem(HistoryItem&) const final { return false; } |
commit-queue@webkit.org | c7c21c9 | 2017-10-25 21:17:46 +0000 | [diff] [blame] | 169 | void saveViewStateToItem(HistoryItem&) final { } |
| 170 | bool canCachePage() const final { return false; } |
| 171 | void didDisplayInsecureContent() final { } |
| 172 | void didRunInsecureContent(SecurityOrigin&, const URL&) final { } |
| 173 | void didDetectXSS(const URL&, bool) final { } |
achristensen@apple.com | 82ef549 | 2018-10-15 19:55:39 +0000 | [diff] [blame] | 174 | RefPtr<Frame> createFrame(const URL&, const String&, HTMLFrameOwnerElement&, const String&) final; |
commit-queue@webkit.org | c7c21c9 | 2017-10-25 21:17:46 +0000 | [diff] [blame] | 175 | RefPtr<Widget> createPlugin(const IntSize&, HTMLPlugInElement&, const URL&, const Vector<String>&, const Vector<String>&, const String&, bool) final; |
| 176 | void recreatePlugin(Widget*) final; |
| 177 | RefPtr<Widget> createJavaAppletWidget(const IntSize&, HTMLAppletElement&, const URL&, const Vector<String>&, const Vector<String>&) final; |
| 178 | |
| 179 | ObjectContentType objectContentType(const URL&, const String&) final { return ObjectContentType::None; } |
| 180 | String overrideMediaType() const final { return { }; } |
| 181 | |
| 182 | void redirectDataToPlugin(Widget&) final { } |
| 183 | void dispatchDidClearWindowObjectInWorld(DOMWrapperWorld&) final { } |
| 184 | |
| 185 | #if PLATFORM(COCOA) |
| 186 | RemoteAXObjectRef accessibilityRemoteObject() final { return nullptr; } |
achristensen@apple.com | db87699 | 2018-03-26 17:38:49 +0000 | [diff] [blame] | 187 | void willCacheResponse(DocumentLoader*, unsigned long, NSCachedURLResponse *response, CompletionHandler<void(NSCachedURLResponse *)>&& completionHandler) const final { completionHandler(response); } |
commit-queue@webkit.org | c7c21c9 | 2017-10-25 21:17:46 +0000 | [diff] [blame] | 188 | #endif |
| 189 | |
achristensen@apple.com | 5c1fc98 | 2017-11-14 22:20:42 +0000 | [diff] [blame] | 190 | #if USE(CFURLCONNECTION) |
commit-queue@webkit.org | c7c21c9 | 2017-10-25 21:17:46 +0000 | [diff] [blame] | 191 | bool shouldCacheResponse(DocumentLoader*, unsigned long, const ResourceResponse&, const unsigned char*, unsigned long long) final { return true; } |
| 192 | #endif |
| 193 | |
| 194 | Ref<FrameNetworkingContext> createNetworkingContext() final; |
| 195 | |
| 196 | bool isEmptyFrameLoaderClient() final { return true; } |
| 197 | void prefetchDNS(const String&) final { } |
| 198 | |
| 199 | #if USE(QUICK_LOOK) |
| 200 | RefPtr<PreviewLoaderClient> createPreviewLoaderClient(const String&, const String&) final { return nullptr; } |
| 201 | #endif |
wilander@apple.com | f38abe2 | 2018-09-25 22:49:47 +0000 | [diff] [blame] | 202 | #if ENABLE(RESOURCE_LOAD_STATISTICS) |
wilander@apple.com | 7683422 | 2017-12-21 19:56:45 +0000 | [diff] [blame] | 203 | bool hasFrameSpecificStorageAccess() final { return false; } |
| 204 | void setHasFrameSpecificStorageAccess(bool) final { } |
| 205 | #endif |
commit-queue@webkit.org | c7c21c9 | 2017-10-25 21:17:46 +0000 | [diff] [blame] | 206 | }; |
| 207 | |
| 208 | } |