source: webkit/trunk/Source/WebCore/loader/FrameLoader.h

Last change on this file was 293563, checked in by Chris Dumez, 3 years ago

Prepare more of the code base for making the AtomString(const String&) constructor explicit
https://bugs.webkit.org/show_bug.cgi?id=239711

Reviewed by Darin Adler.

Prepare more of the code base for making the AtomString(const String&) constructor explicit.
This helps us find cases where we atomize unnecessarily or not early enough, thus causing
unnecessary String allocations.

  • Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp:

(WebKit::NetworkResourceLoader::didReceiveResponse):

  • Source/WebKit/NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp:

(WebKit::ServiceWorkerFetchTask::processResponse):

  • Source/WebKit/WebProcess/WebPage/WebPage.cpp:

(WebKit::dumpHistoryItem):

  • Source/WTF/wtf/text/StringImpl.h:
  • Source/WebCore/Modules/fetch/FetchResponse.cpp:

(WebCore::FetchResponse::create):

  • Source/WebCore/Modules/highlight/HighlightRegister.cpp:

(WebCore::HighlightRegister::setFromMapLike):
(WebCore::HighlightRegister::remove):

  • Source/WebCore/Modules/highlight/HighlightRegister.h:

(WebCore::HighlightRegister::map const):

  • Source/WebCore/Modules/highlight/HighlightRegister.idl:
  • Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.idl:
  • Source/WebCore/Modules/mediastream/RTCDTMFToneChangeEvent.idl:
  • Source/WebCore/Modules/mediastream/RTCDataChannel.idl:
  • Source/WebCore/Modules/mediastream/RTCDataChannelEvent.idl:
  • Source/WebCore/Modules/pictureinpicture/PictureInPictureEvent.idl:
  • Source/WebCore/Modules/push-api/PushEvent.idl:
  • Source/WebCore/Modules/push-api/PushSubscriptionChangeEvent.idl:
  • Source/WebCore/Modules/speech/SpeechSynthesisErrorEvent.idl:
  • Source/WebCore/Modules/webaudio/AudioProcessingEvent.idl:
  • Source/WebCore/Modules/webaudio/OfflineAudioCompletionEvent.idl:
  • Source/WebCore/Modules/websockets/WebSocketHandshake.cpp:

(WebCore::WebSocketHandshake::readServerHandshake):
(WebCore::WebSocketHandshake::readStatusLine):

  • Source/WebCore/Modules/websockets/WebSocketHandshake.h:
  • Source/WebCore/animation/AnimationPlaybackEvent.idl:
  • Source/WebCore/css/CSSComputedStyleDeclaration.cpp:

(WebCore::ComputedStyleExtractor::customPropertyValue):
(WebCore::ComputedStyleExtractor::customPropertyText):

  • Source/WebCore/css/CSSComputedStyleDeclaration.h:
  • Source/WebCore/css/CSSVariableReferenceValue.cpp:

(WebCore::resolveVariableReference):

  • Source/WebCore/css/ContainerQueryParser.cpp:

(WebCore::ContainerQueryParser::consumeFilteredContainerQuery):
(WebCore::consumeFeatureName):

  • Source/WebCore/css/parser/CSSParserImpl.cpp:

(WebCore::CSSParserImpl::consumeFontPaletteValuesRule):
(WebCore::CSSParserImpl::consumeKeyframesRule):

  • Source/WebCore/css/parser/CSSParserSelector.cpp:

(WebCore::CSSParserSelector::parsePseudoElementSelector):
(WebCore::CSSParserSelector::parsePseudoClassSelector):

  • Source/WebCore/css/typedom/CSSStyleValue.cpp:

(WebCore::CSSStyleValue::parse):
(WebCore::CSSStyleValue::parseAll):

  • Source/WebCore/css/typedom/CSSStyleValue.h:
  • Source/WebCore/css/typedom/CSSStyleValue.idl:
  • Source/WebCore/css/typedom/CSSStyleValueFactory.cpp:

(WebCore::CSSStyleValueFactory::extractCustomCSSValues):
(WebCore::CSSStyleValueFactory::parseStyleValue):

  • Source/WebCore/css/typedom/CSSStyleValueFactory.h:
  • Source/WebCore/css/typedom/ComputedStylePropertyMapReadOnly.cpp:

(WebCore::ComputedStylePropertyMapReadOnly::get const):
(WebCore::ComputedStylePropertyMapReadOnly::getAll const):
(WebCore::ComputedStylePropertyMapReadOnly::has const):

  • Source/WebCore/css/typedom/ComputedStylePropertyMapReadOnly.h:
  • Source/WebCore/css/typedom/StylePropertyMapReadOnly.h:
  • Source/WebCore/css/typedom/StylePropertyMapReadOnly.idl:
  • Source/WebCore/dom/AnimationEvent.idl:
  • Source/WebCore/dom/Document.cpp:

(WebCore::Document::setContentLanguage):
(WebCore::Document::processMetaHttpEquiv):

  • Source/WebCore/dom/Document.h:

(WebCore::Document::contentLanguage const):
(WebCore::Document::baseTarget const):

  • Source/WebCore/dom/Element.h:

(WebCore::Element::target const):

  • Source/WebCore/dom/KeyboardEvent.cpp:

