Skip to content
Permalink
Browse files
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
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@293563 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
cdumez committed Apr 28, 2022
1 parent d09a083 commit e4e4bba1f291d4773b907199bb5e6976d14c223d
Show file tree
Hide file tree
Showing 161 changed files with 395 additions and 378 deletions.
@@ -195,6 +195,7 @@ bool equalIgnoringASCIICase(const AtomString&, ASCIILiteral);
bool equalIgnoringASCIICase(const AtomString&, const char*) = delete;

bool equalLettersIgnoringASCIICase(const AtomString&, ASCIILiteral);
bool startsWithLettersIgnoringASCIICase(const AtomString&, ASCIILiteral);

WTF_EXPORT_PRIVATE AtomString replaceUnpairedSurrogatesWithReplacementCharacter(AtomString&&);
WTF_EXPORT_PRIVATE String replaceUnpairedSurrogatesWithReplacementCharacter(String&&);
@@ -324,6 +325,11 @@ inline bool equalLettersIgnoringASCIICase(const AtomString& string, ASCIILiteral
return equalLettersIgnoringASCIICase(string.string(), literal);
}

inline bool startsWithLettersIgnoringASCIICase(const AtomString& string, ASCIILiteral literal)
{
return startsWithLettersIgnoringASCIICase(string.string(), literal);
}

inline bool equalIgnoringASCIICase(const AtomString& a, const AtomString& b)
{
return equalIgnoringASCIICase(a.string(), b.string());
@@ -344,6 +350,11 @@ inline bool equalIgnoringASCIICase(const AtomString& a, ASCIILiteral b)
return equalIgnoringASCIICase(a.string(), b);
}

inline int codePointCompare(const AtomString& a, const AtomString& b)
{
return codePointCompare(a.string(), b.string());
}

template<> struct IntegerToStringConversionTrait<AtomString> {
using ReturnType = AtomString;
using AdditionalArgumentType = void;
@@ -419,7 +419,7 @@ class StringImpl : private StringImplShape {

Ref<StringImpl> foldCase();

Ref<StringImpl> stripWhiteSpace();
WTF_EXPORT_PRIVATE Ref<StringImpl> stripWhiteSpace();
WTF_EXPORT_PRIVATE Ref<StringImpl> simplifyWhiteSpace();
Ref<StringImpl> simplifyWhiteSpace(CodeUnitMatchFunction);

@@ -131,9 +131,9 @@ ExceptionOr<Ref<FetchResponse>> FetchResponse::create(ScriptExecutionContext& co
r->suspendIfNeeded();

r->m_contentType = contentType;
auto mimeType = extractMIMETypeFromMediaType(contentType);
r->m_internalResponse.setMimeType(mimeType.isEmpty() ? defaultMIMEType() : mimeType);
r->m_internalResponse.setTextEncodingName(extractCharsetFromMediaType(contentType).toString());
AtomString mimeType { extractMIMETypeFromMediaType(contentType) };
r->m_internalResponse.setMimeType(mimeType.isEmpty() ? AtomString { defaultMIMEType() } : mimeType);
r->m_internalResponse.setTextEncodingName(extractCharsetFromMediaType(contentType).toAtomString());

r->m_internalResponse.setHTTPStatusCode(status);
r->m_internalResponse.setHTTPStatusText(statusText);
@@ -38,7 +38,7 @@ void HighlightRegister::initializeMapLike(DOMMapAdapter& map)
map.set<IDLDOMString, IDLInterface<Highlight>>(keyValue.key, keyValue.value);
}

void HighlightRegister::setFromMapLike(String&& key, Ref<Highlight>&& value)
void HighlightRegister::setFromMapLike(AtomString&& key, Ref<Highlight>&& value)
{
m_map.set(WTFMove(key), WTFMove(value));
}
@@ -48,7 +48,7 @@ void HighlightRegister::clear()
m_map.clear();
}

bool HighlightRegister::remove(const String& key)
bool HighlightRegister::remove(const AtomString& key)
{
return m_map.remove(key);
}
@@ -42,9 +42,9 @@ class HighlightRegister : public RefCounted<HighlightRegister> {
static Ref<HighlightRegister> create() { return adoptRef(*new HighlightRegister); }

void initializeMapLike(DOMMapAdapter&);
void setFromMapLike(String&&, Ref<Highlight>&&);
void setFromMapLike(AtomString&&, Ref<Highlight>&&);
void clear();
bool remove(const String&);
bool remove(const AtomString&);


HighlightVisibility highlightsVisibility() const { return m_highlightVisibility; }
@@ -53,11 +53,11 @@ class HighlightRegister : public RefCounted<HighlightRegister> {
#endif

WEBCORE_EXPORT void addAnnotationHighlightWithRange(Ref<StaticRange>&&);
const HashMap<String, Ref<Highlight>>& map() const { return m_map; }
const HashMap<AtomString, Ref<Highlight>>& map() const { return m_map; }

private:
HighlightRegister() = default;
HashMap<String, Ref<Highlight>> m_map;
HashMap<AtomString, Ref<Highlight>> m_map;

HighlightVisibility m_highlightVisibility { HighlightVisibility::Hidden };
};
@@ -29,5 +29,5 @@
] interface HighlightRegister {
constructor();

maplike<DOMString, Highlight>;
maplike<[AtomString] DOMString, Highlight>;
};
@@ -27,7 +27,7 @@
[
Exposed=(Window,Worker)
] interface IDBVersionChangeEvent : Event {
constructor(DOMString type, optional IDBVersionChangeEventInit eventInitDict);
constructor([AtomString] DOMString type, optional IDBVersionChangeEventInit eventInitDict);
readonly attribute unsigned long long oldVersion;
readonly attribute unsigned long long? newVersion;
};
@@ -29,7 +29,7 @@
EnabledBySetting=PeerConnectionEnabled,
Exposed=Window
] interface RTCDTMFToneChangeEvent : Event {
constructor(DOMString type, optional RTCDTMFToneChangeEventInit eventInitDict);
constructor([AtomString] DOMString type, optional RTCDTMFToneChangeEventInit eventInitDict);

readonly attribute DOMString tone;
};
@@ -43,7 +43,7 @@
readonly attribute RTCPriorityType priority;
attribute unsigned long bufferedAmountLowThreshold;

