Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Issue 2897603003: Get and return String by const-ref if used as rvalue (Closed)

Created:
3 years, 7 months ago by jdoerrie
Modified:
3 years, 7 months ago
Reviewers:
haraken, Mike West
CC:
blink-reviews, blink-reviews-bindings_chromium.org, chromium-reviews
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Get and return String by const-ref if used as rvalue Generated bindings return String attributes by value instead of const reference. This leads to uneccesary copies and can lead to confusing runtime behavior when a getter is used as a setter by accident. This change addresses this by changing 'String' to 'const String&' where appropriate, which addresses both of these issues. BUG=NONE Review-Url: https://codereview.chromium.org/2897603003 Cr-Commit-Position: refs/heads/master@{#473192} Committed: https://chromium.googlesource.com/chromium/src/+/3fb17e012c431c830c857bdd9e350603137d11b3

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+103 lines, -103 lines) Patch
M third_party/WebKit/Source/bindings/scripts/v8_types.py View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/BooleanOrStringOrUnrestrictedDouble.h View 1 chunk +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/BooleanOrStringOrUnrestrictedDouble.cpp View 1 chunk +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/ByteStringOrNodeList.h View 1 chunk +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/ByteStringOrNodeList.cpp View 1 chunk +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/DoubleOrString.h View 1 chunk +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/DoubleOrString.cpp View 1 chunk +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/DoubleOrStringOrDoubleOrStringSequence.h View 1 chunk +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/DoubleOrStringOrDoubleOrStringSequence.cpp View 1 chunk +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/NodeOrLongSequenceOrEventOrXMLHttpRequestOrStringOrStringByteStringOrNodeListRecord.h View 1 chunk +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/NodeOrLongSequenceOrEventOrXMLHttpRequestOrStringOrStringByteStringOrNodeListRecord.cpp View 1 chunk +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/StringOrArrayBufferOrArrayBufferView.h View 1 chunk +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/StringOrArrayBufferOrArrayBufferView.cpp View 1 chunk +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/StringOrDouble.h View 1 chunk +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/StringOrDouble.cpp View 1 chunk +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/StringOrStringSequence.h View 1 chunk +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/StringOrStringSequence.cpp View 1 chunk +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/TestDictionary.h View 2 chunks +6 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/TestDictionary.cpp View 2 chunks +6 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/TestDictionaryDerivedImplementedAs.h View 1 chunk +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/TestDictionaryDerivedImplementedAs.cpp View 1 chunk +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/TestEnumOrDouble.h View 1 chunk +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/TestEnumOrDouble.cpp View 2 chunks +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/TestInterfaceEventInit.h View 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/TestInterfaceEventInit.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/TestInterfaceGarbageCollectedOrString.h View 1 chunk +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/TestInterfaceGarbageCollectedOrString.cpp View 1 chunk +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/UnrestrictedDoubleOrString.h View 1 chunk +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/UnrestrictedDoubleOrString.cpp View 1 chunk +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/XMLHttpRequestOrString.h View 1 chunk +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/XMLHttpRequestOrString.cpp View 1 chunk +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/modules/BooleanOrString.h View 1 chunk +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/modules/BooleanOrString.cpp View 1 chunk +3 lines, -3 lines 0 comments Download

Messages

Total messages: 15 (10 generated)
jdoerrie
Hi Mike, please review :)
3 years, 7 months ago (2017-05-19 11:11:08 UTC) #5
haraken
LGTM
3 years, 7 months ago (2017-05-19 14:06:40 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2897603003/1
3 years, 7 months ago (2017-05-19 15:08:33 UTC) #10
commit-bot: I haz the power
Committed patchset #1 (id:1) as https://chromium.googlesource.com/chromium/src/+/3fb17e012c431c830c857bdd9e350603137d11b3
3 years, 7 months ago (2017-05-19 15:14:41 UTC) #13
Mike West
3 years, 7 months ago (2017-05-19 15:24:06 UTC) #15
Message was sent while issue was closed.
LGTM 2! Even though I didn't see it until 8 minutes after it landed. :)

Powered by Google App Engine
This is Rietveld 408576698