blob: a43e20ba09c1b9af65e7e203bf483e69ef2fda42 [file] [log] [blame]
commit-queue@webkit.orgc7c21c92017-10-25 21:17:46 +00001/*
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
28namespace WebCore {
29
30class WEBCORE_EXPORT EmptyFrameLoaderClient : public FrameLoaderClient {
31 Ref<DocumentLoader> createDocumentLoader(const ResourceRequest&, const SubstituteData&) override;
32
commit-queue@webkit.org37d33e22017-12-09 01:05:58 +000033 void frameLoaderDestroyed() override { }
commit-queue@webkit.orgc7c21c92017-10-25 21:17:46 +000034
cdumez@apple.com8b7a0222018-12-20 04:41:11 +000035 Optional<uint64_t> frameID() const override { return WTF::nullopt; }
36 Optional<uint64_t> pageID() const override { return WTF::nullopt; }
commit-queue@webkit.orgc7c21c92017-10-25 21:17:46 +000037 PAL::SessionID sessionID() const override;
38
39 bool hasWebView() const final { return true; } // mainly for assertions
40
41 void makeRepresentation(DocumentLoader*) final { }
ap@apple.com1e8475922018-10-18 21:38:50 +000042#if PLATFORM(IOS_FAMILY)
commit-queue@webkit.orgc7c21c92017-10-25 21:17:46 +000043 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.orgc4f892f2017-12-22 05:36:13 +000055 bool shouldUseCredentialStorage(DocumentLoader*, unsigned long) override { return false; }
commit-queue@webkit.orgc7c21c92017-10-25 21:17:46 +000056 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.com1e8475922018-10-18 21:38:50 +000062#if PLATFORM(IOS_FAMILY)
commit-queue@webkit.orgc7c21c92017-10-25 21:17:46 +000063 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.com6fddc912018-10-18 21:16:52 +000078 void dispatchWillPerformClientRedirect(const URL&, double, WallTime, LockBackForwardList) final { }
commit-queue@webkit.orgc7c21c92017-10-25 21:17:46 +000079 void dispatchDidChangeLocationWithinPage() final { }
80 void dispatchDidPushStateWithinPage() final { }
81 void dispatchDidReplaceStateWithinPage() final { }
82 void dispatchDidPopStateWithinPage() final { }
83 void dispatchWillClose() final { }
achristensen@apple.com72b42db2018-12-03 21:47:08 +000084 void dispatchDidStartProvisionalLoad(CompletionHandler<void()>&& completionHandler) final { completionHandler(); }
commit-queue@webkit.orgc7c21c92017-10-25 21:17:46 +000085 void dispatchDidReceiveTitle(const StringWithDirection&) final { }
cdumez@apple.com8b7a0222018-12-20 04:41:11 +000086 void dispatchDidCommitLoad(Optional<HasInsecureContent>) final { }
commit-queue@webkit.orgc7c21c92017-10-25 21:17:46 +000087 void dispatchDidFailProvisionalLoad(const ResourceError&) final { }
88 void dispatchDidFailLoad(const ResourceError&) final { }
89 void dispatchDidFinishDocumentLoad() final { }
90 void dispatchDidFinishLoad() final { }
antti@apple.com8e03f742018-11-09 19:47:15 +000091 void dispatchDidReachLayoutMilestone(OptionSet<LayoutMilestone>) final { }
commit-queue@webkit.orgc7c21c92017-10-25 21:17:46 +000092
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.com10e4a7b2018-11-28 21:14:43 +000098 void dispatchDecidePolicyForNavigationAction(const NavigationAction&, const ResourceRequest&, const ResourceResponse& redirectResponse, FormState*, PolicyDecisionMode, FramePolicyFunction&&) final;
commit-queue@webkit.orgc7c21c92017-10-25 21:17:46 +000099 void cancelPolicyCheck() final { }
100
101 void dispatchUnableToImplementPolicy(const ResourceError&) final { }
102
103 void dispatchWillSendSubmitEvent(Ref<FormState>&&) final;
cdumez@apple.come8b32b42018-08-31 19:00:23 +0000104 void dispatchWillSubmitForm(FormState&, CompletionHandler<void()>&&) final;
commit-queue@webkit.orgc7c21c92017-10-25 21:17:46 +0000105
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.org37d33e22017-12-09 01:05:58 +0000152 String userAgent(const URL&) override { return emptyString(); }
commit-queue@webkit.orgc7c21c92017-10-25 21:17:46 +0000153
154 void savePlatformDataToCachedFrame(CachedFrame*) final { }
155 void transitionToCommittedFromCachedFrame(CachedFrame*) final { }
ap@apple.com1e8475922018-10-18 21:38:50 +0000156#if PLATFORM(IOS_FAMILY)
commit-queue@webkit.orgc7c21c92017-10-25 21:17:46 +0000157 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.comdce632c2018-10-15 14:29:53 +0000168 bool shouldGoToHistoryItem(HistoryItem&) const final { return false; }
commit-queue@webkit.orgc7c21c92017-10-25 21:17:46 +0000169 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.com82ef5492018-10-15 19:55:39 +0000174 RefPtr<Frame> createFrame(const URL&, const String&, HTMLFrameOwnerElement&, const String&) final;
commit-queue@webkit.orgc7c21c92017-10-25 21:17:46 +0000175 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.comdb876992018-03-26 17:38:49 +0000187 void willCacheResponse(DocumentLoader*, unsigned long, NSCachedURLResponse *response, CompletionHandler<void(NSCachedURLResponse *)>&& completionHandler) const final { completionHandler(response); }
commit-queue@webkit.orgc7c21c92017-10-25 21:17:46 +0000188#endif
189
achristensen@apple.com5c1fc982017-11-14 22:20:42 +0000190#if USE(CFURLCONNECTION)
commit-queue@webkit.orgc7c21c92017-10-25 21:17:46 +0000191 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.comf38abe22018-09-25 22:49:47 +0000202#if ENABLE(RESOURCE_LOAD_STATISTICS)
wilander@apple.com76834222017-12-21 19:56:45 +0000203 bool hasFrameSpecificStorageAccess() final { return false; }
204 void setHasFrameSpecificStorageAccess(bool) final { }
205#endif
commit-queue@webkit.orgc7c21c92017-10-25 21:17:46 +0000206};
207
208}