attribute DOMString binaryType;
attribute [AtomString] DOMString binaryType;

undefined send(ArrayBuffer data);
undefined send(ArrayBufferView data);
@@ -28,7 +28,7 @@
EnabledBySetting=PeerConnectionEnabled,
Exposed=Window
] interface RTCDataChannelEvent : Event {
constructor(DOMString type, RTCDataChannelEventInit eventInitDict);
constructor([AtomString] DOMString type, RTCDataChannelEventInit eventInitDict);

readonly attribute RTCDataChannel channel;
};
@@ -36,7 +36,7 @@
EnabledBySetting=PictureInPictureAPIEnabled,
Exposed=Window
] interface PictureInPictureEvent : Event {
constructor(DOMString type, PictureInPictureEventInit eventInitDict);
constructor([AtomString] DOMString type, PictureInPictureEventInit eventInitDict);

[SameObject] readonly attribute PictureInPictureWindow pictureInPictureWindow;
};
@@ -31,6 +31,6 @@
JSGenerateToNativeObject,
SecureContext
] interface PushEvent : ExtendableEvent {
constructor(DOMString type, optional PushEventInit eventInitDict);
constructor([AtomString] DOMString type, optional PushEventInit eventInitDict);
readonly attribute PushMessageData? data;
};
@@ -31,7 +31,7 @@
JSGenerateToNativeObject,
SecureContext
] interface PushSubscriptionChangeEvent : ExtendableEvent {
constructor(DOMString type, optional PushSubscriptionChangeEventInit eventInitDict);
constructor([AtomString] DOMString type, optional PushSubscriptionChangeEventInit eventInitDict);
readonly attribute PushSubscription? newSubscription;
readonly attribute PushSubscription? oldSubscription;
};
@@ -28,7 +28,7 @@
Conditional=SPEECH_SYNTHESIS,
Exposed=Window
] interface SpeechSynthesisErrorEvent : SpeechSynthesisEvent {
constructor(DOMString type, SpeechSynthesisErrorEventInit eventInitDict);
constructor([AtomString] DOMString type, SpeechSynthesisErrorEventInit eventInitDict);

readonly attribute SpeechSynthesisErrorCode error;
};
@@ -28,7 +28,7 @@
JSGenerateToJSObject,
Exposed=Window
] interface AudioProcessingEvent : Event {
[EnabledBySetting=WebAudioEnabled] constructor (DOMString type, AudioProcessingEventInit eventInitDict);
[EnabledBySetting=WebAudioEnabled] constructor ([AtomString] DOMString type, AudioProcessingEventInit eventInitDict);
readonly attribute double playbackTime;
readonly attribute AudioBuffer inputBuffer;
readonly attribute AudioBuffer outputBuffer;
@@ -28,7 +28,7 @@
JSGenerateToJSObject,
Exposed=Window
] interface OfflineAudioCompletionEvent : Event {
constructor (DOMString type, OfflineAudioCompletionEventInit eventInitDict);
constructor ([AtomString] DOMString type, OfflineAudioCompletionEventInit eventInitDict);

readonly attribute AudioBuffer renderedBuffer;
};
@@ -221,7 +221,7 @@ int WebSocketHandshake::readServerHandshake(const uint8_t* header, size_t len)
{
m_mode = Incomplete;
int statusCode;
String statusText;
AtomString statusText;
int lineLength = readStatusLine(header, len, statusCode, statusText);
if (lineLength == -1)
return -1;
@@ -357,14 +357,14 @@ static inline bool headerHasValidHTTPVersion(StringView httpStatusLine)
// Returns the header length (including "\r\n"), or -1 if we have not received enough data yet.
// If the line is malformed or the status code is not a 3-digit number,
// statusCode and statusText will be set to -1 and a null string, respectively.
int WebSocketHandshake::readStatusLine(const uint8_t* header, size_t headerLength, int& statusCode, String& statusText)
int WebSocketHandshake::readStatusLine(const uint8_t* header, size_t headerLength, int& statusCode, AtomString& statusText)
{
// Arbitrary size limit to prevent the server from sending an unbounded
// amount of data with no newlines and forcing us to buffer it all.
static const int maximumLength = 1024;

statusCode = -1;
statusText = String();
statusText = nullAtom();

const uint8_t* space1 = nullptr;
const uint8_t* space2 = nullptr;
@@ -427,7 +427,7 @@ int WebSocketHandshake::readStatusLine(const uint8_t* header, size_t headerLengt
}

statusCode = parseInteger<int>(statusCodeString).value();
statusText = String(space2 + 1, end - space2 - 3); // Exclude "\r\n".
statusText = AtomString(space2 + 1, end - space2 - 3); // Exclude "\r\n".
return lineLength;
}

@@ -88,7 +88,7 @@ class WebSocketHandshake {

private:

int readStatusLine(const uint8_t* header, size_t headerLength, int& statusCode, String& statusText);
int readStatusLine(const uint8_t* header, size_t headerLength, int& statusCode, AtomString& statusText);

// Reads all headers except for the two predefined ones.
const uint8_t* readHTTPHeaders(const uint8_t* start, const uint8_t* end);
@@ -26,7 +26,7 @@
[
Exposed=Window
] interface AnimationPlaybackEvent : Event {
constructor(DOMString type, optional AnimationPlaybackEventInit eventInitDict);
constructor([AtomString] DOMString type, optional AnimationPlaybackEventInit eventInitDict);

[ImplementedAs=bindingsCurrentTime] readonly attribute double? currentTime;
[ImplementedAs=bindingsTimelineTime] readonly attribute double? timelineTime;
@@ -2812,7 +2812,7 @@ inline static bool isFlexOrGridItem(RenderObject* renderer)
return box.isFlexItem() || box.isGridItem();
}

RefPtr<CSSValue> ComputedStyleExtractor::customPropertyValue(const String& propertyName)
RefPtr<CSSValue> ComputedStyleExtractor::customPropertyValue(const AtomString& propertyName)
{
Element* styledElement = m_element.get();
if (!styledElement)
@@ -2838,7 +2838,7 @@ RefPtr<CSSValue> ComputedStyleExtractor::customPropertyValue(const String& prope
});
}

String ComputedStyleExtractor::customPropertyText(const String& propertyName)
String ComputedStyleExtractor::customPropertyText(const AtomString& propertyName)