(WebCore::KeyboardEvent::KeyboardEvent):
(WebCore::KeyboardEvent::initKeyboardEvent):

  • Source/WebCore/dom/KeyboardEvent.h:
  • Source/WebCore/dom/KeyboardEvent.idl:
  • Source/WebCore/dom/PointerEvent.cpp:

(WebCore::PointerEvent::create):

  • Source/WebCore/dom/PointerEvent.h:
  • Source/WebCore/dom/PopStateEvent.idl:
  • Source/WebCore/dom/ScriptElement.cpp:

(WebCore::ScriptElement::requestModuleScript):

  • Source/WebCore/dom/StyledElement.cpp:
  • Source/WebCore/history/HistoryItem.cpp:

(WebCore::HistoryItem::reset):
(WebCore::HistoryItem::target const):
(WebCore::HistoryItem::setTarget):
(WebCore::HistoryItem::childItemWithTarget):

  • Source/WebCore/history/HistoryItem.h:
  • Source/WebCore/html/Autofill.cpp:

(WebCore::AutofillData::createFromHTMLFormControlElement):

  • Source/WebCore/html/BaseButtonInputType.cpp:

(WebCore::BaseButtonInputType::setValue):

  • Source/WebCore/html/BaseCheckableInputType.cpp:

(WebCore::BaseCheckableInputType::setValue):

  • Source/WebCore/html/BaseDateAndTimeInputType.cpp:

(WebCore::BaseDateAndTimeInputType::setupDateTimeChooserParameters):

  • Source/WebCore/html/CustomPaintImage.cpp:

(WebCore::extractComputedProperty):
(WebCore::CustomPaintImage::doCustomPaint):

  • Source/WebCore/html/CustomPaintImage.h:
  • Source/WebCore/html/HTMLAnchorElement.cpp:

(WebCore::HTMLAnchorElement::target const):
(WebCore::HTMLAnchorElement::effectiveTarget const):

  • Source/WebCore/html/HTMLAnchorElement.h:
  • Source/WebCore/html/HTMLAreaElement.cpp:

(WebCore::HTMLAreaElement::target const):

  • Source/WebCore/html/HTMLAreaElement.h:
  • Source/WebCore/html/HTMLBaseElement.cpp:

(WebCore::HTMLBaseElement::target const):

  • Source/WebCore/html/HTMLBaseElement.h:
  • Source/WebCore/html/HTMLFormElement.cpp:

(WebCore::HTMLFormElement::target const):
(WebCore::HTMLFormElement::effectiveTarget const):

  • Source/WebCore/html/HTMLFormElement.h:
  • Source/WebCore/html/HTMLHtmlElement.idl:
  • Source/WebCore/html/HTMLIFrameElement.idl:
  • Source/WebCore/html/HTMLImageElement.idl:
  • Source/WebCore/html/HTMLLinkElement.cpp:

(WebCore::HTMLLinkElement::target const):

  • Source/WebCore/html/HTMLLinkElement.h:
  • Source/WebCore/html/track/AudioTrack.idl:
  • Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp:
  • Source/WebCore/loader/CrossOriginPreflightChecker.cpp:

(WebCore::CrossOriginPreflightChecker::startPreflight):

  • Source/WebCore/loader/DocumentThreadableLoader.cpp:

(WebCore::DocumentThreadableLoader::loadRequest):

  • Source/WebCore/loader/FormSubmission.cpp:

(WebCore::FormSubmission::FormSubmission):

  • Source/WebCore/loader/FormSubmission.h:

(WebCore::FormSubmission::Attributes::target const):
(WebCore::FormSubmission::Attributes::setTarget):
(WebCore::FormSubmission::target const):

  • Source/WebCore/loader/FrameLoadRequest.cpp:

(WebCore::FrameLoadRequest::FrameLoadRequest):

  • Source/WebCore/loader/FrameLoadRequest.h:

(WebCore::FrameLoadRequest::FrameLoadRequest):
(WebCore::FrameLoadRequest::frameName const):
(WebCore::FrameLoadRequest::setFrameName):

  • Source/WebCore/loader/FrameLoader.cpp:

(WebCore::FrameLoader::changeLocation):
(WebCore::extractContentLanguageFromHeader):
(WebCore::FrameLoader::didBeginDocument):
(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::loadPostRequest):
(WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):

  • Source/WebCore/loader/FrameLoader.h:
  • Source/WebCore/loader/HistoryController.cpp:

(WebCore::FrameLoader::HistoryController::recursiveGoToItem):

  • Source/WebCore/loader/LinkLoader.cpp:

(WebCore::LinkLoader::preloadIfNeeded):

  • Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp:

(WebCore::ApplicationCacheStorage::shouldStoreResourceAsFlatFile):

  • Source/WebCore/page/DOMWindow.cpp:

(WebCore::DOMWindow::name const):
(WebCore::DOMWindow::setName):

  • Source/WebCore/page/DOMWindow.h:
  • Source/WebCore/page/DOMWindow.idl:
  • Source/WebCore/page/DragController.cpp:

(WebCore::documentFragmentFromDragData):

  • Source/WebCore/page/ModalContainerObserver.h:

(WebCore::ModalContainerObserver::overrideSearchTermForTesting):

  • Source/WebCore/page/Navigator.cpp:

(WebCore::Navigator::initializePluginAndMimeTypeArrays):

  • Source/WebCore/page/PageSerializer.cpp:

(WebCore::PageSerializer::SerializerMarkupAccumulator::appendCustomAttributes):

  • Source/WebCore/page/Quirks.cpp:

