source: webkit/trunk/Source/WebCore/loader/PingLoader.cpp

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

Prepare WebCore for making the String(const char*) constructor explicit
https://bugs.webkit.org/show_bug.cgi?id=238408

Reviewed by Geoff Garen.

Prepare WebCore for making the String(const char*) constructor explicit.
Making this constructor explicit helps findings cases where a String is constructed
from a literal without the ""_s suffix.

Source/WebCore:

  • Scripts/SettingsTemplates/Settings.cpp.erb:
  • contentextensions/ContentExtensionError.cpp:
  • contentextensions/ContentExtensionError.h:
  • css/MediaQueryEvaluator.cpp:

(WebCore::MediaQueryEvaluator::mediaAttributeMatches):

  • dom/BroadcastChannel.cpp:

(WebCore::BroadcastChannel::postMessage):

  • dom/DataTransfer.cpp:

(WebCore::normalizeType):
(WebCore::IEOpFromDragOp):

  • dom/Document.cpp:

(WebCore::Document::compatMode const):
(WebCore::Document::characterSetWithUTF8Fallback const):
(WebCore::Document::processMetaHttpEquiv):
(WebCore::Document::setDomain):
(WebCore::Document::execCommand):
(WebCore::Document::queryCommandEnabled):
(WebCore::Document::queryCommandIndeterm):
(WebCore::Document::queryCommandState):
(WebCore::Document::queryCommandSupported):
(WebCore::Document::queryCommandValue):
(WebCore::Document::updateResizeObservations):

  • dom/Element.cpp:

(WebCore::Element::setOuterHTML):
(WebCore::Element::animate):

  • dom/ImageOverlay.cpp:

(WebCore::ImageOverlay::updateWithTextRecognitionResult):

  • dom/Node.cpp:

(WebCore::Node::showTreeForThisAcrossFrame const):

  • dom/ProcessingInstruction.cpp:

(WebCore::ProcessingInstruction::checkStyleSheet):

  • dom/ViewportArguments.cpp:

(WebCore::viewportErrorMessageTemplate):
(WebCore::viewportErrorMessage):

  • editing/Editor.cpp:

(WebCore::Editor::toggleBold):
(WebCore::Editor::toggleUnderline):
(WebCore::Editor::setBaseWritingDirection):

  • editing/EditorCommand.cpp:

(WebCore::isStylePresent):
(WebCore::executeToggleStyle):
(WebCore::stateStyle):
(WebCore::textDecorationChangeForToggling):

  • editing/InsertLineBreakCommand.cpp:

(WebCore::InsertLineBreakCommand::doApply):

  • editing/InsertTextCommand.cpp:

(WebCore::InsertTextCommand::insertTab):

  • editing/ReplaceSelectionCommand.cpp:

(WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
(WebCore::ReplaceSelectionCommand::addSpacesForSmartReplace):

  • editing/TextManipulationController.cpp:

(WebCore::TextManipulationController::observeParagraphs):

  • editing/TypingCommand.cpp:

(WebCore::TypingCommand::insertLineBreakAndNotifyAccessibility):
(WebCore::TypingCommand::insertParagraphSeparatorAndNotifyAccessibility):
(WebCore::TypingCommand::insertParagraphSeparatorInQuotedContentAndNotifyAccessibility):

  • editing/markup.cpp:

(WebCore::createPageForSanitizingWebContent):

  • fileapi/BlobURL.cpp:

(WebCore::BlobURL::createInternalURL):

  • fileapi/FileReaderLoader.cpp:

(WebCore::FileReaderLoader::start):
(WebCore::FileReaderLoader::convertToText):
(WebCore::FileReaderLoader::convertToDataURL):

  • history/BackForwardCache.cpp:

(WebCore::BackForwardCache::BackForwardCache):

  • html/EmailInputType.cpp:
  • html/EnterKeyHint.cpp:

(WebCore::attributeValueForEnterKeyHint):

  • html/FTPDirectoryDocument.cpp:

(WebCore::FTPDirectoryDocumentParser::createBasicDocument):

  • html/HTMLAnchorElement.cpp:

(WebCore::HTMLAnchorElement::handleClick):

  • html/HTMLFrameElementBase.cpp:

(WebCore::HTMLFrameElementBase::parseAttribute):

  • html/HTMLImageElement.cpp:

(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
(WebCore::HTMLImageElement::evaluateDynamicMediaQueryDependencies):

  • html/HTMLInputElement.cpp:

(WebCore::HTMLInputElement::showPicker):

  • html/HTMLMediaElement.cpp:

(WebCore::HTMLMediaElement::play):
(WebCore::HTMLMediaElement::selectNextSourceChild):
(WebCore::HTMLMediaElement::updateSleepDisabling):

  • html/HTMLObjectElement.cpp:

(WebCore::HTMLObjectElement::parametersForPlugin):

  • html/ImageBitmap.cpp:

(WebCore::ImageBitmap::createPromise):
(WebCore::croppedSourceRectangleWithFormatting):
(WebCore::ImageBitmap::createFromBuffer):

  • html/ImageDocument.cpp:

(WebCore::ImageDocument::createDocumentStructure):

  • html/MediaFragmentURIParser.cpp:

(WebCore::MediaFragmentURIParser::parseFragments):

  • html/PDFDocument.cpp:

(WebCore::PDFDocument::sendPDFArrayBuffer):

  • html/canvas/ANGLEInstancedArrays.cpp:

(WebCore::ANGLEInstancedArrays::ANGLEInstancedArrays):
(WebCore::ANGLEInstancedArrays::supported):

  • html/canvas/EXTTextureCompressionRGTC.cpp:

(WebCore::EXTTextureCompressionRGTC::EXTTextureCompressionRGTC):

  • html/canvas/WebGL2RenderingContext.cpp:

(WebCore::WebGL2RenderingContext::initializeShaderExtensions):

  • html/canvas/WebGLCompressedTextureATC.cpp:

(WebCore::WebGLCompressedTextureATC::WebGLCompressedTextureATC):
(WebCore::WebGLCompressedTextureATC::supported):

  • html/canvas/WebGLCompressedTextureETC.cpp:

(WebCore::WebGLCompressedTextureETC::WebGLCompressedTextureETC):
(WebCore::WebGLCompressedTextureETC::supported):

  • html/canvas/WebGLCompressedTextureETC1.cpp:

(WebCore::WebGLCompressedTextureETC1::WebGLCompressedTextureETC1):
(WebCore::WebGLCompressedTextureETC1::supported):

  • html/canvas/WebGLCompressedTexturePVRTC.cpp:

(WebCore::WebGLCompressedTexturePVRTC::WebGLCompressedTexturePVRTC):
(WebCore::WebGLCompressedTexturePVRTC::supported):

  • html/canvas/WebGLCompressedTextureS3TC.cpp:

(WebCore::WebGLCompressedTextureS3TC::WebGLCompressedTextureS3TC):
(WebCore::WebGLCompressedTextureS3TC::supported):

  • html/canvas/WebGLCompressedTextureS3TCsRGB.cpp:

(WebCore::WebGLCompressedTextureS3TCsRGB::WebGLCompressedTextureS3TCsRGB):
(WebCore::WebGLCompressedTextureS3TCsRGB::supported):

  • html/canvas/WebGLDebugShaders.cpp:

(WebCore::WebGLDebugShaders::WebGLDebugShaders):

  • html/canvas/WebGLDepthTexture.cpp:

(WebCore::WebGLDepthTexture::WebGLDepthTexture):
(WebCore::WebGLDepthTexture::supported):

  • html/canvas/WebGLDrawBuffers.cpp:

(WebCore::WebGLDrawBuffers::WebGLDrawBuffers):
(WebCore::WebGLDrawBuffers::supported):
(WebCore::WebGLDrawBuffers::satisfiesWebGLRequirements):

  • html/canvas/WebGLRenderingContextBase.cpp:

(WebCore::WebGLRenderingContextBase::create):
(WebCore::WebGLRenderingContextBase::setupFlags):
(WebCore::WebGLRenderingContextBase::getActiveUniform):
(WebCore::WebGLRenderingContextBase::addExtensionSupportedFormatsAndTypes):
(WebCore::WebGLRenderingContextBase::loseContextImpl):
(WebCore::WebGLRenderingContextBase::printToConsole):
(WebCore::WebGLRenderingContextBase::maybeRestoreContext):
(WebCore::WebGLRenderingContextBase::recycleContext):

  • html/parser/CSSPreloadScanner.cpp:

(WebCore::CSSPreloadScanner::emitRule):

  • html/parser/HTMLParserIdioms.cpp:

(WebCore::serializeForNumberType):

  • html/parser/HTMLPreloadScanner.cpp:

(WebCore::TokenPreloadScanner::initiatorFor):
(WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):

  • html/parser/HTMLPreloadScanner.h:
  • html/parser/HTMLResourcePreloader.h:

(WebCore::PreloadRequest::PreloadRequest):

  • html/track/TextTrackCue.cpp:

(WebCore::TextTrackCue::create):

  • html/track/TextTrackCueGeneric.cpp:

(WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):

  • html/track/VTTCue.cpp:

(WebCore::VTTCueBox::applyCSSProperties):

  • html/track/WebVTTParser.cpp:

(WebCore::WebVTTParser::WebVTTParser):
(WebCore::WebVTTTreeBuilder::constructTreeFromToken):

  • inspector/InspectorAuditAccessibilityObject.cpp:

(WebCore::InspectorAuditAccessibilityObject::getComputedProperties):

  • inspector/InspectorCanvas.cpp:

(WebCore::InspectorCanvas::indexForData):
(WebCore::InspectorCanvas::buildArrayForCanvasPattern):

  • inspector/InspectorFrontendClientLocal.cpp:
  • inspector/InspectorFrontendHost.cpp:
  • inspector/InspectorOverlay.cpp:

(WebCore::InspectorOverlay::setGridOverlayForNode):
(WebCore::InspectorOverlay::clearGridOverlayForNode):
(WebCore::InspectorOverlay::setFlexOverlayForNode):
(WebCore::InspectorOverlay::clearFlexOverlayForNode):

  • inspector/InspectorStyleSheet.cpp:

(WebCore::InspectorStyle::buildObjectForStyle const):
(WebCore::InspectorStyle::styleWithProperties const):
(WebCore::selectorsFromSource):

  • inspector/agents/InspectorAnimationAgent.cpp:

(WebCore::InspectorAnimationAgent::resolveAnimation):

  • inspector/agents/InspectorCSSAgent.cpp:

(WebCore::InspectorCSSAgent::getFontDataForNode):
(WebCore::InspectorCSSAgent::getStyleSheet):
(WebCore::InspectorCSSAgent::setRuleSelector):
(WebCore::InspectorCSSAgent::addRule):

  • inspector/agents/InspectorCanvasAgent.cpp:

(WebCore::InspectorCanvasAgent::resolveContext):

  • inspector/agents/InspectorDOMAgent.cpp:

(WebCore::InspectorDOMAgent::getSupportedEventNames):
(WebCore::InspectorDOMAgent::showGridOverlay):
(WebCore::InspectorDOMAgent::showFlexOverlay):

  • inspector/agents/InspectorDOMDebuggerAgent.cpp:

(WebCore::InspectorDOMDebuggerAgent::setEventBreakpoint):
(WebCore::InspectorDOMDebuggerAgent::removeEventBreakpoint):
(WebCore::InspectorDOMDebuggerAgent::breakOnURLIfNeeded):

  • inspector/agents/InspectorDOMStorageAgent.cpp:

(WebCore::InspectorDOMStorageAgent::findStorageArea):

  • inspector/agents/InspectorDatabaseAgent.cpp:

(WebCore::InspectorDatabaseAgent::executeSQL):

  • inspector/agents/InspectorIndexedDBAgent.cpp:

(WebCore::Inspector::ExecutableWithDatabase::start):

  • inspector/agents/InspectorLayerTreeAgent.cpp:

(WebCore::InspectorLayerTreeAgent::buildObjectForLayer):

  • inspector/agents/InspectorNetworkAgent.cpp:

(WebCore::InspectorNetworkAgent::resolveWebSocket):

  • inspector/agents/InspectorPageAgent.cpp:

(WebCore::parseCookieObject):

  • inspector/agents/page/PageDOMDebuggerAgent.cpp:

(WebCore::PageDOMDebuggerAgent::setDOMBreakpoint):
(WebCore::PageDOMDebuggerAgent::removeDOMBreakpoint):
(WebCore::PageDOMDebuggerAgent::willInsertDOMNode):
(WebCore::PageDOMDebuggerAgent::willRemoveDOMNode):
(WebCore::PageDOMDebuggerAgent::buildPauseDataForDOMBreakpoint):

  • layout/Verification.cpp:

(WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):

  • layout/integration/LayoutIntegrationCoverage.cpp:

(WebCore::LayoutIntegration::canUseForLineLayoutWithReason):

  • loader/ContentFilter.h:

(WebCore::ContentFilter::urlScheme):

  • loader/CrossOriginAccessControl.cpp:

(WebCore::createAccessControlPreflightRequest):

  • loader/CrossOriginPreflightResultCache.cpp:

(WebCore::CrossOriginPreflightResultCacheItem::allowsCrossOriginMethod const):
(WebCore::CrossOriginPreflightResultCacheItem::validateCrossOriginHeaders const):

  • loader/DocumentLoader.cpp:

(WebCore::DocumentLoader::maybeLoadEmpty):

  • loader/DocumentThreadableLoader.cpp:

(WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
(WebCore::DocumentThreadableLoader::checkURLSchemeAsCORSEnabled):
(WebCore::DocumentThreadableLoader::cancel):
(WebCore::DocumentThreadableLoader::loadRequest):

  • loader/FormSubmission.cpp:

(WebCore::FormSubmission::create):
(WebCore::FormSubmission::populateFrameLoadRequest):

  • loader/FrameLoader.cpp:

(WebCore::FrameLoader::updateRequestAndAddExtraFields):
(WebCore::FrameLoader::loadPostRequest):
(WebCore::FrameLoader::loadDifferentDocumentItem):

  • loader/ImageLoader.cpp:

(WebCore::rejectPromises):
(WebCore::ImageLoader::rejectDecodePromises):
(WebCore::ImageLoader::notifyFinished):
(WebCore::ImageLoader::decode):

  • loader/ImageLoader.h:
  • loader/MixedContentChecker.cpp:

(WebCore::logWarning):
(WebCore::MixedContentChecker::canDisplayInsecureContent):
(WebCore::MixedContentChecker::canRunInsecureContent):

  • loader/PingLoader.cpp:

(WebCore::PingLoader::sendPing):

  • loader/ResourceLoadStatistics.cpp:

(WebCore::encodeFontHashSet):
(WebCore::encodeCanvasActivityRecord):
(WebCore::ResourceLoadStatistics::encode const):
(WebCore::decodeHashCountedSet):
(WebCore::decodeFontHashSet):
(WebCore::decodeCanvasActivityRecord):
(WebCore::ResourceLoadStatistics::decode):
(WebCore::ResourceLoadStatistics::toString const):

  • loader/ResourceLoader.cpp:

(WebCore::ResourceLoader::start):
(WebCore::ResourceLoader::loadDataURL):

  • loader/ServerTimingParser.cpp:

(WebCore::ServerTimingParser::parseServerTiming):

  • loader/SubresourceLoader.cpp:

(WebCore::SubresourceLoader::didReceiveResponse):

  • loader/TextResourceDecoder.cpp:

(WebCore::TextResourceDecoder::textFromUTF8):

  • loader/archive/cf/LegacyWebArchive.cpp:

(WebCore::LegacyWebArchive::create):
(WebCore::LegacyWebArchive::createFromSelection):

  • loader/cache/CachedApplicationManifest.cpp:

(WebCore::CachedApplicationManifest::CachedApplicationManifest):
(WebCore::CachedApplicationManifest::encoding const):

  • loader/cache/CachedCSSStyleSheet.cpp:

(WebCore::CachedCSSStyleSheet::CachedCSSStyleSheet):
(WebCore::CachedCSSStyleSheet::didAddClient):
(WebCore::CachedCSSStyleSheet::encoding const):
(WebCore::CachedCSSStyleSheet::checkNotify):

  • loader/cache/CachedResource.cpp:

(WebCore::CachedResource::load):

  • loader/cache/CachedSVGDocument.cpp:

(WebCore::CachedSVGDocument::CachedSVGDocument):
(WebCore::CachedSVGDocument::encoding const):

  • loader/cache/CachedSVGFont.cpp:

(WebCore::CachedSVGFont::ensureCustomFontData):

  • loader/cache/CachedScript.cpp:

(WebCore::CachedScript::encoding const):

  • loader/cache/CachedXSLStyleSheet.cpp:

(WebCore::CachedXSLStyleSheet::CachedXSLStyleSheet):
(WebCore::CachedXSLStyleSheet::encoding const):

  • loader/cache/MemoryCache.cpp:

(WebCore::MemoryCache::MemoryCache):
(WebCore::MemoryCache::originsWithCache const):

  • mathml/MathMLElement.cpp:

(WebCore::convertMathSizeIfNeeded):

  • page/CaptionUserPreferencesMediaAF.cpp:

(WebCore::CaptionUserPreferencesMediaAF::captionsTextEdgeCSS const):

  • page/Chrome.cpp:

(WebCore::Chrome::print):

  • page/ContextMenuController.cpp:

(WebCore::ContextMenuController::contextMenuItemSelected):
(WebCore::ContextMenuController::checkOrEnableIfNeeded const):

  • page/DOMSelection.cpp:

(WebCore::DOMSelection::extend):

  • page/DOMWindow.cpp:

(WebCore::DOMWindow::print):
(WebCore::DOMWindow::alert):
(WebCore::DOMWindow::confirmForBindings):
(WebCore::DOMWindow::prompt):
(WebCore::DOMWindow::showModalDialog):

  • page/EventHandler.cpp:

(WebCore::handleKeyboardSelectionMovement):

  • page/EventSource.cpp:

(WebCore::EventSource::connect):

  • page/Frame.cpp:

(WebCore::createRegExpForLabels):
(WebCore::matchLabelsAgainstString):

  • page/FrameView.cpp:

(WebCore::FrameView::adjustMediaTypeForPrinting):

  • page/IntersectionObserver.cpp:

(WebCore::parseRootMargin):
(WebCore::IntersectionObserver::create):

  • page/LoggedInStatus.cpp:

(WebCore::LoggedInStatus::create):

  • page/NavigatorBase.cpp:
  • page/Page.cpp:

(WebCore::Page::userStyleSheet const):

  • page/Quirks.cpp:

(WebCore::Quirks::triggerOptionalStorageAccessQuirk const):

  • page/WindowFeatures.cpp:

(WebCore::parseDialogFeatures):
(WebCore::boolFeature):
(WebCore::floatFeature):

  • page/csp/ContentSecurityPolicy.cpp:

(WebCore::consoleMessageForViolation):
(WebCore::ContentSecurityPolicy::allowEval const):
(WebCore::ContentSecurityPolicy::reportInvalidPluginTypes const):

  • page/csp/ContentSecurityPolicyDirectiveList.cpp:

(WebCore::ContentSecurityPolicyDirectiveList::shouldReportSample const):

  • page/csp/ContentSecurityPolicyDirectiveNames.cpp:
  • page/csp/ContentSecurityPolicyDirectiveNames.h:
  • platform/LegacySchemeRegistry.cpp:

(WebCore::allBuiltinSchemes):

  • platform/LocalizedStrings.cpp:

(WebCore::AXMenuListPopupActionVerb):
(WebCore::AXMenuListActionVerb):
(WebCore::AXListItemActionVerb):

  • platform/SleepDisabler.cpp:

(WebCore::SleepDisabler::SleepDisabler):

  • platform/SleepDisabler.h:
  • platform/audio/HRTFDatabase.cpp:

(WebCore::HRTFDatabase::HRTFDatabase):

  • platform/encryptedmedia/CDMPrivate.cpp:

(WebCore::CDMPrivate::getSupportedCapabilitiesForAudioVideoType):

  • platform/encryptedmedia/clearkey/CDMClearKey.cpp:

(WebCore::parseLicenseFormat):
(WebCore::parseLicenseReleaseAcknowledgementFormat):
(WebCore::extractKeyidsFromCencInitData):
(WebCore::extractKeyIdFromWebMInitData):
(WebCore::CDMInstanceSessionClearKey::removeSessionData):

  • platform/graphics/Font.cpp:

(WebCore::Font::description const):

  • platform/graphics/GraphicsTypes.cpp:
  • platform/graphics/InbandGenericCue.cpp:

(WebCore::InbandGenericCue::toJSONString const):

  • platform/graphics/MediaPlayer.cpp:
  • platform/graphics/avfoundation/FormatDescriptionUtilities.cpp:

(WebCore::codecFromFormatDescription):

  • platform/graphics/ca/GraphicsLayerCA.cpp:

(WebCore::GraphicsLayerCA::updateAnimations):

  • platform/graphics/cg/PDFDocumentImage.cpp:

(WebCore::PDFDocumentImage::filenameExtension const):

  • platform/graphics/cocoa/VP9UtilitiesCocoa.mm:

(WebCore::createVideoInfoFromVP9HeaderParser):
(WebCore::createVideoInfoFromVP8Header):

  • platform/graphics/cocoa/VideoTrackPrivateWebM.cpp:

(WebCore::VideoTrackPrivateWebM::codec const):

  • platform/graphics/filters/FEBlend.cpp:

(WebCore::FEBlend::externalRepresentation const):

  • platform/graphics/opengl/GraphicsContextGLOpenGL.cpp:

(WebCore::GraphicsContextGLOpenGL::validateDepthStencil):

  • platform/ios/QuickLook.h:
  • platform/ios/QuickLook.mm:
  • platform/mediastream/RealtimeMediaSourceCenter.cpp:

(WebCore::RealtimeMediaSourceCenter::hashStringWithSalt):

  • platform/mock/RTCNotifiersMock.cpp:

(WebCore::RemoteDataChannelNotifier::fire):

  • platform/mock/ScrollbarsControllerMock.cpp:

(WebCore::ScrollbarsControllerMock::mouseEnteredContentArea):
(WebCore::ScrollbarsControllerMock::mouseMovedInContentArea):
(WebCore::ScrollbarsControllerMock::mouseExitedContentArea):

  • platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:

(WebCore::mimeTypeCache):

  • platform/network/BlobResourceHandle.cpp:

(WebCore::BlobResourceHandle::loadResourceSynchronously):
(WebCore::BlobResourceHandle::notifyResponseOnError):

  • platform/network/DataURLDecoder.cpp:

(WebCore::DataURLDecoder::DecodeTask::process):

  • platform/network/HTTPParsers.cpp:

(WebCore::parseStructuredFieldValue):
(WebCore::parseHTTPHeader):

  • platform/network/NetworkStorageSession.cpp:

(WebCore::NetworkStorageSession::storageAccessQuirks):

  • platform/network/ParsedContentType.cpp:

(WebCore::ParsedContentType::charset const):

  • platform/network/ResourceResponseBase.cpp:

(WebCore::ResourceResponseBase::filter):

  • platform/network/cf/DNSResolveQueueCFNet.cpp:

(WebCore::DNSResolveQueueCFNet::updateIsUsingProxy):

  • platform/network/cf/SocketStreamHandleImplCFNet.cpp:

(WebCore::SocketStreamHandleImpl::SocketStreamHandleImpl):
(WebCore::SocketStreamHandleImpl::addCONNECTCredentials):
(WebCore::SocketStreamHandleImpl::readStreamCallback):

  • platform/sql/SQLiteDatabase.cpp:

(WebCore::SQLiteDatabase::authorizerFunction):

  • rendering/RenderAttachment.h:
  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::renderName const):

  • rendering/RenderBlock.h:
  • rendering/RenderButton.h:
  • rendering/RenderCombineText.h:
  • rendering/RenderCounter.cpp:

(WebCore::RenderCounter::renderName const):

  • rendering/RenderCounter.h:
  • rendering/RenderDeprecatedFlexibleBox.cpp:

(WebCore::RenderDeprecatedFlexibleBox::renderName const):

  • rendering/RenderDeprecatedFlexibleBox.h:
  • rendering/RenderDetailsMarker.h:
  • rendering/RenderEmbeddedObject.h:
  • rendering/RenderFileUploadControl.h:
  • rendering/RenderFlexibleBox.cpp:

(WebCore::RenderFlexibleBox::renderName const):

  • rendering/RenderFlexibleBox.h:
  • rendering/RenderFragmentContainer.h:
  • rendering/RenderFragmentContainerSet.h:
  • rendering/RenderFragmentedFlow.h:
  • rendering/RenderFrame.h:
  • rendering/RenderFrameSet.h:
  • rendering/RenderFullScreen.h:
  • rendering/RenderGrid.cpp:

(WebCore::RenderGrid::renderName const):

  • rendering/RenderGrid.h:
  • rendering/RenderHTMLCanvas.h:
  • rendering/RenderIFrame.h:
  • rendering/RenderImage.h:
  • rendering/RenderInline.cpp:

(WebCore::RenderInline::renderName const):

  • rendering/RenderInline.h:
  • rendering/RenderLayerBacking.cpp:

(WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
(WebCore::RenderLayerBacking::ensureClippingStackLayers):
(WebCore::RenderLayerBacking::updateDescendantClippingLayer):
(WebCore::RenderLayerBacking::updateOverflowControlsLayers):
(WebCore::RenderLayerBacking::updateMaskingLayer):
(WebCore::RenderLayerBacking::updateChildClippingStrategy):
(WebCore::RenderLayerBacking::updateScrollingLayers):

  • rendering/RenderLineBreak.h:
  • rendering/RenderListBox.h:
  • rendering/RenderListItem.h:
  • rendering/RenderListMarker.h:
  • rendering/RenderMedia.h:
  • rendering/RenderMenuList.h:
  • rendering/RenderMeter.h:
  • rendering/RenderModel.h:
  • rendering/RenderMultiColumnFlow.cpp:

(WebCore::RenderMultiColumnFlow::renderName const):

  • rendering/RenderMultiColumnFlow.h:
  • rendering/RenderMultiColumnSet.cpp:

(WebCore::RenderMultiColumnSet::renderName const):

  • rendering/RenderMultiColumnSet.h:
  • rendering/RenderMultiColumnSpannerPlaceholder.cpp:

(WebCore::RenderMultiColumnSpannerPlaceholder::renderName const):

  • rendering/RenderMultiColumnSpannerPlaceholder.h:
  • rendering/RenderObject.cpp:

(WebCore::RenderObject::outputRenderObject const):

  • rendering/RenderObject.h:
  • rendering/RenderProgress.h:
  • rendering/RenderQuote.h:
  • rendering/RenderReplaced.h:
  • rendering/RenderReplica.h:
  • rendering/RenderRuby.h:
  • rendering/RenderRubyBase.h:
  • rendering/RenderRubyRun.h:
  • rendering/RenderRubyText.h:
  • rendering/RenderScrollbarPart.h:
  • rendering/RenderSlider.h:
  • rendering/RenderTable.h:
  • rendering/RenderTableCell.h:
  • rendering/RenderTableCol.h:
  • rendering/RenderTableRow.h:
  • rendering/RenderTableSection.h:
  • rendering/RenderText.cpp:

(WebCore::RenderText::renderName const):

  • rendering/RenderText.h:
  • rendering/RenderTextControl.h:
  • rendering/RenderTreeAsText.cpp:

(WebCore::getTagName):
(WebCore::RenderTreeAsText::writeRenderObject):

  • rendering/RenderVideo.h:
  • rendering/RenderView.h:
  • rendering/mathml/RenderMathMLBlock.h:
  • rendering/mathml/RenderMathMLFenced.h:
  • rendering/mathml/RenderMathMLFraction.h:
  • rendering/mathml/RenderMathMLMath.h:
  • rendering/mathml/RenderMathMLMenclose.h:
  • rendering/mathml/RenderMathMLOperator.h:
  • rendering/mathml/RenderMathMLPadded.h:
  • rendering/mathml/RenderMathMLRoot.h:
  • rendering/mathml/RenderMathMLRow.h:
  • rendering/mathml/RenderMathMLScripts.h:
  • rendering/mathml/RenderMathMLSpace.h:
  • rendering/mathml/RenderMathMLToken.h:
  • rendering/mathml/RenderMathMLUnderOver.h:
  • rendering/shapes/ShapeOutsideInfo.cpp:

(WebCore::checkShapeImageOrigin):

  • rendering/style/GridPositionsResolver.cpp:

(WebCore::adjustGridPositionsFromStyle):

  • rendering/svg/LegacyRenderSVGContainer.h:
  • rendering/svg/LegacyRenderSVGRect.h:
  • rendering/svg/LegacyRenderSVGRoot.h:
  • rendering/svg/LegacyRenderSVGShape.h:
  • rendering/svg/RenderSVGContainer.h:
  • rendering/svg/RenderSVGEllipse.h:
  • rendering/svg/RenderSVGForeignObject.h:
  • rendering/svg/RenderSVGGradientStop.h:
  • rendering/svg/RenderSVGHiddenContainer.h:
  • rendering/svg/RenderSVGImage.h:
  • rendering/svg/RenderSVGInline.h:
  • rendering/svg/RenderSVGInlineText.h:
  • rendering/svg/RenderSVGPath.h:
  • rendering/svg/RenderSVGRect.h:
  • rendering/svg/RenderSVGResourceClipper.h:
  • rendering/svg/RenderSVGResourceFilter.h:
  • rendering/svg/RenderSVGResourceFilterPrimitive.h:
  • rendering/svg/RenderSVGResourceLinearGradient.h:
  • rendering/svg/RenderSVGResourceMarker.h:
  • rendering/svg/RenderSVGResourceMasker.h:
  • rendering/svg/RenderSVGResourcePattern.h:
  • rendering/svg/RenderSVGResourceRadialGradient.h:
  • rendering/svg/RenderSVGRoot.h:
  • rendering/svg/RenderSVGShape.h:
  • rendering/svg/RenderSVGTSpan.h:
  • rendering/svg/RenderSVGText.h:
  • rendering/svg/RenderSVGTextPath.h:
  • rendering/svg/RenderSVGViewportContainer.h:
  • rendering/svg/SVGContainerLayout.cpp:

(WebCore::SVGContainerLayout::verifyLayoutLocationConsistency):

  • rendering/svg/SVGRenderTreeAsText.cpp:

(WebCore::TextStreamSeparator::TextStreamSeparator):
(WebCore::writeSVGFillPaintingResource):
(WebCore::writeSVGStrokePaintingResource):
(WebCore::writeStandardPrefix):

  • svg/LinearGradientAttributes.h:

(WebCore::LinearGradientAttributes::LinearGradientAttributes):

  • svg/RadialGradientAttributes.h:

(WebCore::RadialGradientAttributes::RadialGradientAttributes):

  • svg/SVGFitToViewBox.cpp:

(WebCore::SVGFitToViewBox::parseViewBoxGeneric):

  • svg/SVGGeometryElement.cpp:

(WebCore::SVGGeometryElement::parseAttribute):

  • svg/graphics/SVGImage.cpp:

(WebCore::SVGImage::dataChanged):

  • testing/Internals.cpp:

(WebCore::styleValidityToToString):
(WebCore::responseSourceToString):
(WebCore::Internals::openDummyInspectorFrontend):
(WebCore::Internals::elementBufferingPolicy):
(WebCore::Internals::createSleepDisabler):
(WebCore::Internals::loadArtworkImage):

  • testing/InternalsMapLike.cpp:

(WebCore::InternalsMapLike::InternalsMapLike):

  • testing/MockMediaSessionCoordinator.cpp:

(WebCore::MockMediaSessionCoordinator::positionStateChanged):
(WebCore::MockMediaSessionCoordinator::readyStateChanged):
(WebCore::MockMediaSessionCoordinator::playbackStateChanged):
(WebCore::MockMediaSessionCoordinator::trackIdentifierChanged):

  • testing/MockMediaSessionCoordinator.h:
  • testing/MockPageOverlayClient.cpp:

(WebCore::MockPageOverlayClient::layerTreeAsText):

  • testing/MockPaymentCoordinator.cpp:
  • workers/WorkerScriptLoader.cpp:

(WebCore::WorkerScriptLoader::notifyError):

  • workers/service/ServiceWorkerContainer.cpp:

(WebCore::ServiceWorkerContainer::addRegistration):

  • workers/service/server/RegistrationDatabase.cpp:

(WebCore::RegistrationDatabase::ensureValidRecordsTable):
(WebCore::updateViaCacheToString):
(WebCore::workerTypeToString):
(WebCore::RegistrationDatabase::doPushChanges):

  • workers/service/server/SWServer.cpp:

(WebCore::SWServer::scheduleJob):

  • workers/shared/SharedWorker.cpp:

(WebCore::SharedWorker::create):

  • worklets/PaintWorkletGlobalScope.cpp:

(WebCore::PaintWorkletGlobalScope::registerPaint):

  • worklets/WorkletGlobalScope.cpp:

(WebCore::WorkletGlobalScope::userAgent const):

  • xml/XMLErrors.cpp:

(WebCore::XMLErrors::handleError):
(WebCore::XMLErrors::appendErrorMessage):

  • xml/XMLErrors.h:
  • xml/XMLHttpRequest.cpp:

(WebCore::replaceCharsetInMediaTypeIfNeeded):
(WebCore::XMLHttpRequest::setTimeout):
(WebCore::XMLHttpRequest::setResponseType):
(WebCore::XMLHttpRequest::open):
(WebCore::XMLHttpRequest::createDecoder const):

  • xml/XPathParser.cpp:

(WebCore::XPath::Parser::nextTokenInternal):

  • xml/XSLTProcessor.cpp:

(WebCore::XSLTProcessor::transformToFragment):

  • xml/XSLTProcessorLibxslt.cpp:

(WebCore::XSLTProcessor::parseErrorFunc):
(WebCore::docLoaderFunc):
(WebCore::resultMIMEType):
(WebCore::XSLTProcessor::transformToString):

  • xml/parser/XMLDocumentParser.cpp:

(WebCore::XMLDocumentParser::createLeafTextNode):

  • xml/parser/XMLDocumentParserLibxml2.cpp:

(WebCore::openFunc):

Source/WebCore/PAL:

  • pal/Logging.cpp:

(PAL::registerNotifyCallback):

  • pal/Logging.h:
  • pal/system/SleepDisabler.cpp:

(PAL::SleepDisabler::create):
(PAL::SleepDisabler::SleepDisabler):

  • pal/system/SleepDisabler.h:
  • pal/system/cocoa/SleepDisablerCocoa.cpp:

(PAL::SleepDisabler::create):
(PAL::SleepDisablerCocoa::SleepDisablerCocoa):

  • pal/system/cocoa/SleepDisablerCocoa.h:
  • pal/system/glib/SleepDisablerGLib.cpp:

(PAL::SleepDisabler::create):
(PAL::SleepDisablerGLib::SleepDisablerGLib):
(PAL::SleepDisablerGLib::acquireInhibitor):

  • pal/system/glib/SleepDisablerGLib.h:

Source/WebKit:

  • NetworkProcess/NetworkDataTaskBlob.cpp:
  • UIProcess/WebProcessProxy.cpp:

(WebKit::WebProcessProxy::didCreateSleepDisabler):

  • WebProcess/WebProcess.cpp:

(WebKit::WebProcess::initializeWebProcess):

Source/WTF:

  • wtf/text/WTFString.h:

(WTF::equalIgnoringASCIICase):

  • Property svn:eol-style set to native
File size: 11.1 KB
Line 
1/*
2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * Copyright (C) 2015 Roopesh Chander ([email protected])
4 * Copyright (C) 2015-2021 Apple Inc. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met:
9 *
10 * * Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * * Redistributions in binary form must reproduce the above
13 * copyright notice, this list of conditions and the following disclaimer
14 * in the documentation and/or other materials provided with the
15 * distribution.
16 * * Neither the name of Google Inc. nor the names of its
17 * contributors may be used to endorse or promote products derived from
18 * this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 *
32 */
33
34#include "config.h"
35#include "PingLoader.h"
36
37#include "CachedResourceLoader.h"
38#include "CachedResourceRequest.h"
39#include "ContentRuleListResults.h"
40#include "ContentSecurityPolicy.h"
41#include "Document.h"
42#include "Frame.h"
43#include "FrameLoader.h"
44#include "FrameLoaderClient.h"
45#include "HTTPHeaderValues.h"
46#include "InspectorInstrumentation.h"
47#include "LoaderStrategy.h"
48#include "NetworkLoadMetrics.h"
49#include "Page.h"
50#include "PlatformStrategies.h"
51#include "ProgressTracker.h"
52#include "ResourceError.h"
53#include "ResourceHandle.h"
54#include "ResourceLoadInfo.h"
55#include "ResourceRequest.h"
56#include "ResourceResponse.h"
57#include "SecurityOrigin.h"
58#include "SecurityPolicy.h"
59#include "UserContentController.h"
60#include <wtf/text/CString.h>
61
62namespace WebCore {
63
64#if ENABLE(CONTENT_EXTENSIONS)
65
66// Returns true if we should block the load.
67static bool processContentRuleListsForLoad(const Frame& frame, ResourceRequest& request, OptionSet<ContentExtensions::ResourceType> resourceType)
68{
69 auto* documentLoader = frame.loader().documentLoader();
70 if (!documentLoader)
71 return false;
72 auto* page = frame.page();
73 if (!page)
74 return false;
75 auto results = page->userContentProvider().processContentRuleListsForLoad(*page, request.url(), resourceType, *documentLoader);
76 bool result = results.summary.blockedLoad;
77 ContentExtensions::applyResultsToRequest(WTFMove(results), page, request);
78 return result;
79}
80
81#endif
82
83void PingLoader::loadImage(Frame& frame, const URL& url)
84{
85 ASSERT(frame.document());
86 auto& document = *frame.document();
87
88 if (!document.securityOrigin().canDisplay(url)) {
89 FrameLoader::reportLocalLoadFailed(&frame, url.string());
90 return;
91 }
92
93 if (!portAllowed(url)) {
94 FrameLoader::reportBlockedLoadFailed(frame, url);
95 return;
96 }
97
98 ResourceRequest request(url);
99#if ENABLE(CONTENT_EXTENSIONS)
100 if (processContentRuleListsForLoad(frame, request, ContentExtensions::ResourceType::Image))
101 return;
102#endif
103
104 document.contentSecurityPolicy()->upgradeInsecureRequestIfNeeded(request, ContentSecurityPolicy::InsecureRequestType::Load);
105
106 request.setHTTPHeaderField(HTTPHeaderName::CacheControl, HTTPHeaderValues::maxAge0());
107
108 HTTPHeaderMap originalRequestHeader = request.httpHeaderFields();
109
110 String referrer = SecurityPolicy::generateReferrerHeader(document.referrerPolicy(), request.url(), frame.loader().outgoingReferrer());
111 if (!referrer.isEmpty())
112 request.setHTTPReferrer(referrer);
113 frame.loader().updateRequestAndAddExtraFields(request, IsMainResource::No);
114
115 startPingLoad(frame, request, WTFMove(originalRequestHeader), ShouldFollowRedirects::Yes, ContentSecurityPolicyImposition::DoPolicyCheck, ReferrerPolicy::EmptyString);
116}
117
118// http://www.whatwg.org/specs/web-apps/current-work/multipage/links.html#hyperlink-auditing
119void PingLoader::sendPing(Frame& frame, const URL& pingURL, const URL& destinationURL)
120{
121 ASSERT(frame.document());
122
123 if (!pingURL.protocolIsInHTTPFamily())
124 return;
125
126 ResourceRequest request(pingURL);
127 request.setRequester(ResourceRequest::Requester::Ping);
128
129#if ENABLE(CONTENT_EXTENSIONS)
130 if (processContentRuleListsForLoad(frame, request, ContentExtensions::ResourceType::Ping))
131 return;
132#endif
133
134 auto& document = *frame.document();
135 document.contentSecurityPolicy()->upgradeInsecureRequestIfNeeded(request, ContentSecurityPolicy::InsecureRequestType::Load);
136
137 request.setHTTPMethod("POST"_s);
138 request.setHTTPContentType("text/ping"_s);
139 request.setHTTPBody(FormData::create("PING"));
140 request.setHTTPHeaderField(HTTPHeaderName::CacheControl, HTTPHeaderValues::maxAge0());
141
142 HTTPHeaderMap originalRequestHeader = request.httpHeaderFields();
143
144 auto& sourceOrigin = document.securityOrigin();
145 FrameLoader::addHTTPOriginIfNeeded(request, SecurityPolicy::generateOriginHeader(document.referrerPolicy(), request.url(), sourceOrigin));
146
147 frame.loader().updateRequestAndAddExtraFields(request, IsMainResource::No);
148 request.setHTTPHeaderField(HTTPHeaderName::PingTo, destinationURL.string());
149 if (!SecurityPolicy::shouldHideReferrer(pingURL, frame.loader().outgoingReferrer()))
150 request.setHTTPHeaderField(HTTPHeaderName::PingFrom, document.url().string());
151
152 startPingLoad(frame, request, WTFMove(originalRequestHeader), ShouldFollowRedirects::Yes, ContentSecurityPolicyImposition::DoPolicyCheck, ReferrerPolicy::NoReferrer);
153}
154
155void PingLoader::sendViolationReport(Frame& frame, const URL& reportURL, Ref<FormData>&& report, ViolationReportType reportType)
156{
157 ASSERT(frame.document());
158
159 ResourceRequest request(reportURL);
160#if ENABLE(CONTENT_EXTENSIONS)
161 if (processContentRuleListsForLoad(frame, request, ContentExtensions::ResourceType::CSPReport))
162 return;
163#endif
164
165 auto& document = *frame.document();
166 document.contentSecurityPolicy()->upgradeInsecureRequestIfNeeded(request, ContentSecurityPolicy::InsecureRequestType::Load);
167
168 request.setHTTPMethod("POST"_s);
169 request.setHTTPBody(WTFMove(report));
170 switch (reportType) {
171 case ViolationReportType::ContentSecurityPolicy:
172 request.setHTTPContentType("application/csp-report"_s);
173 break;
174 case ViolationReportType::StandardReportingAPIViolation:
175 request.setHTTPContentType("application/reports+json"_s);
176 break;
177 }
178
179 bool removeCookies = true;
180 if (document.securityOrigin().isSameSchemeHostPort(SecurityOrigin::create(reportURL).get()))
181 removeCookies = false;
182 if (removeCookies)
183 request.setAllowCookies(false);
184
185 HTTPHeaderMap originalRequestHeader = request.httpHeaderFields();
186
187 if (reportType != ViolationReportType::StandardReportingAPIViolation)
188 frame.loader().updateRequestAndAddExtraFields(request, IsMainResource::No);
189
190 String referrer = SecurityPolicy::generateReferrerHeader(document.referrerPolicy(), reportURL, frame.loader().outgoingReferrer());
191 if (!referrer.isEmpty())
192 request.setHTTPReferrer(referrer);
193
194 startPingLoad(frame, request, WTFMove(originalRequestHeader), ShouldFollowRedirects::No, ContentSecurityPolicyImposition::SkipPolicyCheck, ReferrerPolicy::EmptyString, reportType);
195}
196
197void PingLoader::startPingLoad(Frame& frame, ResourceRequest& request, HTTPHeaderMap&& originalRequestHeaders, ShouldFollowRedirects shouldFollowRedirects, ContentSecurityPolicyImposition policyCheck, ReferrerPolicy referrerPolicy, std::optional<ViolationReportType> violationReportType)
198{
199 auto identifier = ResourceLoaderIdentifier::generate();
200 // FIXME: Why activeDocumentLoader? I would have expected documentLoader().
201 // It seems like the PingLoader should be associated with the current
202 // Document in the Frame, but the activeDocumentLoader will be associated
203 // with the provisional DocumentLoader if there is a provisional
204 // DocumentLoader.
205 bool shouldUseCredentialStorage = frame.loader().client().shouldUseCredentialStorage(frame.loader().activeDocumentLoader(), identifier);
206 ResourceLoaderOptions options;
207 options.credentials = shouldUseCredentialStorage ? FetchOptions::Credentials::Include : FetchOptions::Credentials::Omit;
208 options.redirect = shouldFollowRedirects == ShouldFollowRedirects::Yes ? FetchOptions::Redirect::Follow : FetchOptions::Redirect::Error;
209 options.keepAlive = true;
210 options.contentSecurityPolicyImposition = policyCheck;
211 options.referrerPolicy = referrerPolicy;
212 options.sendLoadCallbacks = SendCallbackPolicy::SendCallbacks;
213 options.cache = FetchOptions::Cache::NoCache;
214
215 // https://www.w3.org/TR/reporting/#try-delivery
216 if (violationReportType == ViolationReportType::StandardReportingAPIViolation) {
217 options.credentials = FetchOptions::Credentials::SameOrigin;
218 options.mode = FetchOptions::Mode::Cors;
219 options.serviceWorkersMode = ServiceWorkersMode::None;
220 options.destination = FetchOptions::Destination::Report;
221 }
222
223 // FIXME: Deprecate the ping load code path.
224 if (platformStrategies()->loaderStrategy()->usePingLoad()) {
225 InspectorInstrumentation::willSendRequestOfType(&frame, identifier, frame.loader().activeDocumentLoader(), request, InspectorInstrumentation::LoadType::Ping);
226
227 platformStrategies()->loaderStrategy()->startPingLoad(frame, request, WTFMove(originalRequestHeaders), options, policyCheck, [protectedFrame = Ref { frame }, identifier] (const ResourceError& error, const ResourceResponse& response) {
228 if (!response.isNull())
229 InspectorInstrumentation::didReceiveResourceResponse(protectedFrame, identifier, protectedFrame->loader().activeDocumentLoader(), response, nullptr);
230 if (!error.isNull()) {
231 InspectorInstrumentation::didFailLoading(protectedFrame.ptr(), protectedFrame->loader().activeDocumentLoader(), identifier, error);
232 return;
233 }
234 InspectorInstrumentation::didFinishLoading(protectedFrame.ptr(), protectedFrame->loader().activeDocumentLoader(), identifier, { }, nullptr);
235 });
236 return;
237 }
238
239 CachedResourceRequest cachedResourceRequest { ResourceRequest { request }, options };
240 frame.document()->cachedResourceLoader().requestPingResource(WTFMove(cachedResourceRequest));
241}
242
243// // https://html.spec.whatwg.org/multipage/origin.html#sanitize-url-report
244String PingLoader::sanitizeURLForReport(const URL& url)
245{
246 URL sanitizedURL = url;
247 sanitizedURL.removeCredentials();
248 sanitizedURL.removeFragmentIdentifier();
249 return sanitizedURL.string();
250}
251
252} // namespace WebCore
Note: See TracBrowser for help on using the repository browser.