New issue
Advanced search Search tips

Issue 615174 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Feature



Sign in to add a comment

[Meta] Make StringView like StringPiece

Project Member Reported by esprehn@chromium.org, May 26 2016

Issue description

StringView is currently a very simple wrapper around a String with an offset and a length. We can instead make it wrap around an LChar* or UChar* and a length like StringPiece which would then allow lots of simplification in the code.

For example we can simplify many constructors to various classes, remove CSSParserString, avoid string copies in many places, and not have special paths for LChar* vs UChar* vs String on many WTF operations.
 
Project Member

Comment 1 by bugdroid1@chromium.org, May 27 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/330deea56e27bc760fa52101040a51428bb7f582

commit 330deea56e27bc760fa52101040a51428bb7f582
Author: esprehn <esprehn@chromium.org>
Date: Fri May 27 16:58:15 2016

Expand WTF::StringView's API to be more like StringPiece.

StringView no longer owns the string passed into it, and can now wrap
a raw ptr to some characters.

This allows us to leverage the inline strlen optimization where the
compiler will embed the length of literal strings into the binary. It
also allows the deletion many overloaded methods that used to take
an LChar*, UChar* or String and can now just take a StringView instead.

For example the two constructors in TextRun are now a single one that
takes a StringView. This needed to be done in this patch to avoid
ambiguous constructors.

Future patches will replace CSSParserString with StringView, and also
vastly simplify the huge number of overloads on various methods. We'll
also expand the API surface of StringView to include the many useful
operations that StringPiece has.

BUG= 615174 