(WebCore::Quirks::triggerOptionalStorageAccessQuirk const):

  • Source/WebCore/platform/graphics/FontCache.cpp:

(WebCore::FontCache::cachedFontPlatformData):

  • Source/WebCore/platform/graphics/FontDescription.cpp:

(WebCore::computeSpecializedChineseLocale):

  • Source/WebCore/platform/graphics/MediaPlayer.cpp:

(WebCore::MediaPlayer::load):
(WebCore::MediaPlayer::supportsType):

  • Source/WebCore/platform/graphics/cocoa/FontDescriptionCocoa.cpp:

(WebCore::FontDescription::platformResolveGenericFamily):

  • Source/WebCore/platform/graphics/filters/FilterOperation.cpp:

(WebCore::ReferenceFilterOperation::ReferenceFilterOperation):

  • Source/WebCore/platform/graphics/filters/FilterOperation.h:

(WebCore::ReferenceFilterOperation::create):
(WebCore::ReferenceFilterOperation::fragment const):

  • Source/WebCore/platform/mediastream/cocoa/DisplayCaptureSourceCocoa.cpp:

(WebCore::DisplayCaptureSourceCocoa::settings):

  • Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.cpp:

(WebCore::CoreAudioCaptureSource::capabilities):
(WebCore::CoreAudioCaptureSource::settings):

  • Source/WebCore/platform/mock/MockRealtimeAudioSource.cpp:

(WebCore::MockRealtimeAudioSource::settings):
(WebCore::MockRealtimeAudioSource::capabilities):

  • Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp:

(WebCore::MockRealtimeVideoSource::capabilities):
(WebCore::MockRealtimeVideoSource::settings):

  • Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp:
  • Source/WebCore/platform/network/ResourceHandle.cpp:

(WebCore::ResourceHandle::create):
(WebCore::ResourceHandle::loadResourceSynchronously):

  • Source/WebCore/platform/network/ResourceResponseBase.cpp:

(WebCore::ResourceResponseBase::crossThreadData const):
(WebCore::ResourceResponseBase::fromCrossThreadData):
(WebCore::ResourceResponseBase::mimeType const):
(WebCore::ResourceResponseBase::setMimeType):
(WebCore::ResourceResponseBase::textEncodingName const):
(WebCore::ResourceResponseBase::setTextEncodingName):
(WebCore::ResourceResponseBase::httpVersion const):
(WebCore::ResourceResponseBase::setHTTPVersion):

  • Source/WebCore/platform/network/ResourceResponseBase.h:
  • Source/WebCore/plugins/DOMMimeType.cpp:

(WebCore::DOMMimeType::type const):

  • Source/WebCore/plugins/DOMMimeType.h:
  • Source/WebCore/plugins/DOMPlugin.cpp:

(WebCore::DOMPlugin::supportedPropertyNames const):

  • Source/WebCore/plugins/DOMPluginArray.cpp:

(WebCore::DOMPluginArray::supportedPropertyNames const):

  • Source/WebCore/plugins/PluginData.h:
  • Source/WebCore/rendering/MarkedText.h:
  • Source/WebCore/rendering/PathOperation.cpp:

(WebCore::ReferencePathOperation::create):
(WebCore::ReferencePathOperation::ReferencePathOperation):

  • Source/WebCore/rendering/PathOperation.h:
  • Source/WebCore/rendering/style/RenderStyle.cpp:

(WebCore::RenderStyle::addCustomPaintWatchProperty):

  • Source/WebCore/rendering/style/RenderStyle.h:
  • Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp:

(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):

  • Source/WebCore/rendering/style/StyleRareNonInheritedData.h:
  • Source/WebCore/style/RuleSetBuilder.cpp:

(WebCore::Style::RuleSetBuilder::pushCascadeLayer):

  • Source/WebCore/style/StyleBuilder.cpp:

(WebCore::Style::Builder::applyCustomProperty):

  • Source/WebCore/style/StyleBuilder.h:
  • Source/WebCore/style/StyleBuilderConverter.h:

(WebCore::Style::BuilderConverter::convertPathOperation):

  • Source/WebCore/style/StyleBuilderCustom.h:

(WebCore::Style::BuilderCustom::applyValueListStyleType):
(WebCore::Style::BuilderCustom::applyValueWebkitLocale):
(WebCore::Style::BuilderCustom::applyValueFontFamily):
(WebCore::Style::BuilderCustom::applyValueTextEmphasisStyle):
(WebCore::Style::BuilderCustom::applyValueCounter):
(WebCore::Style::BuilderCustom::applyValueAlt):

  • Source/WebCore/style/StyleBuilderState.cpp:

(WebCore::Style::BuilderState::createFilterOperations):

  • Source/WebCore/svg/SVGAElement.cpp:

(WebCore::SVGAElement::defaultEventHandler):

  • Source/WebCore/svg/SVGAElement.h:
  • Source/WebCore/svg/SVGElement.cpp:

(WebCore::SVGElement::synchronizeAttribute):
(WebCore::SVGElement::synchronizeAllAttributes):
(WebCore::SVGElement::commitPropertyChange):
(WebCore::SVGElement::insertedIntoAncestor):
(WebCore::SVGElement::buildPendingResourcesIfNeeded):

  • Source/WebCore/svg/SVGElement.h:

(WebCore::SVGElement::className const):

  • Source/WebCore/svg/SVGURIReference.cpp:

(WebCore::SVGURIReference::fragmentIdentifierFromIRIString):
(WebCore::SVGURIReference::targetElementFromIRIString):

  • Source/WebCore/svg/SVGURIReference.h:
  • Source/WebCore/svg/SVGUseElement.cpp:

(WebCore::SVGUseElement::updateUserAgentShadowTree):
(WebCore::SVGUseElement::findTarget const):

  • Source/WebCore/svg/SVGUseElement.h:
  • Source/WebCore/svg/animation/SVGSMILElement.cpp:

(WebCore::SVGSMILElement::Condition::Condition):
(WebCore::SVGSMILElement::buildPendingResource):
(WebCore::SVGSMILElement::parseCondition):

  • Source/WebCore/svg/animation/SVGSMILElement.h:
  • Source/WebCore/svg/graphics/filters/SVGFilterBuilder.cpp:

(WebCore::SVGFilterBuilder::calculateFilterOutsets):

  • Source/WebCore/testing/Internals.cpp:

(WebCore::Internals::overrideModalContainerSearchTermForTesting):

  • Source/WebCore/testing/Internals.h:
  • Source/WebCore/testing/Internals.idl:
  • Source/WebCore/worklets/PaintWorkletGlobalScope.cpp:

(WebCore::PaintWorkletGlobalScope::PaintDefinition::PaintDefinition):
(WebCore::PaintWorkletGlobalScope::registerPaint):

  • Source/WebCore/worklets/PaintWorkletGlobalScope.h:
  • Source/WebCore/worklets/PaintWorkletGlobalScope.idl:
  • Source/WebCore/xml/CustomXPathNSResolver.cpp:

(WebCore::CustomXPathNSResolver::lookupNamespaceURI):

  • Source/WebCore/xml/XPathGrammar.cpp:
  • Source/WebCore/xml/XPathParser.cpp:

(WebCore::XPath::Parser::expandQualifiedName):

  • Source/WebCore/xml/XPathParser.h:

Canonical link: https://commits.webkit.org/250077@main

  • Property svn:eol-style set to native
