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 | #pragma once
|
---|
27 |
|
---|
28 | #include "FrameLoaderClient.h"
|
---|
29 |
|
---|
30 | namespace WebCore {
|
---|
31 |
|
---|
32 | class WEBCORE_EXPORT EmptyFrameLoaderClient : public FrameLoaderClient {
|
---|
33 | private:
|
---|
34 | Ref<DocumentLoader> createDocumentLoader(const ResourceRequest&, const SubstituteData&) override;
|
---|
35 |
|
---|
36 | std::optional<FrameIdentifier> frameID() const override;
|
---|
37 | std::optional<PageIdentifier> pageID() const override;
|
---|
38 |
|
---|
39 | bool hasWebView() const final;
|
---|
40 |
|
---|
41 | void makeRepresentation(DocumentLoader*) final;
|
---|
42 |
|
---|
43 | #if PLATFORM(IOS_FAMILY)
|
---|
44 | bool forceLayoutOnRestoreFromBackForwardCache() final;
|
---|
45 | #endif
|
---|
46 |
|
---|
47 | void forceLayoutForNonHTML() final;
|
---|
48 |
|
---|
49 | void setCopiesOnScroll() final;
|
---|
50 |
|
---|
51 | void detachedFromParent2() final;
|
---|
52 | void detachedFromParent3() final;
|
---|
53 |
|
---|
54 | void convertMainResourceLoadToDownload(DocumentLoader*, const ResourceRequest&, const ResourceResponse&) final;
|
---|
55 |
|
---|
56 | void assignIdentifierToInitialRequest(ResourceLoaderIdentifier, DocumentLoader*, const ResourceRequest&) final;
|
---|
57 | bool shouldUseCredentialStorage(DocumentLoader*, ResourceLoaderIdentifier) override;
|
---|
58 | void dispatchWillSendRequest(DocumentLoader*, ResourceLoaderIdentifier, ResourceRequest&, const ResourceResponse&) final;
|
---|
59 | void dispatchDidReceiveAuthenticationChallenge(DocumentLoader*, ResourceLoaderIdentifier, const AuthenticationChallenge&) final;
|
---|
60 | #if USE(PROTECTION_SPACE_AUTH_CALLBACK)
|
---|
61 | bool canAuthenticateAgainstProtectionSpace(DocumentLoader*, ResourceLoaderIdentifier, const ProtectionSpace&) final;
|
---|
62 | #endif
|
---|
63 |
|
---|
64 | #if PLATFORM(IOS_FAMILY)
|
---|
65 | RetainPtr<CFDictionaryRef> connectionProperties(DocumentLoader*, ResourceLoaderIdentifier) final;
|
---|
66 | #endif
|
---|
67 |
|
---|
68 | void dispatchDidReceiveResponse(DocumentLoader*, ResourceLoaderIdentifier, const ResourceResponse&) final;
|
---|
69 | void dispatchDidReceiveContentLength(DocumentLoader*, ResourceLoaderIdentifier, int) final;
|
---|
70 | void dispatchDidFinishLoading(DocumentLoader*, ResourceLoaderIdentifier) final;
|
---|
71 | #if ENABLE(DATA_DETECTION)
|
---|
72 | void dispatchDidFinishDataDetection(NSArray *) final;
|
---|
73 | #endif
|
---|
74 | void dispatchDidFailLoading(DocumentLoader*, ResourceLoaderIdentifier, const ResourceError&) final;
|
---|
75 | bool dispatchDidLoadResourceFromMemoryCache(DocumentLoader*, const ResourceRequest&, const ResourceResponse&, int) final;
|
---|
76 |
|
---|
77 | void dispatchDidDispatchOnloadEvents() final;
|
---|
78 | void dispatchDidReceiveServerRedirectForProvisionalLoad() final;
|
---|
79 | void dispatchDidCancelClientRedirect() final;
|
---|
80 | void dispatchWillPerformClientRedirect(const URL&, double, WallTime, LockBackForwardList) final;
|
---|
81 | void dispatchDidChangeLocationWithinPage() final;
|
---|
82 | void dispatchDidPushStateWithinPage() final;
|
---|
83 | void dispatchDidReplaceStateWithinPage() final;
|
---|
84 | void dispatchDidPopStateWithinPage() final;
|
---|
85 | void dispatchWillClose() final;
|
---|
86 | void dispatchDidStartProvisionalLoad() final;
|
---|
87 | void dispatchDidReceiveTitle(const StringWithDirection&) final;
|
---|
88 | void dispatchDidCommitLoad(std::optional<HasInsecureContent>, std::optional<UsedLegacyTLS>) final;
|
---|
89 | void dispatchDidFailProvisionalLoad(const ResourceError&, WillContinueLoading) final;
|
---|
90 | void dispatchDidFailLoad(const ResourceError&) final;
|
---|
91 | void dispatchDidFinishDocumentLoad() final;
|
---|
92 | void dispatchDidFinishLoad() final;
|
---|
93 | void dispatchDidReachLayoutMilestone(OptionSet<LayoutMilestone>) final;
|
---|
94 | void dispatchDidReachVisuallyNonEmptyState() final;
|
---|
95 |
|
---|
96 | Frame* dispatchCreatePage(const NavigationAction&, NewFrameOpenerPolicy) final;
|
---|
97 | void dispatchShow() final;
|
---|
98 |
|
---|
99 | void dispatchDecidePolicyForResponse(const ResourceResponse&, const ResourceRequest&, PolicyCheckIdentifier, const String&, FramePolicyFunction&&) final;
|
---|
100 | void dispatchDecidePolicyForNewWindowAction(const NavigationAction&, const ResourceRequest&, FormState*, const String&, PolicyCheckIdentifier, FramePolicyFunction&&) final;
|
---|
101 | void dispatchDecidePolicyForNavigationAction(const NavigationAction&, const ResourceRequest&, const ResourceResponse& redirectResponse, FormState*, PolicyDecisionMode, PolicyCheckIdentifier, FramePolicyFunction&&) final;
|
---|
102 | void cancelPolicyCheck() final;
|
---|
103 |
|
---|
104 | void dispatchUnableToImplementPolicy(const ResourceError&) final;
|
---|
105 |
|
---|
106 | void dispatchWillSendSubmitEvent(Ref<FormState>&&) final;
|
---|
107 | void dispatchWillSubmitForm(FormState&, CompletionHandler<void()>&&) final;
|
---|
108 |
|
---|
109 | void revertToProvisionalState(DocumentLoader*) final;
|
---|
110 | void setMainDocumentError(DocumentLoader*, const ResourceError&) final;
|
---|
111 |
|
---|
112 | void setMainFrameDocumentReady(bool) final;
|
---|
113 |
|
---|
114 | void startDownload(const ResourceRequest&, const String&) final;
|
---|
115 |
|
---|
116 | void willChangeTitle(DocumentLoader*) final;
|
---|
117 | void didChangeTitle(DocumentLoader*) final;
|
---|
118 |
|
---|
119 | void willReplaceMultipartContent() final;
|
---|
120 | void didReplaceMultipartContent() final;
|
---|
121 |
|
---|
122 | void committedLoad(DocumentLoader*, const SharedBuffer&) final;
|
---|
123 | void finishedLoading(DocumentLoader*) final;
|
---|
124 |
|
---|
125 | ResourceError cancelledError(const ResourceRequest&) const final;
|
---|
126 | ResourceError blockedError(const ResourceRequest&) const final;
|
---|
127 | ResourceError blockedByContentBlockerError(const ResourceRequest&) const final;
|
---|
128 | ResourceError cannotShowURLError(const ResourceRequest&) const final;
|
---|
129 | ResourceError interruptedForPolicyChangeError(const ResourceRequest&) const final;
|
---|
130 | #if ENABLE(CONTENT_FILTERING)
|
---|
131 | ResourceError blockedByContentFilterError(const ResourceRequest&) const final;
|
---|
132 | #endif
|
---|
133 |
|
---|
134 | ResourceError cannotShowMIMETypeError(const ResourceResponse&) const final;
|
---|
135 | ResourceError fileDoesNotExistError(const ResourceResponse&) const final;
|
---|
136 | ResourceError pluginWillHandleLoadError(const ResourceResponse&) const final;
|
---|
137 |
|
---|
138 | bool shouldFallBack(const ResourceError&) const final;
|
---|
139 |
|
---|
140 | bool canHandleRequest(const ResourceRequest&) const final;
|
---|
141 | bool canShowMIMEType(const String&) const final;
|
---|
142 | bool canShowMIMETypeAsHTML(const String&) const final;
|
---|
143 | bool representationExistsForURLScheme(StringView) const final;
|
---|
144 | String generatedMIMETypeForURLScheme(StringView) const final;
|
---|
145 |
|
---|
146 | void frameLoadCompleted() final;
|
---|
147 | void restoreViewState() final;
|
---|
148 | void provisionalLoadStarted() final;
|
---|
149 | void didFinishLoad() final;
|
---|
150 | void prepareForDataSourceReplacement() final;
|
---|
151 |
|
---|
152 | void updateCachedDocumentLoader(DocumentLoader&) final;
|
---|
153 | void setTitle(const StringWithDirection&, const URL&) final;
|
---|
154 |
|
---|
155 | String userAgent(const URL&) const override;
|
---|
156 |
|
---|
157 | void savePlatformDataToCachedFrame(CachedFrame*) final;
|
---|
158 | void transitionToCommittedFromCachedFrame(CachedFrame*) final;
|
---|
159 | #if PLATFORM(IOS_FAMILY)
|
---|
160 | void didRestoreFrameHierarchyForCachedFrame() final;
|
---|
161 | #endif
|
---|
162 | void transitionToCommittedForNewPage() final;
|
---|
163 |
|
---|
164 | void didRestoreFromBackForwardCache() final;
|
---|
165 |
|
---|
166 | void updateGlobalHistory() final;
|
---|
167 | void updateGlobalHistoryRedirectLinks() final;
|
---|
168 | bool shouldGoToHistoryItem(HistoryItem&) const final;
|
---|
169 | void saveViewStateToItem(HistoryItem&) final;
|
---|
170 | bool canCachePage() const final;
|
---|
171 | void didDisplayInsecureContent() final;
|
---|
172 | void didRunInsecureContent(SecurityOrigin&, const URL&) final;
|
---|
173 | void didDetectXSS(const URL&, bool) final;
|
---|
174 | RefPtr<Frame> createFrame(const AtomString&, HTMLFrameOwnerElement&) final;
|
---|
175 | RefPtr<Widget> createPlugin(const IntSize&, HTMLPlugInElement&, const URL&, const Vector<AtomString>&, const Vector<AtomString>&, const String&, bool) final;
|
---|
176 |
|
---|
177 | ObjectContentType objectContentType(const URL&, const String&) final;
|
---|
178 | String overrideMediaType() const final;
|
---|
179 |
|
---|
180 | void redirectDataToPlugin(Widget&) final;
|
---|
181 | void dispatchDidClearWindowObjectInWorld(DOMWrapperWorld&) final;
|
---|
182 |
|
---|
183 | #if PLATFORM(COCOA)
|
---|
184 | RemoteAXObjectRef accessibilityRemoteObject() final;
|
---|
185 | void willCacheResponse(DocumentLoader*, ResourceLoaderIdentifier, NSCachedURLResponse *, CompletionHandler<void(NSCachedURLResponse *)>&&) const final;
|
---|
186 | #endif
|
---|
187 |
|
---|
188 | #if USE(CFURLCONNECTION)
|
---|
189 | bool shouldCacheResponse(DocumentLoader*, ResourceLoaderIdentifier, const ResourceResponse&, const unsigned char*, unsigned long long) final;
|
---|
190 | #endif
|
---|
191 |
|
---|
192 | Ref<FrameNetworkingContext> createNetworkingContext() final;
|
---|
193 |
|
---|
194 | bool isEmptyFrameLoaderClient() const override;
|
---|
195 | void prefetchDNS(const String&) final;
|
---|
196 | void sendH2Ping(const URL&, CompletionHandler<void(Expected<Seconds, ResourceError>&&)>&&) final;
|
---|
197 |
|
---|
198 | #if USE(QUICK_LOOK)
|
---|
199 | RefPtr<LegacyPreviewLoaderClient> createPreviewLoaderClient(const String&, const String&) final;
|
---|
200 | #endif
|
---|
201 |
|
---|
202 | #if ENABLE(INTELLIGENT_TRACKING_PREVENTION)
|
---|
203 | bool hasFrameSpecificStorageAccess() final;
|
---|
204 | #endif
|
---|
205 | };
|
---|
206 |
|
---|
207 | } // namespace WebCore
|
---|