Review-Url: https://codereview.chromium.org/2007103003
Cr-Commit-Position: refs/heads/master@{#396493}

[modify] https://crrev.com/330deea56e27bc760fa52101040a51428bb7f582/third_party/WebKit/Source/core/css/parser/CSSParserString.h
[modify] https://crrev.com/330deea56e27bc760fa52101040a51428bb7f582/third_party/WebKit/Source/core/html/parser/HTMLSrcsetParser.h
[modify] https://crrev.com/330deea56e27bc760fa52101040a51428bb7f582/third_party/WebKit/Source/core/layout/LayoutListMarker.cpp
[modify] https://crrev.com/330deea56e27bc760fa52101040a51428bb7f582/third_party/WebKit/Source/core/layout/LayoutText.cpp
[modify] https://crrev.com/330deea56e27bc760fa52101040a51428bb7f582/third_party/WebKit/Source/core/layout/line/BreakingContextInlineHeaders.h
[modify] https://crrev.com/330deea56e27bc760fa52101040a51428bb7f582/third_party/WebKit/Source/core/layout/line/InlineTextBox.cpp
[modify] https://crrev.com/330deea56e27bc760fa52101040a51428bb7f582/third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp
[modify] https://crrev.com/330deea56e27bc760fa52101040a51428bb7f582/third_party/WebKit/Source/core/testing/MockHyphenation.cpp
[modify] https://crrev.com/330deea56e27bc760fa52101040a51428bb7f582/third_party/WebKit/Source/core/testing/UnionTypesTest.cpp
[modify] https://crrev.com/330deea56e27bc760fa52101040a51428bb7f582/third_party/WebKit/Source/platform/animation/TimingFunction.cpp
[modify] https://crrev.com/330deea56e27bc760fa52101040a51428bb7f582/third_party/WebKit/Source/platform/exported/WebString.cpp
[modify] https://crrev.com/330deea56e27bc760fa52101040a51428bb7f582/third_party/WebKit/Source/platform/inspector_protocol/String16WTF.h
[modify] https://crrev.com/330deea56e27bc760fa52101040a51428bb7f582/third_party/WebKit/Source/platform/mhtml/MHTMLArchive.cpp
[modify] https://crrev.com/330deea56e27bc760fa52101040a51428bb7f582/third_party/WebKit/Source/platform/text/TextRun.h
[modify] https://crrev.com/330deea56e27bc760fa52101040a51428bb7f582/third_party/WebKit/Source/platform/text/mac/HyphenationMac.cpp
[modify] https://crrev.com/330deea56e27bc760fa52101040a51428bb7f582/third_party/WebKit/Source/wtf/Forward.h
[modify] https://crrev.com/330deea56e27bc760fa52101040a51428bb7f582/third_party/WebKit/Source/wtf/text/StringBuilder.h
[add] https://crrev.com/330deea56e27bc760fa52101040a51428bb7f582/third_party/WebKit/Source/wtf/text/StringView.cpp
[modify] https://crrev.com/330deea56e27bc760fa52101040a51428bb7f582/third_party/WebKit/Source/wtf/text/StringView.h
[add] https://crrev.com/330deea56e27bc760fa52101040a51428bb7f582/third_party/WebKit/Source/wtf/text/StringViewTest.cpp
[modify] https://crrev.com/330deea56e27bc760fa52101040a51428bb7f582/third_party/WebKit/Source/wtf/text/WTFString.h
[modify] https://crrev.com/330deea56e27bc760fa52101040a51428bb7f582/third_party/WebKit/Source/wtf/wtf.gypi
[modify] https://crrev.com/330deea56e27bc760fa52101040a51428bb7f582/third_party/WebKit/public/platform/WebString.h

Project Member

Comment 2 by bugdroid1@chromium.org, May 27 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/04157e8b89881d033f9eeca4466d9dd0c4e9aaea

commit 04157e8b89881d033f9eeca4466d9dd0c4e9aaea
Author: esprehn <esprehn@chromium.org>
Date: Fri May 27 23:43:36 2016

Remove StringBuilder::appendLiteral.

We can just rely on the append(StringView) version instead. This does
mean we have to take 2 branches in some cases, but it should be
very minimal and since the code is inline the compiler can also
likely eliminate it.

BUG= 615174 

Review-Url: https://codereview.chromium.org/2017053003
Cr-Commit-Position: refs/heads/master@{#396601}

[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/bindings/core/v8/ExceptionMessages.h
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/css/CSSBasicShapeValues.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/css/CSSCalculationValue.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/css/CSSCounterValue.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/css/CSSCrossfadeValue.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/css/CSSFontFaceRule.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/css/CSSFontFeatureValue.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/css/CSSGradientValue.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/css/CSSGroupingRule.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/css/CSSImageSetValue.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/css/CSSImportRule.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/css/CSSKeyframesRule.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/css/CSSMediaRule.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/css/CSSNamespaceRule.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/css/CSSPageRule.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/css/CSSPaintValue.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/css/CSSSelector.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/css/CSSSelectorList.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/css/CSSStyleRule.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/css/CSSStyleSheet.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/css/CSSSupportsRule.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/css/CSSViewportRule.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/css/MediaList.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/css/MediaQuery.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/css/MediaQueryExp.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/css/MediaQuerySetTest.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/css/StylePropertySerializer.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/css/StyleRuleKeyframe.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/css/parser/CSSParser.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/dom/DatasetDOMStringMap.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/dom/Document.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/dom/Element.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/dom/Node.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/dom/Range.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/dom/SandboxFlags.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/dom/Text.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/editing/Position.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/editing/VisibleSelection.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/editing/serializers/HTMLInterchange.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/editing/serializers/MarkupFormatter.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/editing/serializers/StyledMarkupAccumulator.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/fetch/CrossOriginAccessControl.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/fileapi/FileReaderLoader.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/frame/FrameConsole.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/frame/FrameSerializer.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/html/ImageDocument.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/html/forms/FormController.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/html/parser/XSSAuditorDelegate.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/inspector/InspectorApplicationCacheAgent.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/inspector/InspectorHighlight.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/inspector/InspectorLayerTreeAgent.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/inspector/ScriptArguments.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/layout/LayoutTheme.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/layout/LayoutTreeAsText.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/page/EventSource.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/page/FrameTree.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/svg/SVGParsingError.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/testing/Internals.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/core/xml/parser/XMLErrors.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/modules/credentialmanager/PasswordCredentialTest.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/modules/filesystem/DOMFileSystem.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/modules/filesystem/DOMFileSystemBase.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/modules/websockets/DOMWebSocket.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/platform/Decimal.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/platform/JSONValues.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/platform/PODInterval.h
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/platform/exported/WebMediaConstraints.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/platform/graphics/Color.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/platform/mhtml/MHTMLArchive.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/platform/text/DateTimeFormat.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/platform/text/DateTimeFormat.h
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/platform/text/LocaleICUTest.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/platform/text/LocaleWin.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/platform/text/PlatformLocale.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/platform/weborigin/SchemeRegistry.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/platform/weborigin/SecurityOrigin.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/web/WebAXObject.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/web/WebFrameSerializerImpl.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/web/tests/FrameSerializerTest.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/wtf/DateMath.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/wtf/InstanceCounter.cpp
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/wtf/text/StringBuilder.h
[modify] https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea/third_party/WebKit/Source/wtf/text/StringBuilderTest.cpp

Project Member

Comment 3 by bugdroid1@chromium.org, May 28 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/433566e878a7ce453ae7be38e0d252f8cf804411

commit 433566e878a7ce453ae7be38e0d252f8cf804411
Author: sigbjornf <sigbjornf@opera.com>
Date: Sat May 28 11:49:52 2016

Revert of Remove StringBuilder::appendLiteral. (patchset #1 id:1 of https://codereview.chromium.org/2017053003/ )

Reason for revert:
Will unfortunately have to back out this one so that the revert https://codereview.chromium.org/2025503002/ will cleanly apply.

(Don't want a tree with this many ASan failures over the long weekend.)

Original issue's description:
> Remove StringBuilder::appendLiteral.
>
> We can just rely on the append(StringView) version instead. This does
> mean we have to take 2 branches in some cases, but it should be
> very minimal and since the code is inline the compiler can also
> likely eliminate it.
>
> BUG= 615174 
>
> Committed: https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea
> Cr-Commit-Position: refs/heads/master@{#396601}

TBR=haraken@chromium.org,yutak@chromium.org,esprehn@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG= 615174 

Review-Url: https://codereview.chromium.org/2017303002
Cr-Commit-Position: refs/heads/master@{#396640}

[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/bindings/core/v8/ExceptionMessages.h
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/css/CSSBasicShapeValues.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/css/CSSCalculationValue.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/css/CSSCounterValue.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/css/CSSCrossfadeValue.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/css/CSSFontFaceRule.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/css/CSSFontFeatureValue.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/css/CSSGradientValue.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/css/CSSGroupingRule.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/css/CSSImageSetValue.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/css/CSSImportRule.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/css/CSSKeyframesRule.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/css/CSSMediaRule.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/css/CSSNamespaceRule.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/css/CSSPageRule.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/css/CSSPaintValue.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/css/CSSSelector.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/css/CSSSelectorList.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/css/CSSStyleRule.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/css/CSSStyleSheet.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/css/CSSSupportsRule.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/css/CSSViewportRule.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/css/MediaList.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/css/MediaQuery.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/css/MediaQueryExp.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/css/MediaQuerySetTest.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/css/StylePropertySerializer.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/css/StyleRuleKeyframe.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/css/parser/CSSParser.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/dom/DatasetDOMStringMap.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/dom/Document.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/dom/Element.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/dom/Node.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/dom/Range.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/dom/SandboxFlags.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/dom/Text.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/editing/Position.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/editing/VisibleSelection.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/editing/serializers/HTMLInterchange.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/editing/serializers/MarkupFormatter.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/editing/serializers/StyledMarkupAccumulator.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/fetch/CrossOriginAccessControl.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/fileapi/FileReaderLoader.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/frame/FrameConsole.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/frame/FrameSerializer.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/html/ImageDocument.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/html/forms/FormController.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/html/parser/XSSAuditorDelegate.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/inspector/InspectorApplicationCacheAgent.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/inspector/InspectorHighlight.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/inspector/InspectorLayerTreeAgent.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/inspector/ScriptArguments.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/layout/LayoutTheme.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/layout/LayoutTreeAsText.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/page/EventSource.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/page/FrameTree.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/svg/SVGParsingError.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/testing/Internals.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/core/xml/parser/XMLErrors.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/modules/credentialmanager/PasswordCredentialTest.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/modules/filesystem/DOMFileSystem.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/modules/filesystem/DOMFileSystemBase.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/modules/websockets/DOMWebSocket.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/platform/Decimal.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/platform/JSONValues.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/platform/PODInterval.h
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/platform/exported/WebMediaConstraints.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/platform/graphics/Color.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/platform/mhtml/MHTMLArchive.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/platform/text/DateTimeFormat.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/platform/text/DateTimeFormat.h
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/platform/text/LocaleICUTest.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/platform/text/LocaleWin.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/platform/text/PlatformLocale.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/platform/weborigin/SchemeRegistry.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/platform/weborigin/SecurityOrigin.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/web/WebAXObject.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/web/WebFrameSerializerImpl.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/web/tests/FrameSerializerTest.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/wtf/DateMath.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/wtf/InstanceCounter.cpp
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/wtf/text/StringBuilder.h
[modify] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/wtf/text/StringBuilderTest.cpp

Project Member

Comment 4 by bugdroid1@chromium.org, May 28 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c70d00665c49b700f2e4f5795044cce1812e6ef9

commit c70d00665c49b700f2e4f5795044cce1812e6ef9
Author: sigbjornf <sigbjornf@opera.com>
Date: Sat May 28 11:52:33 2016

Revert of Expand WTF::StringView's API to be more like StringPiece. (patchset #12 id:220001 of https://codereview.chromium.org/2007103003/ )

Reason for revert:
Many a heap-buffer-overflow ASan failures,

 https://build.chromium.org/p/chromium.webkit/builders/WebKit%20Linux%20ASAN/builds/24329

Original issue's description:
> Expand WTF::StringView's API to be more like StringPiece.
>
> StringView no longer owns the string passed into it, and can now wrap
> a raw ptr to some characters.
>
> This allows us to leverage the inline strlen optimization where the
> compiler will embed the length of literal strings into the binary. It
> also allows the deletion many overloaded methods that used to take
> an LChar*, UChar* or String and can now just take a StringView instead.
>
> For example the two constructors in TextRun are now a single one that
> takes a StringView. This needed to be done in this patch to avoid
> ambiguous constructors.
>
> Future patches will replace CSSParserString with StringView, and also
> vastly simplify the huge number of overloads on various methods. We'll
> also expand the API surface of StringView to include the many useful
> operations that StringPiece has.
>
> BUG= 615174 
>
> Committed: https://crrev.com/330deea56e27bc760fa52101040a51428bb7f582
> Cr-Commit-Position: refs/heads/master@{#396493}

TBR=haraken@chromium.org,jyasskin@chromium.org,yutak@chromium.org,esprehn@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG= 615174 

Review-Url: https://codereview.chromium.org/2025503002
Cr-Commit-Position: refs/heads/master@{#396641}

[modify] https://crrev.com/c70d00665c49b700f2e4f5795044cce1812e6ef9/third_party/WebKit/Source/core/css/parser/CSSParserString.h
[modify] https://crrev.com/c70d00665c49b700f2e4f5795044cce1812e6ef9/third_party/WebKit/Source/core/html/parser/HTMLSrcsetParser.h
[modify] https://crrev.com/c70d00665c49b700f2e4f5795044cce1812e6ef9/third_party/WebKit/Source/core/layout/LayoutListMarker.cpp
[modify] https://crrev.com/c70d00665c49b700f2e4f5795044cce1812e6ef9/third_party/WebKit/Source/core/layout/LayoutText.cpp
[modify] https://crrev.com/c70d00665c49b700f2e4f5795044cce1812e6ef9/third_party/WebKit/Source/core/layout/line/BreakingContextInlineHeaders.h
[modify] https://crrev.com/c70d00665c49b700f2e4f5795044cce1812e6ef9/third_party/WebKit/Source/core/layout/line/InlineTextBox.cpp
[modify] https://crrev.com/c70d00665c49b700f2e4f5795044cce1812e6ef9/third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp
[modify] https://crrev.com/c70d00665c49b700f2e4f5795044cce1812e6ef9/third_party/WebKit/Source/core/testing/MockHyphenation.cpp
[modify] https://crrev.com/c70d00665c49b700f2e4f5795044cce1812e6ef9/third_party/WebKit/Source/core/testing/UnionTypesTest.cpp
[modify] https://crrev.com/c70d00665c49b700f2e4f5795044cce1812e6ef9/third_party/WebKit/Source/platform/animation/TimingFunction.cpp
[modify] https://crrev.com/c70d00665c49b700f2e4f5795044cce1812e6ef9/third_party/WebKit/Source/platform/exported/WebString.cpp
[modify] https://crrev.com/c70d00665c49b700f2e4f5795044cce1812e6ef9/third_party/WebKit/Source/platform/inspector_protocol/String16WTF.h
[modify] https://crrev.com/c70d00665c49b700f2e4f5795044cce1812e6ef9/third_party/WebKit/Source/platform/mhtml/MHTMLArchive.cpp
[modify] https://crrev.com/c70d00665c49b700f2e4f5795044cce1812e6ef9/third_party/WebKit/Source/platform/text/TextRun.h
[modify] https://crrev.com/c70d00665c49b700f2e4f5795044cce1812e6ef9/third_party/WebKit/Source/platform/text/mac/HyphenationMac.cpp
[modify] https://crrev.com/c70d00665c49b700f2e4f5795044cce1812e6ef9/third_party/WebKit/Source/wtf/Forward.h
[modify] https://crrev.com/c70d00665c49b700f2e4f5795044cce1812e6ef9/third_party/WebKit/Source/wtf/text/StringBuilder.h
[delete] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/wtf/text/StringView.cpp
[modify] https://crrev.com/c70d00665c49b700f2e4f5795044cce1812e6ef9/third_party/WebKit/Source/wtf/text/StringView.h
[delete] https://crrev.com/433566e878a7ce453ae7be38e0d252f8cf804411/third_party/WebKit/Source/wtf/text/StringViewTest.cpp
[modify] https://crrev.com/c70d00665c49b700f2e4f5795044cce1812e6ef9/third_party/WebKit/Source/wtf/text/WTFString.h
[modify] https://crrev.com/c70d00665c49b700f2e4f5795044cce1812e6ef9/third_party/WebKit/Source/wtf/wtf.gypi
[modify] https://crrev.com/c70d00665c49b700f2e4f5795044cce1812e6ef9/third_party/WebKit/public/platform/WebString.h

Woops, my assert was bad calling lenthOfNullTerminatedString on non null
terminated strings. Funny to get reverted because of a bug in my own
security assert :P

Thanks!
Project Member

Comment 6 by bugdroid1@chromium.org, May 31 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9b0aad1eca55ac75f437789514224e9b922fe514

commit 9b0aad1eca55ac75f437789514224e9b922fe514
Author: esprehn <esprehn@chromium.org>
Date: Tue May 31 21:51:32 2016

Expand WTF::StringView's API to be more like StringPiece.

StringView no longer owns the string passed into it, and can now wrap
a raw ptr to some characters.

This allows us to leverage the inline strlen optimization where the
compiler will embed the length of literal strings into the binary. It
also allows the deletion many overloaded methods that used to take
an LChar*, UChar* or String and can now just take a StringView instead.

For example the two constructors in TextRun are now a single one that
takes a StringView. This needed to be done in this patch to avoid
ambiguous constructors.

Future patches will replace CSSParserString with StringView, and also
vastly simplify the huge number of overloads on various methods. We'll
also expand the API surface of StringView to include the many useful
operations that StringPiece has.

This was originally committed as:
https://crrev.com/330deea56e27bc760fa52101040a51428bb7f582 but was
reverted due an incorrect assert in the
StringView(const UChar*, unsigned length) constructor. The assert
was incorrectly calling lengthOfNullTerminatedString on the UChar
in the assert, but this constructor is used for byte sequences which
are not null terminated.

BUG= 615174 

Review-Url: https://codereview.chromium.org/2007103003
Cr-Commit-Position: refs/heads/master@{#396942}

[modify] https://crrev.com/9b0aad1eca55ac75f437789514224e9b922fe514/third_party/WebKit/Source/core/css/parser/CSSParserString.h
[modify] https://crrev.com/9b0aad1eca55ac75f437789514224e9b922fe514/third_party/WebKit/Source/core/html/parser/HTMLSrcsetParser.h
[modify] https://crrev.com/9b0aad1eca55ac75f437789514224e9b922fe514/third_party/WebKit/Source/core/layout/LayoutListMarker.cpp
[modify] https://crrev.com/9b0aad1eca55ac75f437789514224e9b922fe514/third_party/WebKit/Source/core/layout/LayoutText.cpp
[modify] https://crrev.com/9b0aad1eca55ac75f437789514224e9b922fe514/third_party/WebKit/Source/core/layout/line/BreakingContextInlineHeaders.h
[modify] https://crrev.com/9b0aad1eca55ac75f437789514224e9b922fe514/third_party/WebKit/Source/core/layout/line/InlineTextBox.cpp
[modify] https://crrev.com/9b0aad1eca55ac75f437789514224e9b922fe514/third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp
[modify] https://crrev.com/9b0aad1eca55ac75f437789514224e9b922fe514/third_party/WebKit/Source/core/testing/MockHyphenation.cpp
[modify] https://crrev.com/9b0aad1eca55ac75f437789514224e9b922fe514/third_party/WebKit/Source/core/testing/UnionTypesTest.cpp
[modify] https://crrev.com/9b0aad1eca55ac75f437789514224e9b922fe514/third_party/WebKit/Source/platform/animation/TimingFunction.cpp
[modify] https://crrev.com/9b0aad1eca55ac75f437789514224e9b922fe514/third_party/WebKit/Source/platform/exported/WebString.cpp
[modify] https://crrev.com/9b0aad1eca55ac75f437789514224e9b922fe514/third_party/WebKit/Source/platform/inspector_protocol/String16WTF.h
[modify] https://crrev.com/9b0aad1eca55ac75f437789514224e9b922fe514/third_party/WebKit/Source/platform/mhtml/MHTMLArchive.cpp
[modify] https://crrev.com/9b0aad1eca55ac75f437789514224e9b922fe514/third_party/WebKit/Source/platform/text/TextRun.h
[modify] https://crrev.com/9b0aad1eca55ac75f437789514224e9b922fe514/third_party/WebKit/Source/platform/text/mac/HyphenationMac.cpp
[modify] https://crrev.com/9b0aad1eca55ac75f437789514224e9b922fe514/third_party/WebKit/Source/wtf/Forward.h
[modify] https://crrev.com/9b0aad1eca55ac75f437789514224e9b922fe514/third_party/WebKit/Source/wtf/text/StringBuilder.h
[add] https://crrev.com/9b0aad1eca55ac75f437789514224e9b922fe514/third_party/WebKit/Source/wtf/text/StringView.cpp
[modify] https://crrev.com/9b0aad1eca55ac75f437789514224e9b922fe514/third_party/WebKit/Source/wtf/text/StringView.h
[add] https://crrev.com/9b0aad1eca55ac75f437789514224e9b922fe514/third_party/WebKit/Source/wtf/text/StringViewTest.cpp
[modify] https://crrev.com/9b0aad1eca55ac75f437789514224e9b922fe514/third_party/WebKit/Source/wtf/text/WTFString.h
[modify] https://crrev.com/9b0aad1eca55ac75f437789514224e9b922fe514/third_party/WebKit/Source/wtf/wtf.gypi
[modify] https://crrev.com/9b0aad1eca55ac75f437789514224e9b922fe514/third_party/WebKit/public/platform/WebString.h

Project Member

Comment 7 by bugdroid1@chromium.org, Jun 1 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015

commit 41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015
Author: esprehn <esprehn@chromium.org>
Date: Wed Jun 01 00:48:02 2016

Remove StringBuilder::appendLiteral.

We can just rely on the append(StringView) version instead. This does
mean we have to take 2 branches in some cases, but it should be
very minimal and since the code is inline the compiler can also
likely eliminate it.

This was originally committed as:
https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea
but was reverted due to a bad assert that landed in a dependent
patch.

BUG= 615174 

Review-Url: https://codereview.chromium.org/2017053003
Cr-Commit-Position: refs/heads/master@{#396996}

[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/bindings/core/v8/ExceptionMessages.h
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/css/CSSBasicShapeValues.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/css/CSSCalculationValue.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/css/CSSCounterValue.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/css/CSSCrossfadeValue.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/css/CSSFontFaceRule.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/css/CSSFontFeatureValue.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/css/CSSGradientValue.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/css/CSSGroupingRule.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/css/CSSImageSetValue.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/css/CSSImportRule.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/css/CSSKeyframesRule.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/css/CSSMediaRule.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/css/CSSNamespaceRule.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/css/CSSPageRule.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/css/CSSPaintValue.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/css/CSSSelector.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/css/CSSSelectorList.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/css/CSSStyleRule.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/css/CSSStyleSheet.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/css/CSSSupportsRule.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/css/CSSViewportRule.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/css/MediaList.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/css/MediaQuery.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/css/MediaQueryExp.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/css/MediaQuerySetTest.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/css/StylePropertySerializer.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/css/StyleRuleKeyframe.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/css/parser/CSSParser.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/dom/DatasetDOMStringMap.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/dom/Document.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/dom/Element.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/dom/Node.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/dom/Range.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/dom/SandboxFlags.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/dom/Text.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/editing/Position.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/editing/VisibleSelection.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/editing/serializers/HTMLInterchange.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/editing/serializers/MarkupFormatter.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/editing/serializers/StyledMarkupAccumulator.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/fetch/CrossOriginAccessControl.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/fileapi/FileReaderLoader.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/frame/FrameConsole.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/frame/FrameSerializer.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/html/ImageDocument.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/html/forms/FormController.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/html/parser/XSSAuditorDelegate.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/inspector/InspectorApplicationCacheAgent.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/inspector/InspectorHighlight.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/inspector/InspectorLayerTreeAgent.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/inspector/ScriptArguments.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/layout/LayoutTheme.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/layout/LayoutTreeAsText.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/page/EventSource.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/page/FrameTree.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/svg/SVGParsingError.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/testing/Internals.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/core/xml/parser/XMLErrors.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/modules/credentialmanager/PasswordCredentialTest.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/modules/filesystem/DOMFileSystem.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/modules/filesystem/DOMFileSystemBase.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/modules/websockets/DOMWebSocket.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/platform/Decimal.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/platform/JSONValues.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/platform/PODInterval.h
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/platform/exported/WebMediaConstraints.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/platform/graphics/Color.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/platform/mhtml/MHTMLArchive.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/platform/text/DateTimeFormat.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/platform/text/DateTimeFormat.h
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/platform/text/LocaleICUTest.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/platform/text/LocaleWin.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/platform/text/PlatformLocale.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/platform/weborigin/SchemeRegistry.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/platform/weborigin/SecurityOrigin.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/web/WebAXObject.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/web/WebFrameSerializerImpl.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/web/tests/FrameSerializerTest.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/wtf/DateMath.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/wtf/InstanceCounter.cpp
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/wtf/text/StringBuilder.h
[modify] https://crrev.com/41584c4ff6bc7a0556ffbbb3eaa90d46f7ddd015/third_party/WebKit/Source/wtf/text/StringBuilderTest.cpp

Project Member

Comment 8 by bugdroid1@chromium.org, Jun 1 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e3c7c11bf601fc6ffbea29ac7fd02b42c283840a

commit e3c7c11bf601fc6ffbea29ac7fd02b42c283840a
Author: esprehn <esprehn@chromium.org>
Date: Wed Jun 01 10:12:28 2016

Replace CSSParserString with StringView.

This removes the special string type the parser was using in favor of
StringView. In doing so it also makes all of the string allocations
inside the parser more explicit.

Doing this requires adding equalIgnoringASCIICase for StringView, and
also operator[], tests are included. :)

One major change is now StringView::toString() will attempt to create
an 8bit string from a 16bit StringView whenever possible. This does
mean potentially wasted work inside StringImpl::create8BitIfPossible
if callers are frequently making strings with unicode characters in
them. We should see how often this happens in practice, and probably
optimize the code in create8BitIfPossible to first scan the string
to avoid the wasted malloc.

BUG= 615174 

Review-Url: https://codereview.chromium.org/2024373002
Cr-Commit-Position: refs/heads/master@{#397094}

[modify] https://crrev.com/e3c7c11bf601fc6ffbea29ac7fd02b42c283840a/third_party/WebKit/Source/core/css/CSSVariableData.cpp
[modify] https://crrev.com/e3c7c11bf601fc6ffbea29ac7fd02b42c283840a/third_party/WebKit/Source/core/css/cssom/CSSKeywordValue.cpp
[modify] https://crrev.com/e3c7c11bf601fc6ffbea29ac7fd02b42c283840a/third_party/WebKit/Source/core/css/parser/CSSAtRuleID.cpp
[modify] https://crrev.com/e3c7c11bf601fc6ffbea29ac7fd02b42c283840a/third_party/WebKit/Source/core/css/parser/CSSAtRuleID.h
[modify] https://crrev.com/e3c7c11bf601fc6ffbea29ac7fd02b42c283840a/third_party/WebKit/Source/core/css/parser/CSSParser.cpp
[modify] https://crrev.com/e3c7c11bf601fc6ffbea29ac7fd02b42c283840a/third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp
[modify] https://crrev.com/e3c7c11bf601fc6ffbea29ac7fd02b42c283840a/third_party/WebKit/Source/core/css/parser/CSSParserImpl.cpp
[delete] https://crrev.com/1b67e83a4e32a1acbb89e4680d4ec2771ab765ad/third_party/WebKit/Source/core/css/parser/CSSParserString.h
[modify] https://crrev.com/e3c7c11bf601fc6ffbea29ac7fd02b42c283840a/third_party/WebKit/Source/core/css/parser/CSSParserToken.cpp
[modify] https://crrev.com/e3c7c11bf601fc6ffbea29ac7fd02b42c283840a/third_party/WebKit/Source/core/css/parser/CSSParserToken.h
[modify] https://crrev.com/e3c7c11bf601fc6ffbea29ac7fd02b42c283840a/third_party/WebKit/Source/core/css/parser/CSSParserTokenTest.cpp
[modify] https://crrev.com/e3c7c11bf601fc6ffbea29ac7fd02b42c283840a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
[modify] https://crrev.com/e3c7c11bf601fc6ffbea29ac7fd02b42c283840a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.h
[modify] https://crrev.com/e3c7c11bf601fc6ffbea29ac7fd02b42c283840a/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp
[modify] https://crrev.com/e3c7c11bf601fc6ffbea29ac7fd02b42c283840a/third_party/WebKit/Source/core/css/parser/CSSSelectorParser.cpp
[modify] https://crrev.com/e3c7c11bf601fc6ffbea29ac7fd02b42c283840a/third_party/WebKit/Source/core/css/parser/CSSTokenizer.cpp
[modify] https://crrev.com/e3c7c11bf601fc6ffbea29ac7fd02b42c283840a/third_party/WebKit/Source/core/css/parser/CSSTokenizer.h
[modify] https://crrev.com/e3c7c11bf601fc6ffbea29ac7fd02b42c283840a/third_party/WebKit/Source/core/css/parser/CSSTokenizerInputStream.cpp
[modify] https://crrev.com/e3c7c11bf601fc6ffbea29ac7fd02b42c283840a/third_party/WebKit/Source/core/css/parser/CSSTokenizerInputStream.h
[modify] https://crrev.com/e3c7c11bf601fc6ffbea29ac7fd02b42c283840a/third_party/WebKit/Source/core/css/parser/CSSTokenizerTest.cpp
[modify] https://crrev.com/e3c7c11bf601fc6ffbea29ac7fd02b42c283840a/third_party/WebKit/Source/core/css/parser/CSSVariableParser.cpp
[modify] https://crrev.com/e3c7c11bf601fc6ffbea29ac7fd02b42c283840a/third_party/WebKit/Source/core/css/parser/MediaQueryParser.cpp
[modify] https://crrev.com/e3c7c11bf601fc6ffbea29ac7fd02b42c283840a/third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.cpp
[modify] https://crrev.com/e3c7c11bf601fc6ffbea29ac7fd02b42c283840a/third_party/WebKit/Source/wtf/text/StringView.cpp
[modify] https://crrev.com/e3c7c11bf601fc6ffbea29ac7fd02b42c283840a/third_party/WebKit/Source/wtf/text/StringView.h
[modify] https://crrev.com/e3c7c11bf601fc6ffbea29ac7fd02b42c283840a/third_party/WebKit/Source/wtf/text/StringViewTest.cpp

Project Member

Comment 9 by bugdroid1@chromium.org, Jun 2 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/07dd6f5d6b4603cde39464177d6fac57b7835317

commit 07dd6f5d6b4603cde39464177d6fac57b7835317
Author: esprehn <esprehn@chromium.org>
Date: Thu Jun 02 06:03:22 2016

Add StringView::toAtomicString().

We should go directly from the LChar*/UChar* to an AtomicString which
saves doing the malloc and copy of a temporary StringImpl to pass into
the AtomicString constructor. Instead if we pass the bytes and length
the HashSet translator can directly hash the bytes and lookup the
existing atomic StringImpl.

BUG= 615174 

Review-Url: https://codereview.chromium.org/2033503002
Cr-Commit-Position: refs/heads/master@{#397306}

[modify] https://crrev.com/07dd6f5d6b4603cde39464177d6fac57b7835317/third_party/WebKit/Source/core/css/parser/CSSParserImpl.cpp
[modify] https://crrev.com/07dd6f5d6b4603cde39464177d6fac57b7835317/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
[modify] https://crrev.com/07dd6f5d6b4603cde39464177d6fac57b7835317/third_party/WebKit/Source/core/css/parser/CSSSelectorParser.cpp
[modify] https://crrev.com/07dd6f5d6b4603cde39464177d6fac57b7835317/third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.cpp
[modify] https://crrev.com/07dd6f5d6b4603cde39464177d6fac57b7835317/third_party/WebKit/Source/wtf/text/StringView.cpp
[modify] https://crrev.com/07dd6f5d6b4603cde39464177d6fac57b7835317/third_party/WebKit/Source/wtf/text/StringView.h
[modify] https://crrev.com/07dd6f5d6b4603cde39464177d6fac57b7835317/third_party/WebKit/Source/wtf/text/StringViewTest.cpp

Project Member

Comment 10 by bugdroid1@chromium.org, Jun 6 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/580cbf5d215fee758dd5c447cf03885b07bc9d2e

commit 580cbf5d215fee758dd5c447cf03885b07bc9d2e
Author: esprehn <esprehn@chromium.org>
Date: Mon Jun 06 06:39:05 2016

Implement StringImpl sharing for StringView::toString().

Prior to https://codereview.chromium.org/2007103003 StringBuilder had an
optimization that would share the StringImpl when calling append() with
a String the first time. This meant that doing element.textContent on
an Element with a single Text node child wouldn't need to string copy.

The optimization also helps the parser, removing a string copy when
flushing text in the HTML parser (flushPendingText) when there's a
single text that was appended, and the text is a reasonable length
(<= 65536 bytes).

This optimization further helps any code that would potentially append
an AtomicString to a StringBuilder and then do toAtomicString()
or toString() by ensuring we return the same AtomicString again
avoiding a bunch of work, and allowing the atomic string optimization
to propagate to the result.

This patch restores the StringBuilder optimization by adding a
StringImpl* member to StringView and allowing toString() and
toAtomicString() to return that member when the offset is zero and the
length is the same as the input string.

This patch also collapses the m_is8Bit flag into the m_impl by just
reusing the field to know if the StringView is 8bit. We now store the
shared empty 8bit or 16bit strings in the impl field for views created
from sources that are not backed by StringImpl. Doing this keeps the
StringView class to be only 2 ptrs and an unsigned wide.

I also further simplified the code by using the union members directly
and by adding a void* bytes() getter to StringImpl which removed the
branch on is8Bit for the common case of constructing a StringView from
a String or StringImpl with no offset, and the full length.

BUG= 615174 

Review-Url: https://codereview.chromium.org/2033293002
Cr-Commit-Position: refs/heads/master@{#397986}

[modify] https://crrev.com/580cbf5d215fee758dd5c447cf03885b07bc9d2e/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp
[modify] https://crrev.com/580cbf5d215fee758dd5c447cf03885b07bc9d2e/third_party/WebKit/Source/wtf/text/StringBuilder.h
[modify] https://crrev.com/580cbf5d215fee758dd5c447cf03885b07bc9d2e/third_party/WebKit/Source/wtf/text/StringBuilderTest.cpp
[modify] https://crrev.com/580cbf5d215fee758dd5c447cf03885b07bc9d2e/third_party/WebKit/Source/wtf/text/StringImpl.h
[modify] https://crrev.com/580cbf5d215fee758dd5c447cf03885b07bc9d2e/third_party/WebKit/Source/wtf/text/StringView.cpp
[modify] https://crrev.com/580cbf5d215fee758dd5c447cf03885b07bc9d2e/third_party/WebKit/Source/wtf/text/StringView.h
[modify] https://crrev.com/580cbf5d215fee758dd5c447cf03885b07bc9d2e/third_party/WebKit/Source/wtf/text/StringViewTest.cpp

Project Member

Comment 11 by bugdroid1@chromium.org, Jun 10 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b2174605d75d559c7b1f3e4f87b150bbd399cdba

commit b2174605d75d559c7b1f3e4f87b150bbd399cdba
Author: esprehn <esprehn@chromium.org>
Date: Fri Jun 10 04:30:25 2016

Encapsulate the CSSPrimitiveValue UnitType trie bethind a method that takes a StringView.

This removes the need for callers to manually branch on is8Bit() and
also avoids having these separate functions in a header that's harder
to discover.

Now CSSPrimitiveValue has both unitTypeToString and stringToUnitType.

BUG= 615174 

Review-Url: https://codereview.chromium.org/2051313002
Cr-Commit-Position: refs/heads/master@{#399090}

[modify] https://crrev.com/b2174605d75d559c7b1f3e4f87b150bbd399cdba/third_party/WebKit/Source/build/scripts/templates/CSSPrimitiveValueUnitTrie.cpp.tmpl
[modify] https://crrev.com/b2174605d75d559c7b1f3e4f87b150bbd399cdba/third_party/WebKit/Source/core/core.gypi
[modify] https://crrev.com/b2174605d75d559c7b1f3e4f87b150bbd399cdba/third_party/WebKit/Source/core/css/CSSPrimitiveValue.h
[delete] https://crrev.com/15efe1fc830a0215a9668c6ea6f50e95a67cc21e/third_party/WebKit/Source/core/css/CSSPrimitiveValueUnitTrie.h
[modify] https://crrev.com/b2174605d75d559c7b1f3e4f87b150bbd399cdba/third_party/WebKit/Source/core/css/cssom/CSSAngleValue.cpp
[modify] https://crrev.com/b2174605d75d559c7b1f3e4f87b150bbd399cdba/third_party/WebKit/Source/core/css/cssom/CSSLengthValue.cpp
[modify] https://crrev.com/b2174605d75d559c7b1f3e4f87b150bbd399cdba/third_party/WebKit/Source/core/css/parser/CSSParserToken.cpp

Project Member

Comment 12 by bugdroid1@chromium.org, Jun 10 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7dc7c0fc073b84f3050726b52ceec1bbcb304ba3

commit 7dc7c0fc073b84f3050726b52ceec1bbcb304ba3
Author: esprehn <esprehn@chromium.org>
Date: Fri Jun 10 04:35:59 2016

Move WTF string to number converter functions to StringToNumber.h

This allows various things to call these methods without having to
depend on the WTFString.h header which was a strange place for
a bunch of functions that take LChar* and UChar*'s.

No functional changes are made, the code is just moved around.

BUG= 615174 

Review-Url: https://codereview.chromium.org/2058613002
Cr-Commit-Position: refs/heads/master@{#399095}

[modify] https://crrev.com/7dc7c0fc073b84f3050726b52ceec1bbcb304ba3/third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp
[modify] https://crrev.com/7dc7c0fc073b84f3050726b52ceec1bbcb304ba3/third_party/WebKit/Source/core/css/parser/CSSTokenizerInputStream.cpp
[modify] https://crrev.com/7dc7c0fc073b84f3050726b52ceec1bbcb304ba3/third_party/WebKit/Source/core/frame/csp/CSPSourceList.cpp
[modify] https://crrev.com/7dc7c0fc073b84f3050726b52ceec1bbcb304ba3/third_party/WebKit/Source/core/html/HTMLDimension.cpp
[modify] https://crrev.com/7dc7c0fc073b84f3050726b52ceec1bbcb304ba3/third_party/WebKit/Source/core/html/HTMLFontElement.cpp
[modify] https://crrev.com/7dc7c0fc073b84f3050726b52ceec1bbcb304ba3/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp
[modify] https://crrev.com/7dc7c0fc073b84f3050726b52ceec1bbcb304ba3/third_party/WebKit/Source/core/html/HTMLMetaElement-in.cpp
[modify] https://crrev.com/7dc7c0fc073b84f3050726b52ceec1bbcb304ba3/third_party/WebKit/Source/core/html/parser/HTMLParserIdioms.cpp
[modify] https://crrev.com/7dc7c0fc073b84f3050726b52ceec1bbcb304ba3/third_party/WebKit/Source/core/html/parser/HTMLSrcsetParser.cpp
[modify] https://crrev.com/7dc7c0fc073b84f3050726b52ceec1bbcb304ba3/third_party/WebKit/Source/core/html/track/vtt/VTTScanner.cpp
[modify] https://crrev.com/7dc7c0fc073b84f3050726b52ceec1bbcb304ba3/third_party/WebKit/Source/platform/inspector_protocol/String16WTF.h
[modify] https://crrev.com/7dc7c0fc073b84f3050726b52ceec1bbcb304ba3/third_party/WebKit/Source/wtf/text/StringImpl.cpp
[add] https://crrev.com/7dc7c0fc073b84f3050726b52ceec1bbcb304ba3/third_party/WebKit/Source/wtf/text/StringToNumber.cpp
[add] https://crrev.com/7dc7c0fc073b84f3050726b52ceec1bbcb304ba3/third_party/WebKit/Source/wtf/text/StringToNumber.h
[modify] https://crrev.com/7dc7c0fc073b84f3050726b52ceec1bbcb304ba3/third_party/WebKit/Source/wtf/text/WTFString.cpp
[modify] https://crrev.com/7dc7c0fc073b84f3050726b52ceec1bbcb304ba3/third_party/WebKit/Source/wtf/text/WTFString.h
[modify] https://crrev.com/7dc7c0fc073b84f3050726b52ceec1bbcb304ba3/third_party/WebKit/Source/wtf/wtf.gypi

Comment 13 Deleted

Comment 14 Deleted

Project Member

Comment 15 by bugdroid1@chromium.org, Jun 22 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/53bc7c8b288db21ebb19f5816c45a177f51a1ff4

commit 53bc7c8b288db21ebb19f5816c45a177f51a1ff4
Author: esprehn <esprehn@chromium.org>
Date: Wed Jun 22 11:50:49 2016

Convert CSSParserToken::valueEqualsIgnoringASCIICase to equalIgnoringASCIICase.

There's no need for this indirection.

BUG= 615174 

Review-Url: https://codereview.chromium.org/2086283002
Cr-Commit-Position: refs/heads/master@{#401255}

[modify] https://crrev.com/53bc7c8b288db21ebb19f5816c45a177f51a1ff4/third_party/WebKit/Source/core/css/parser/CSSParserImpl.cpp
[modify] https://crrev.com/53bc7c8b288db21ebb19f5816c45a177f51a1ff4/third_party/WebKit/Source/core/css/parser/CSSParserToken.h
[modify] https://crrev.com/53bc7c8b288db21ebb19f5816c45a177f51a1ff4/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
[modify] https://crrev.com/53bc7c8b288db21ebb19f5816c45a177f51a1ff4/third_party/WebKit/Source/core/css/parser/CSSSelectorParser.cpp
[modify] https://crrev.com/53bc7c8b288db21ebb19f5816c45a177f51a1ff4/third_party/WebKit/Source/core/css/parser/CSSSupportsParser.cpp
[modify] https://crrev.com/53bc7c8b288db21ebb19f5816c45a177f51a1ff4/third_party/WebKit/Source/core/css/parser/CSSVariableParser.cpp
[modify] https://crrev.com/53bc7c8b288db21ebb19f5816c45a177f51a1ff4/third_party/WebKit/Source/core/css/parser/MediaQueryParser.cpp
[modify] https://crrev.com/53bc7c8b288db21ebb19f5816c45a177f51a1ff4/third_party/WebKit/Source/core/css/parser/SizesCalcParser.cpp
[modify] https://crrev.com/53bc7c8b288db21ebb19f5816c45a177f51a1ff4/third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.cpp

Comment 16 by tkent@chromium.org, Jun 23 2016

Components: -Blink>WTF Blink>Internals>WTF
Renaming Blink>WTF to Blink>Internals>WTF.

Project Member

Comment 17 by bugdroid1@chromium.org, Jul 13 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ad01087faacdf31909e80c93bcf11783f99a06a4

commit ad01087faacdf31909e80c93bcf11783f99a06a4
Author: esprehn <esprehn@chromium.org>
Date: Wed Jul 13 03:08:11 2016

Move StringView constructors into WTFString.h/AtomicString.h

This will allow String and AtomicString to depend on StringView for
methods and arguments, for example making operator== take a StringView
to simplify the overload set.

I also removed the:
    StringView(const void* bytes, unsigned length, bool is8Bit)
constructor since it could be called by mistake when doing:
StringView("foo", 1, 2) trying to do (offset, length) when you're
supposed to do StringView("foo" + 1, 2) instead.

This had confused me on a couple occasions where I was passing a
length and setting is8Bit instead. This constructor is only needed
by CSSParserToken so lets just inline it there.

BUG= 615174 

Review-Url: https://codereview.chromium.org/2140353002
Cr-Commit-Position: refs/heads/master@{#404943}

[modify] https://crrev.com/ad01087faacdf31909e80c93bcf11783f99a06a4/third_party/WebKit/Source/core/css/parser/CSSParserToken.h
[modify] https://crrev.com/ad01087faacdf31909e80c93bcf11783f99a06a4/third_party/WebKit/Source/wtf/text/AtomicString.h
[modify] https://crrev.com/ad01087faacdf31909e80c93bcf11783f99a06a4/third_party/WebKit/Source/wtf/text/StringView.cpp
[modify] https://crrev.com/ad01087faacdf31909e80c93bcf11783f99a06a4/third_party/WebKit/Source/wtf/text/StringView.h
[modify] https://crrev.com/ad01087faacdf31909e80c93bcf11783f99a06a4/third_party/WebKit/Source/wtf/text/StringViewTest.cpp
[modify] https://crrev.com/ad01087faacdf31909e80c93bcf11783f99a06a4/third_party/WebKit/Source/wtf/text/WTFString.h

Project Member

Comment 18 by bugdroid1@chromium.org, Jul 13 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a348d19c81ac29626a38a47a683856f22102bb42

commit a348d19c81ac29626a38a47a683856f22102bb42
Author: esprehn <esprehn@chromium.org>
Date: Wed Jul 13 04:18:48 2016

Make v8AtomicString take a StringView.

By accepting a StringView v8AtomicString, which is used for property
access all over the engine, can have the length of the input literal
strings be computed at compile time. For example
v8AtomicString(isolate, "foo") will now compile the length of 3 into the
binary directly.

This patch also makes v8AtomicString take 8/16 bit strings like all of
the other string handling functions and moves the utf8 logic into a new
function v8StringFromUtf8. This makes the code more clear since blink
rarely ever uses utf8 strings, and should also be faster since v8
strings are either latin1 or utf16 just like blink, so calling the utf8
methods for property access was going through a bunch of logic on the
string that wasn't needed.

The two callers that actually expect utf8 inputs have been changed, and
one caller in WindowProxy::setSecurityToken was switched to not using
utf8 since it wasn't actually needed as it was going from a blink String
to utf8 and then back into a v8::String which is the same representation
as the blink string.

BUG= 615174 

Review-Url: https://codereview.chromium.org/2142373002
Cr-Commit-Position: refs/heads/master@{#405011}

[modify] https://crrev.com/a348d19c81ac29626a38a47a683856f22102bb42/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp
[modify] https://crrev.com/a348d19c81ac29626a38a47a683856f22102bb42/third_party/WebKit/Source/bindings/core/v8/V8Binding.h
[modify] https://crrev.com/a348d19c81ac29626a38a47a683856f22102bb42/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp
[modify] https://crrev.com/a348d19c81ac29626a38a47a683856f22102bb42/third_party/WebKit/Source/modules/crypto/CryptoResultImpl.cpp

Comment 19 Deleted

Comment 20 Deleted

Project Member

Comment 22 by bugdroid1@chromium.org, Jul 19 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9d4b30269e660985f657126b21e7ace229ec2e07

commit 9d4b30269e660985f657126b21e7ace229ec2e07
Author: esprehn <esprehn@chromium.org>
Date: Tue Jul 19 20:48:12 2016

Add StringView constructor that takes a ref to save a branch in CSSTokenizerInputStream::rangeAt.

CSSTokenizerInputStream never has a null m_string so the null check in StringView's
constructor is just waste. It also makes the code bigger if we were to inline the
function since we need both the null (clear()) and the non-null (set()) code from
StringView.

Lets introduce a StringView constructor set that takes a StringImpl& and then
use it in CSSTokenizerInputStream::rangeAt() allowing us to skip the branch.
I then also made the function inline.

BUG= 615174 ,605792

Review-Url: https://codereview.chromium.org/2162863002
Cr-Commit-Position: refs/heads/master@{#406375}

[modify] https://crrev.com/9d4b30269e660985f657126b21e7ace229ec2e07/third_party/WebKit/Source/core/css/parser/CSSTokenizerInputStream.cpp
[modify] https://crrev.com/9d4b30269e660985f657126b21e7ace229ec2e07/third_party/WebKit/Source/core/css/parser/CSSTokenizerInputStream.h
[modify] https://crrev.com/9d4b30269e660985f657126b21e7ace229ec2e07/third_party/WebKit/Source/wtf/text/StringView.h
[modify] https://crrev.com/9d4b30269e660985f657126b21e7ace229ec2e07/third_party/WebKit/Source/wtf/text/StringViewTest.cpp

Project Member

Comment 23 by bugdroid1@chromium.org, Aug 5 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9a8e5154f97acb2d9ccdee61e464e0d2b33b100e

commit 9a8e5154f97acb2d9ccdee61e464e0d2b33b100e
Author: esprehn <esprehn@chromium.org>
Date: Fri Aug 05 04:01:10 2016

Use StringView for equalIgnoringCase.

This lets us merge the code paths and simplifies the code a bunch.

In doing this I removed the ASCII fast path that was in the
equalsIgnoringCase(const StringImpl*, const LChar*) function, though
curiously it wasn't in the (const UChar*, const LChar*) one, but that
function is also used a lot less often. Lets try removing this ancient
fast path for now (from 2006 with no comments about why it exists [1])
and instead opt for simpler code.

For comparing LChar strings the new path should be just as fast if not
faster. For comparing LChar to UChar strings we end up doing a foldCase
call which will be slower, but we should see how bad it is first.

Long term almost all callers of equalIgnoringCase need to switch to
equalIgnoringASCIICase anyway since that's what the specs require
(and what Webkit does now), which will put this fast path back in
place. We can also add the fast path back in the (LChar, UChar) path
if needed.

Switching all of the callers over to the new StringView version of
equalIgnoringCase also exposed that the CSP parsing logic was
accidentally using the function incorrectly and doing prefix matches
instead of actually comparing to the expected values as described in
 issue 634217 . This patches fixes that mistake.

[1] https://chromium.googlesource.com/chromium/src/+/6f022a05a21fc5ed091d7bcb6b81104ea2afdf8e

BUG= 615174 ,  634217 

Review-Url: https://codereview.chromium.org/2148423003
Cr-Commit-Position: refs/heads/master@{#409987}

[modify] https://crrev.com/9a8e5154f97acb2d9ccdee61e464e0d2b33b100e/third_party/WebKit/LayoutTests/TestExpectations
[modify] https://crrev.com/9a8e5154f97acb2d9ccdee61e464e0d2b33b100e/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp
[modify] https://crrev.com/9a8e5154f97acb2d9ccdee61e464e0d2b33b100e/third_party/WebKit/Source/core/frame/csp/CSPSourceList.cpp
[modify] https://crrev.com/9a8e5154f97acb2d9ccdee61e464e0d2b33b100e/third_party/WebKit/Source/core/html/parser/HTMLTreeBuilderSimulator.cpp
[modify] https://crrev.com/9a8e5154f97acb2d9ccdee61e464e0d2b33b100e/third_party/WebKit/Source/platform/weborigin/KURL.h
[modify] https://crrev.com/9a8e5154f97acb2d9ccdee61e464e0d2b33b100e/third_party/WebKit/Source/wtf/text/AtomicString.h
[modify] https://crrev.com/9a8e5154f97acb2d9ccdee61e464e0d2b33b100e/third_party/WebKit/Source/wtf/text/StringHash.h
[modify] https://crrev.com/9a8e5154f97acb2d9ccdee61e464e0d2b33b100e/third_party/WebKit/Source/wtf/text/StringImpl.cpp
[modify] https://crrev.com/9a8e5154f97acb2d9ccdee61e464e0d2b33b100e/third_party/WebKit/Source/wtf/text/StringImpl.h
[modify] https://crrev.com/9a8e5154f97acb2d9ccdee61e464e0d2b33b100e/third_party/WebKit/Source/wtf/text/StringView.cpp
[modify] https://crrev.com/9a8e5154f97acb2d9ccdee61e464e0d2b33b100e/third_party/WebKit/Source/wtf/text/StringView.h
[modify] https://crrev.com/9a8e5154f97acb2d9ccdee61e464e0d2b33b100e/third_party/WebKit/Source/wtf/text/WTFString.h

Project Member

Comment 24 by bugdroid1@chromium.org, Aug 9 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/54316d7250bc5a6e48ad1161cf6014081b7f7b89

commit 54316d7250bc5a6e48ad1161cf6014081b7f7b89
Author: esprehn <esprehn@chromium.org>
Date: Tue Aug 09 02:41:18 2016

Use StringView for String::find.

This merges all of the StringImpl::find code paths for non-single letter
cases by using StringView.

I also made all of the find overloads match for String and AtomicString.

BUG= 615174 

Review-Url: https://codereview.chromium.org/2225173002
Cr-Commit-Position: refs/heads/master@{#410547}

[modify] https://crrev.com/54316d7250bc5a6e48ad1161cf6014081b7f7b89/third_party/WebKit/Source/wtf/text/AtomicString.h
[modify] https://crrev.com/54316d7250bc5a6e48ad1161cf6014081b7f7b89/third_party/WebKit/Source/wtf/text/StringImpl.cpp
[modify] https://crrev.com/54316d7250bc5a6e48ad1161cf6014081b7f7b89/third_party/WebKit/Source/wtf/text/StringImpl.h
[modify] https://crrev.com/54316d7250bc5a6e48ad1161cf6014081b7f7b89/third_party/WebKit/Source/wtf/text/WTFString.h

Project Member

Comment 25 by bugdroid1@chromium.org, Aug 9 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/95f6bad9ec8883e5596a3069ea3458c109a01ca5

commit 95f6bad9ec8883e5596a3069ea3458c109a01ca5
Author: esprehn <esprehn@chromium.org>
Date: Tue Aug 09 05:40:48 2016

String::contains should use StringView.

By happy accident the template overload of contains made the patch in
https://codereview.chromium.org/2225173002 remove all of the String
allocations for contains callers. Unfortunately it didn't fix
AtomicString which didn't use a template.

Lets make the API surface consistent across AtomicString and String
and fix all the string allocations for AtomicString::contains().

BUG= 615174 

Review-Url: https://codereview.chromium.org/2227903002
Cr-Commit-Position: refs/heads/master@{#410590}

[modify] https://crrev.com/95f6bad9ec8883e5596a3069ea3458c109a01ca5/third_party/WebKit/Source/platform/network/HTTPParsers.cpp
[modify] https://crrev.com/95f6bad9ec8883e5596a3069ea3458c109a01ca5/third_party/WebKit/Source/wtf/text/AtomicString.h
[modify] https://crrev.com/95f6bad9ec8883e5596a3069ea3458c109a01ca5/third_party/WebKit/Source/wtf/text/TextEncodingRegistry.cpp
[modify] https://crrev.com/95f6bad9ec8883e5596a3069ea3458c109a01ca5/third_party/WebKit/Source/wtf/text/WTFString.h

Project Member

Comment 27 by bugdroid1@chromium.org, Aug 10 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c34b20c196d32daae5764098479936bc7e10e61f

commit c34b20c196d32daae5764098479936bc7e10e61f
Author: esprehn <esprehn@chromium.org>
Date: Wed Aug 10 05:53:24 2016

Use StringView for String::findIgnoringCase and findIgnoringASCIICase.

StringImpl's version of this already takes a StringView, but the proxy
functions on String took a const String& so callers like
didFireWebGLErrorOrWarning doing message.findIgnoringCase("error") were
allocating temporary strings.

Instead we make the String methods take a StringView too to avoid the
extra allocations. I also added these methods to AtomicString so the API
is the same.

BUG= 615174 

Review-Url: https://codereview.chromium.org/2230643002
Cr-Commit-Position: refs/heads/master@{#410973}

[modify] https://crrev.com/c34b20c196d32daae5764098479936bc7e10e61f/third_party/WebKit/Source/wtf/text/AtomicString.h
[modify] https://crrev.com/c34b20c196d32daae5764098479936bc7e10e61f/third_party/WebKit/Source/wtf/text/WTFString.h

Project Member

Comment 28 by bugdroid1@chromium.org, Aug 11 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f10ca9328c07c6bddfe281336072d5650a533dfc

commit f10ca9328c07c6bddfe281336072d5650a533dfc
Author: esprehn <esprehn@chromium.org>
Date: Thu Aug 11 07:43:07 2016

Use StringView for String::append and ::insert.

This avoids allocating temporary strings when calling this method with a literal
string. I also simplified the code by merging the code paths.

Since StringAppend can't implicitly convert to StringView we can no longer write:
string.append(stringA + stringB) or string.append(stringA + "foo") since the
result of the + operator (a StringAppend object) is not allowed anymore. Doing
this actually caught a bunch of callers which were allocating temporary strings
trying to build up a bigger string and should be using StringBuilder instead. For
example extractWebGLContextCreationError was allocating a huge number of
temporary strings.

BUG= 615174 

Review-Url: https://codereview.chromium.org/2235113002
Cr-Commit-Position: refs/heads/master@{#411285}

[modify] https://crrev.com/f10ca9328c07c6bddfe281336072d5650a533dfc/third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp
[modify] https://crrev.com/f10ca9328c07c6bddfe281336072d5650a533dfc/third_party/WebKit/Source/core/fetch/CrossOriginAccessControl.cpp
[modify] https://crrev.com/f10ca9328c07c6bddfe281336072d5650a533dfc/third_party/WebKit/Source/modules/encryptedmedia/ContentDecryptionModuleResultPromise.cpp
[modify] https://crrev.com/f10ca9328c07c6bddfe281336072d5650a533dfc/third_party/WebKit/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp
[modify] https://crrev.com/f10ca9328c07c6bddfe281336072d5650a533dfc/third_party/WebKit/Source/modules/fetch/DataConsumerHandleTestUtil.h
[modify] https://crrev.com/f10ca9328c07c6bddfe281336072d5650a533dfc/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
[modify] https://crrev.com/f10ca9328c07c6bddfe281336072d5650a533dfc/third_party/WebKit/Source/platform/graphics/LoggingCanvas.cpp
[modify] https://crrev.com/f10ca9328c07c6bddfe281336072d5650a533dfc/third_party/WebKit/Source/wtf/text/WTFString.cpp
[modify] https://crrev.com/f10ca9328c07c6bddfe281336072d5650a533dfc/third_party/WebKit/Source/wtf/text/WTFString.h

Project Member

Comment 29 by bugdroid1@chromium.org, Aug 13 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f4231901c30a54d3a94de3c7be22ffab13011032

commit f4231901c30a54d3a94de3c7be22ffab13011032
Author: esprehn <esprehn@chromium.org>
Date: Sat Aug 13 01:32:20 2016

Use StringView for String::replace.

This avoids allocating temporary strings when calling ::replace("a", "b").

Note that unlike other String simplifications done recently we don't add this
API to AtomicString since doing replace() calls on an AtomicString and
allocating more AtomicStrings isn't something we really expect people to do.

BUG= 615174 

Review-Url: https://codereview.chromium.org/2241573004
Cr-Commit-Position: refs/heads/master@{#411846}

[modify] https://crrev.com/f4231901c30a54d3a94de3c7be22ffab13011032/third_party/WebKit/Source/wtf/text/StringImpl.cpp
[modify] https://crrev.com/f4231901c30a54d3a94de3c7be22ffab13011032/third_party/WebKit/Source/wtf/text/StringImpl.h
[modify] https://crrev.com/f4231901c30a54d3a94de3c7be22ffab13011032/third_party/WebKit/Source/wtf/text/WTFString.h

Project Member

Comment 30 by bugdroid1@chromium.org, Aug 27 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d4a17e1863ab232b718caeb4afdd4252af99cef0

commit d4a17e1863ab232b718caeb4afdd4252af99cef0
Author: esprehn <esprehn@chromium.org>
Date: Sat Aug 27 11:05:09 2016

Use StringView for v8String().

By using StringView here we can avoid allocating externalized strings
for all of the literal strings used like v8String(isolate, "example")
where we would first allocate a WTF::String then externalize it into
a v8::String. Instead we can just go directly to a v8::String which is
faster and uses less memory.

BUG= 615174 

Review-Url: https://codereview.chromium.org/2285743003
Cr-Commit-Position: refs/heads/master@{#414920}

[modify] https://crrev.com/d4a17e1863ab232b718caeb4afdd4252af99cef0/third_party/WebKit/Source/bindings/core/v8/V8Binding.h

Project Member

Comment 31 by bugdroid1@chromium.org, Aug 30 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/572944fef3414bbbc946e732afca05e80813ba95

commit 572944fef3414bbbc946e732afca05e80813ba95
Author: esprehn <esprehn@chromium.org>
Date: Tue Aug 30 03:57:01 2016

Simplify AnimationTestHelper.h

We don't need these extra helper functions and we can use StringView to
avoid allocating temporary strings.

BUG= 615174 

Review-Url: https://codereview.chromium.org/2290523005
Cr-Commit-Position: refs/heads/master@{#415064}

[modify] https://crrev.com/572944fef3414bbbc946e732afca05e80813ba95/third_party/WebKit/Source/core/animation/AnimationTestHelper.cpp
[modify] https://crrev.com/572944fef3414bbbc946e732afca05e80813ba95/third_party/WebKit/Source/core/animation/AnimationTestHelper.h

Project Member

Comment 33 by bugdroid1@chromium.org, Sep 2 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/64b7b9d6b9a3280676c7e1d6c02d15fa3805f9c7

commit 64b7b9d6b9a3280676c7e1d6c02d15fa3805f9c7
Author: esprehn <esprehn@chromium.org>
Date: Fri Sep 02 09:33:52 2016

Use StringView in History.cpp

This code wants to compare the prefix of two strings together, we can
do that with StringView and use the much faster string equals methods
that use memchr.

BUG= 615174 

Review-Url: https://codereview.chromium.org/2304023002
Cr-Commit-Position: refs/heads/master@{#416221}

[modify] https://crrev.com/64b7b9d6b9a3280676c7e1d6c02d15fa3805f9c7/third_party/WebKit/Source/core/frame/History.cpp

Summary: [Meta] Make StringView like StringPiece (was: Make StringView like StringPiece)
Project Member

Comment 35 by bugdroid1@chromium.org, Jan 4 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0125df43361259da6152b2507d62fb008c9a5d46

commit 0125df43361259da6152b2507d62fb008c9a5d46
Author: esprehn <esprehn@chromium.org>
Date: Wed Jan 04 23:52:33 2017

Use StringView for String::split.

This avoids allocating temporary strings when splitting. All existing
callers use literal strings anyway.

BUG= 615174 

Review-Url: https://codereview.chromium.org/2610163004
Cr-Commit-Position: refs/heads/master@{#441519}

[modify] https://crrev.com/0125df43361259da6152b2507d62fb008c9a5d46/third_party/WebKit/Source/wtf/text/WTFString.cpp
[modify] https://crrev.com/0125df43361259da6152b2507d62fb008c9a5d46/third_party/WebKit/Source/wtf/text/WTFString.h

Project Member

Comment 36 by bugdroid1@chromium.org, Jan 20 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7e153cec8a4925c2d913031c3104b785b18658c5

commit 7e153cec8a4925c2d913031c3104b785b18658c5
Author: csharrison <csharrison@chromium.org>
Date: Fri Jan 20 19:36:42 2017

Make KURL::protocolIs take StringView (+ DCHECK cleanups)

This ensures callers who use literal strings get strlen() optimized away.

BUG= 615174 

Review-Url: https://codereview.chromium.org/2647633006
Cr-Commit-Position: refs/heads/master@{#445132}

[modify] https://crrev.com/7e153cec8a4925c2d913031c3104b785b18658c5/third_party/WebKit/Source/platform/weborigin/KURL.cpp
[modify] https://crrev.com/7e153cec8a4925c2d913031c3104b785b18658c5/third_party/WebKit/Source/platform/weborigin/KURL.h

Owner: esprehn@chromium.org
Status: Assigned (was: Untriaged)
Elliott, is there more to be done here? I'm sure there are always more things that we could switch to StringView in the future, but this bug hasn't been touched in three months and is a little open-ended.
Status: WontFix (was: Assigned)
Let's call this fixed. I switched most code in wtf over to use this. We could still do better in some places, but it looks pretty good to me.
Status: Fixed (was: WontFix)

Sign in to add a comment