File size: 21.2 KB
Line 
1/*
2 * Copyright (C) 2006-2016 Apple Inc. All rights reserved.
3 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
4 * Copyright (C) Research In Motion Limited 2009. All rights reserved.
5 * Copyright (C) 2011 Google Inc. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 *
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. Neither the name of Apple Inc. ("Apple") nor the names of
17 * its contributors may be used to endorse or promote products derived
18 * from this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
21 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
24 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
27 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */
31
32#pragma once
33
34#include "FrameIdentifier.h"
35#include "FrameLoaderStateMachine.h"
36#include "FrameLoaderTypes.h"
37#include "LayoutMilestone.h"
38#include "PageIdentifier.h"
39#include "PrivateClickMeasurement.h"
40#include "ReferrerPolicy.h"
41#include "ResourceLoadNotifier.h"
42#include "ResourceLoaderOptions.h"
43#include "ResourceRequestBase.h"
44#include "SecurityContext.h"
45#include "StoredCredentialsPolicy.h"
46#include "Timer.h"
47#include <wtf/CompletionHandler.h>
48#include <wtf/Forward.h>
49#include <wtf/HashSet.h>
50#include <wtf/OptionSet.h>
51#include <wtf/UniqueRef.h>
52#include <wtf/WallTime.h>
53#include <wtf/WeakHashSet.h>
54
55namespace WebCore {
56
57class Archive;
58class CachedFrameBase;
59class CachedPage;
60class CachedResource;
61class Chrome;
62class SharedBuffer;
63class DOMWrapperWorld;
64class Document;
65class DocumentLoader;
66class Event;
67class FormState;
68class FormSubmission;
69class FrameLoadRequest;
70class FrameLoaderClient;
71class FrameNetworkingContext;
72class HistoryItem;
73class NavigationAction;
74class NetworkingContext;
75class Node;
76class ResourceError;
77class ResourceRequest;
78class ResourceResponse;
79class SerializedScriptValue;
80class SubstituteData;
81
82enum class CachePolicy : uint8_t;
83enum class NewLoadInProgress : bool;
84enum class NavigationPolicyDecision : uint8_t;
85enum class ShouldTreatAsContinuingLoad : uint8_t;
86enum class UsedLegacyTLS : bool;
87enum class IsMainResource : bool { No, Yes };
88enum class ShouldUpdateAppInitiatedValue : bool { No, Yes };
89
90struct WindowFeatures;
91
92WEBCORE_EXPORT bool isBackForwardLoadType(FrameLoadType);
93WEBCORE_EXPORT bool isReload(FrameLoadType);
94
95using ContentPolicyDecisionFunction = Function<void(PolicyAction, PolicyCheckIdentifier)>;
96
97class FrameLoader final {
98 WTF_MAKE_FAST_ALLOCATED;
99 WTF_MAKE_NONCOPYABLE(FrameLoader);
100public:
101 FrameLoader(Frame&, UniqueRef<FrameLoaderClient>&&);
102 ~FrameLoader();
103
104 WEBCORE_EXPORT void init();
105 void initForSynthesizedDocument(const URL&);
106
107 Frame& frame() const { return m_frame; }
108
109 class PolicyChecker;
110 PolicyChecker& policyChecker() const { return *m_policyChecker; }
111
112 class HistoryController;
113 HistoryController& history() const { return *m_history; }
114 ResourceLoadNotifier& notifier() const { return m_notifier; }
115
116 class SubframeLoader;
117 SubframeLoader& subframeLoader() { return *m_subframeLoader; }
118 const SubframeLoader& subframeLoader() const { return *m_subframeLoader; }
119
120 void setupForReplace();
121
122 // FIXME: These are all functions which start loads. We have too many.
123 WEBCORE_EXPORT void loadFrameRequest(FrameLoadRequest&&, Event*, RefPtr<FormState>&&, std::optional<PrivateClickMeasurement>&& = std::nullopt); // Called by submitForm, calls loadPostRequest and loadURL.
124
125 WEBCORE_EXPORT void load(FrameLoadRequest&&);
126
127#if ENABLE(WEB_ARCHIVE) || ENABLE(MHTML)
128 WEBCORE_EXPORT void loadArchive(Ref<Archive>&&);
129#endif
130 ResourceLoaderIdentifier loadResourceSynchronously(const ResourceRequest&, ClientCredentialPolicy, const FetchOptions&, const HTTPHeaderMap&, ResourceError&, ResourceResponse&, RefPtr<SharedBuffer>& data);
131
132 WEBCORE_EXPORT void changeLocation(const URL&, const AtomString& target, Event*, const ReferrerPolicy&, ShouldOpenExternalURLsPolicy, std::optional<NewFrameOpenerPolicy> = std::nullopt, const AtomString& downloadAttribute = nullAtom(), const SystemPreviewInfo& = { }, std::optional<PrivateClickMeasurement>&& = std::nullopt);
133 void changeLocation(FrameLoadRequest&&, Event* = nullptr, std::optional<PrivateClickMeasurement>&& = std::nullopt);
134 void submitForm(Ref<FormSubmission>&&);
135
136 WEBCORE_EXPORT void reload(OptionSet<ReloadOption> = { });
137 WEBCORE_EXPORT void reloadWithOverrideEncoding(const String& overrideEncoding);
138
139 void open(CachedFrameBase&);
140
141 void retryAfterFailedCacheOnlyMainResourceLoad();
142
143 static void reportLocalLoadFailed(Frame*, const String& url);
144 static void reportBlockedLoadFailed(Frame&, const URL&);
145
146 // FIXME: These are all functions which stop loads. We have too many.
147 void stopAllLoadersAndCheckCompleteness();
148 WEBCORE_EXPORT void stopAllLoaders(ClearProvisionalItem = ClearProvisionalItem::Yes, StopLoadingPolicy = StopLoadingPolicy::PreventDuringUnloadEvents);
149 WEBCORE_EXPORT void stopForUserCancel(bool deferCheckLoadComplete = false);
150 void stopForBackForwardCache();
151 void stop();
152 void stopLoading(UnloadEventPolicy);
153 void closeURL();
154 // FIXME: clear() is trying to do too many things. We should break it down into smaller functions (ideally with fewer raw Boolean parameters).
155 void clear(RefPtr<Document>&& newDocument, bool clearWindowProperties = true, bool clearScriptObjects = true, bool clearFrameView = true, Function<void()>&& handleDOMWindowCreation = nullptr);
156
157 bool isLoading() const;
158 WEBCORE_EXPORT bool frameHasLoaded() const;
159
160 WEBCORE_EXPORT int numPendingOrLoadingRequests(bool recurse) const;
161
162 ReferrerPolicy effectiveReferrerPolicy() const;
163 String referrer() const;
164 WEBCORE_EXPORT String outgoingReferrer() const;
165 String outgoingOrigin() const;
166
167 WEBCORE_EXPORT DocumentLoader* activeDocumentLoader() const;
168 DocumentLoader* documentLoader() const { return m_documentLoader.get(); }
169 DocumentLoader* policyDocumentLoader() const { return m_policyDocumentLoader.get(); }
170 DocumentLoader* provisionalDocumentLoader() const { return m_provisionalDocumentLoader.get(); }
171 FrameState state() const { return m_state; }
172
173 bool shouldReportResourceTimingToParentFrame() const { return m_shouldReportResourceTimingToParentFrame; };
174
175#if PLATFORM(IOS_FAMILY)
176 RetainPtr<CFDictionaryRef> connectionProperties(ResourceLoader*);
177#endif
178 void receivedMainResourceError(const ResourceError&);
179
180 bool willLoadMediaElementURL(URL&, Node&);
181
182 WEBCORE_EXPORT ResourceError cancelledError(const ResourceRequest&) const;
183 WEBCORE_EXPORT ResourceError blockedByContentBlockerError(const ResourceRequest&) const;
184 ResourceError blockedError(const ResourceRequest&) const;
185#if ENABLE(CONTENT_FILTERING)
186 ResourceError blockedByContentFilterError(const ResourceRequest&) const;
187#endif
188
189 bool isReplacing() const;
190 void setReplacing();
191 bool subframeIsLoading() const;
192 void willChangeTitle(DocumentLoader*);
193 void didChangeTitle(DocumentLoader*);
194
195 bool shouldTreatURLAsSrcdocDocument(const URL&) const;
196
197 WEBCORE_EXPORT FrameLoadType loadType() const;
198
199 CachePolicy subresourceCachePolicy(const URL&) const;
200
201 void didReachLayoutMilestone(OptionSet<LayoutMilestone>);
202 void didFirstLayout();
203 void didReachVisuallyNonEmptyState();
204
205 void loadedResourceFromMemoryCache(CachedResource&, ResourceRequest& newRequest, ResourceError&);
206 void tellClientAboutPastMemoryCacheLoads();
207
208 void checkLoadComplete();
209 WEBCORE_EXPORT void detachFromParent();
210 void detachViewsAndDocumentLoader();
211
212 static void addHTTPOriginIfNeeded(ResourceRequest&, const String& origin);
213 static void addSameSiteInfoToRequestIfNeeded(ResourceRequest&, const Document* initiator = nullptr);
214
215 const FrameLoaderClient& client() const { return m_client.get(); }
216 FrameLoaderClient& client() { return m_client.get(); }
217
218 WEBCORE_EXPORT std::optional<PageIdentifier> pageID() const;
219 WEBCORE_EXPORT std::optional<FrameIdentifier> frameID() const;
220
221 void setDefersLoading(bool);
222
223 void checkContentPolicy(const ResourceResponse&, PolicyCheckIdentifier, ContentPolicyDecisionFunction&&);
224
225 void didExplicitOpen();
226
227 // Callbacks from DocumentWriter
228 void didBeginDocument(bool dispatchWindowObjectAvailable);
229
230 void receivedFirstData();
231
232 void dispatchOnloadEvents();
233 String userAgent(const URL&) const;
234 String navigatorPlatform() const;
235
236 void dispatchDidClearWindowObjectInWorld(DOMWrapperWorld&);
237 void dispatchDidClearWindowObjectsInAllWorlds();
238
239 // The following sandbox flags will be forced, regardless of changes to
240 // the sandbox attribute of any parent frames.
241 void forceSandboxFlags(SandboxFlags flags) { m_forcedSandboxFlags |= flags; }
242 WEBCORE_EXPORT SandboxFlags effectiveSandboxFlags() const;
243
244 bool checkIfFormActionAllowedByCSP(const URL&, bool didReceiveRedirectResponse, const URL& preRedirectURL) const;
245
246 WEBCORE_EXPORT Frame* opener();
247 WEBCORE_EXPORT const Frame* opener() const;
248 WEBCORE_EXPORT void setOpener(Frame*);
249 WEBCORE_EXPORT void detachFromAllOpenedFrames();
250
251 void resetMultipleFormSubmissionProtection();
252
253 void checkCallImplicitClose();
254
255 void frameDetached();
256
257 void setOutgoingReferrer(const URL&);
258
259 void loadDone(LoadCompletionType);
260 void subresourceLoadDone(LoadCompletionType);
261 void finishedParsing();
262 void checkCompleted();
263
264 WEBCORE_EXPORT bool isComplete() const;
265
266 void commitProvisionalLoad();
267
268 void setLoadsSynchronously(bool loadsSynchronously) { m_loadsSynchronously = loadsSynchronously; }
269 bool loadsSynchronously() const { return m_loadsSynchronously; }
270
271 FrameLoaderStateMachine& stateMachine() { return m_stateMachine; }
272 const FrameLoaderStateMachine& stateMachine() const { return m_stateMachine; }
273
274 // FIXME: should return RefPtr.
275 WEBCORE_EXPORT Frame* findFrameForNavigation(const AtomString& name, Document* activeDocument = nullptr);
276
277 void applyUserAgentIfNeeded(ResourceRequest&);
278
279 bool shouldInterruptLoadForXFrameOptions(const String&, const URL&, ResourceLoaderIdentifier);
280
281 void completed();
282 bool allAncestorsAreComplete() const; // including this
283 void clientRedirected(const URL&, double delay, WallTime fireDate, LockBackForwardList);
284 void clientRedirectCancelledOrFinished(NewLoadInProgress);
285
286 WEBCORE_EXPORT void setOriginalURLForDownloadRequest(ResourceRequest&);
287
288 bool quickRedirectComing() const { return m_quickRedirectComing; }
289
290 WEBCORE_EXPORT bool shouldClose();
291
292 enum class PageDismissalType { None, BeforeUnload, PageHide, Unload };
293 PageDismissalType pageDismissalEventBeingDispatched() const { return m_pageDismissalEventBeingDispatched; }
294
295 WEBCORE_EXPORT NetworkingContext* networkingContext() const;
296
297 void loadProgressingStatusChanged();
298
299 const URL& previousURL() const { return m_previousURL; }
300
301 WEBCORE_EXPORT void completePageTransitionIfNeeded();
302
303 void setOverrideCachePolicyForTesting(ResourceRequestCachePolicy policy) { m_overrideCachePolicyForTesting = policy; }
304 void setOverrideResourceLoadPriorityForTesting(ResourceLoadPriority priority) { m_overrideResourceLoadPriorityForTesting = priority; }
305 void setStrictRawResourceValidationPolicyDisabledForTesting(bool disabled) { m_isStrictRawResourceValidationPolicyDisabledForTesting = disabled; }
306 bool isStrictRawResourceValidationPolicyDisabledForTesting() { return m_isStrictRawResourceValidationPolicyDisabledForTesting; }
307
308 WEBCORE_EXPORT void clearTestingOverrides();
309
310 const URL& provisionalLoadErrorBeingHandledURL() const { return m_provisionalLoadErrorBeingHandledURL; }
311 void setProvisionalLoadErrorBeingHandledURL(const URL& url) { m_provisionalLoadErrorBeingHandledURL = url; }
312
313 bool shouldSuppressTextInputFromEditing() const;
314 bool isReloadingFromOrigin() const { return m_loadType == FrameLoadType::ReloadFromOrigin; }
315
316 // Used in webarchive loading tests.
317 void setAlwaysAllowLocalWebarchive(bool alwaysAllowLocalWebarchive) { m_alwaysAllowLocalWebarchive = alwaysAllowLocalWebarchive; }
318 bool alwaysAllowLocalWebarchive() const { return m_alwaysAllowLocalWebarchive; }
319
320 enum class IsServiceWorkerNavigationLoad : bool { No, Yes };
321 // For subresource requests the FrameLoadType parameter has no effect and can be skipped.
322 void updateRequestAndAddExtraFields(ResourceRequest&, IsMainResource, FrameLoadType = FrameLoadType::Standard, ShouldUpdateAppInitiatedValue = ShouldUpdateAppInitiatedValue::Yes, IsServiceWorkerNavigationLoad = IsServiceWorkerNavigationLoad::No, Document* = nullptr);
323
324 void scheduleRefreshIfNeeded(Document&, const String& content, IsMetaRefresh);
325
326 void switchBrowsingContextsGroup();
327
328private:
329 enum FormSubmissionCacheLoadPolicy {
330 MayAttemptCacheOnlyLoadForFormSubmissionItem,
331 MayNotAttemptCacheOnlyLoadForFormSubmissionItem
332 };
333
334 bool allChildrenAreComplete() const; // immediate children, not all descendants
335
336 void checkTimerFired();
337 void checkCompletenessNow();
338
339 void loadSameDocumentItem(HistoryItem&);
340 void loadDifferentDocumentItem(HistoryItem&, HistoryItem* fromItem, FrameLoadType, FormSubmissionCacheLoadPolicy, ShouldTreatAsContinuingLoad);
341
342 void loadProvisionalItemFromCachedPage();
343
344 void updateFirstPartyForCookies();
345 void setFirstPartyForCookies(const URL&);
346
347 ResourceRequestCachePolicy defaultRequestCachingPolicy(const ResourceRequest&, FrameLoadType, bool isMainResource);
348
349 void clearProvisionalLoad();
350 void transitionToCommitted(CachedPage*);
351 void frameLoadCompleted();
352
353 SubstituteData defaultSubstituteDataForURL(const URL&);
354
355 bool dispatchBeforeUnloadEvent(Chrome&, FrameLoader* frameLoaderBeingNavigated);
356 void dispatchUnloadEvents(UnloadEventPolicy);
357
358 void continueLoadAfterNavigationPolicy(const ResourceRequest&, FormState*, NavigationPolicyDecision, AllowNavigationToInvalidURL);
359 void continueLoadAfterNewWindowPolicy(const ResourceRequest&, FormState*, const AtomString& frameName, const NavigationAction&, ShouldContinuePolicyCheck, AllowNavigationToInvalidURL, NewFrameOpenerPolicy);
360 void continueFragmentScrollAfterNavigationPolicy(const ResourceRequest&, bool shouldContinue);
361
362 bool shouldPerformFragmentNavigation(bool isFormSubmission, const String& httpMethod, FrameLoadType, const URL&);
363 void scrollToFragmentWithParentBoundary(const URL&, bool isNewNavigation = true);
364
365 void dispatchDidFailProvisionalLoad(DocumentLoader& provisionalDocumentLoader, const ResourceError&);
366 void checkLoadCompleteForThisFrame();
367
368 void setDocumentLoader(DocumentLoader*);
369 void setPolicyDocumentLoader(DocumentLoader*);
370 void setProvisionalDocumentLoader(DocumentLoader*);
371
372 void setState(FrameState);
373
374 void closeOldDataSources();
375 void willRestoreFromCachedPage();
376
377 bool shouldReloadToHandleUnreachableURL(DocumentLoader&);
378
379 void dispatchDidCommitLoad(std::optional<HasInsecureContent> initialHasInsecureContent, std::optional<UsedLegacyTLS> initialUsedLegacyTLS);
380
381 void loadWithDocumentLoader(DocumentLoader*, FrameLoadType, RefPtr<FormState>&&, AllowNavigationToInvalidURL, CompletionHandler<void()>&& = [] { }); // Calls continueLoadAfterNavigationPolicy
382 void load(DocumentLoader&); // Calls loadWithDocumentLoader
383
384 void loadWithNavigationAction(const ResourceRequest&, NavigationAction&&, FrameLoadType, RefPtr<FormState>&&, AllowNavigationToInvalidURL, ShouldTreatAsContinuingLoad, CompletionHandler<void()>&& = [] { }); // Calls loadWithDocumentLoader
385
386 void loadPostRequest(FrameLoadRequest&&, const String& referrer, FrameLoadType, Event*, RefPtr<FormState>&&, CompletionHandler<void()>&&);
387 void loadURL(FrameLoadRequest&&, const String& referrer, FrameLoadType, Event*, RefPtr<FormState>&&, std::optional<PrivateClickMeasurement>&&, CompletionHandler<void()>&&);
388
389 bool shouldReload(const URL& currentURL, const URL& destinationURL);
390
391 void requestFromDelegate(ResourceRequest&, ResourceLoaderIdentifier&, ResourceError&);
392
393 WEBCORE_EXPORT void detachChildren();
394 void closeAndRemoveChild(Frame&);
395
396 void loadInSameDocument(URL, RefPtr<SerializedScriptValue> stateObject, bool isNewNavigation);
397
398 void prepareForLoadStart();
399 void provisionalLoadStarted();
400
401 bool didOpenURL();
402
403 void scheduleCheckCompleted();
404 void scheduleCheckLoadComplete();
405 void startCheckCompleteTimer();
406
407 bool shouldTreatURLAsSameAsCurrent(const URL&) const;
408
409 void dispatchGlobalObjectAvailableInAllWorlds();
410
411 bool isNavigationAllowed() const;
412 bool isStopLoadingAllowed() const;
413
414 enum class LoadContinuingState : uint8_t { NotContinuing, ContinuingWithRequest, ContinuingWithHistoryItem };
415 bool shouldTreatCurrentLoadAsContinuingLoad() const { return m_currentLoadContinuingState != LoadContinuingState::NotContinuing; }
416
417 // HistoryController specific.
418 void loadItem(HistoryItem&, HistoryItem* fromItem, FrameLoadType, ShouldTreatAsContinuingLoad);
419 HistoryItem* requestedHistoryItem() const { return m_requestedHistoryItem.get(); }
420
421 // SubframeLoader specific.
422 void loadURLIntoChildFrame(const URL&, const String& referer, Frame*);
423 void started();
424
425 // PolicyChecker specific.
426 void clearProvisionalLoadForPolicyCheck();
427 bool hasOpenedFrames() const;
428
429 bool preventsParentFromBeingComplete(const Frame&) const;
430
431 Frame& m_frame;
432 UniqueRef<FrameLoaderClient> m_client;
433
434 const std::unique_ptr<PolicyChecker> m_policyChecker;
435 const std::unique_ptr<HistoryController> m_history;
436 mutable ResourceLoadNotifier m_notifier;
437 const std::unique_ptr<SubframeLoader> m_subframeLoader;
438 mutable FrameLoaderStateMachine m_stateMachine;
439
440 class FrameProgressTracker;
441 std::unique_ptr<FrameProgressTracker> m_progressTracker;
442
443 FrameState m_state;
444 FrameLoadType m_loadType;
445
446 // Document loaders for the three phases of frame loading. Note that while
447 // a new request is being loaded, the old document loader may still be referenced.
448 // E.g. while a new request is in the "policy" state, the old document loader may
449 // be consulted in particular as it makes sense to imply certain settings on the new loader.
450 RefPtr<DocumentLoader> m_documentLoader;
451 RefPtr<DocumentLoader> m_provisionalDocumentLoader;
452 RefPtr<DocumentLoader> m_policyDocumentLoader;
453
454 URL m_provisionalLoadErrorBeingHandledURL;
455
456 bool m_quickRedirectComing;
457 bool m_sentRedirectNotification;
458 bool m_inStopAllLoaders;
459 bool m_inClearProvisionalLoadForPolicyCheck { false };
460 bool m_shouldReportResourceTimingToParentFrame { true };
461
462 String m_outgoingReferrer;
463
464 bool m_isExecutingJavaScriptFormAction;
465
466 bool m_didCallImplicitClose;
467 bool m_wasUnloadEventEmitted;
468
469 PageDismissalType m_pageDismissalEventBeingDispatched { PageDismissalType::None };
470 bool m_isComplete;
471
472 RefPtr<SerializedScriptValue> m_pendingStateObject;
473
474 bool m_needsClear;
475
476 URL m_submittedFormURL;
477
478 Timer m_checkTimer;
479 bool m_shouldCallCheckCompleted;
480 bool m_shouldCallCheckLoadComplete;
481
482 WeakPtr<Frame> m_opener;
483 WeakHashSet<Frame> m_openedFrames;
484
485 bool m_loadingFromCachedPage;
486
487 bool m_currentNavigationHasShownBeforeUnloadConfirmPanel;
488
489 bool m_loadsSynchronously;
490
491 SandboxFlags m_forcedSandboxFlags;
492
493 RefPtr<FrameNetworkingContext> m_networkingContext;
494
495 std::optional<ResourceRequestCachePolicy> m_overrideCachePolicyForTesting;
496 std::optional<ResourceLoadPriority> m_overrideResourceLoadPriorityForTesting;
497 bool m_isStrictRawResourceValidationPolicyDisabledForTesting { false };
498
499 LoadContinuingState m_currentLoadContinuingState { LoadContinuingState::NotContinuing };
500
501 bool m_checkingLoadCompleteForDetachment { false };
502
503 URL m_previousURL;
504 RefPtr<HistoryItem> m_requestedHistoryItem;
505
506 bool m_alwaysAllowLocalWebarchive { false };
507
508 bool m_inStopForBackForwardCache { false };
509};
510
511// This function is called by createWindow() in JSDOMWindowBase.cpp, for example, for
512// modal dialog creation. The lookupFrame is for looking up the frame name in case
513// the frame name references a frame different from the openerFrame, e.g. when it is
514// "_self" or "_parent".
515//
516// FIXME: Consider making this function part of an appropriate class (not FrameLoader)
517// and moving it to a more appropriate location.
518RefPtr<Frame> createWindow(Frame& openerFrame, Frame& lookupFrame, FrameLoadRequest&&, WindowFeatures&, bool& created);
519
520} // namespace WebCore
Note: See TracBrowser for help on using the repository browser.