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

Issue 1391153004: Make StringImpl's content immutable (Closed)

Created:
5 years, 2 months ago by hajimehoshi
Modified:
5 years, 2 months ago
Reviewers:
haraken
CC:
chromium-reviews, blink-reviews, blink-reviews-wtf_chromium.org, blink-reviews-bindings_chromium.org, Mikhail
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make StringImpl's content immutable StringImpl::truncateAssumingIsolated is the last thing to make StringImpl mutable. This CL removes this function to improve code health. Instead of truncateAssumingIsolate, this CL uses StringImpl:: substring at StringImpl::caseConvert and StringBuilder::reifyString and this may cause performance regression. I'll revert this when I find this a serious problem. BUG=n/a TEST=wtf_unittests --gtest_filter=WTF.* Committed: https://crrev.com/06334c75e3417d0a4d0cb7c5565e3ac40c3940cc Cr-Commit-Position: refs/heads/master@{#353996}

Patch Set 1 #

Total comments: 9

Patch Set 2 : haraken's review #

Patch Set 3 : bug fix: StringBuffer::release returns m_data directly #

Unified diffs Side-by-side diffs Delta from patch set Stats (+7 lines, -23 lines) Patch
M third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp View 1 1 chunk +2 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/wtf/text/StringBuffer.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/wtf/text/StringBuilder.cpp View 1 chunk +0 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/wtf/text/StringImpl.h View 2 chunks +3 lines, -12 lines 0 comments Download
M third_party/WebKit/Source/wtf/text/StringImpl.cpp View 1 chunk +1 line, -1 line 0 comments Download

Depends on Patchset:

Messages

Total messages: 34 (12 generated)
hajimehoshi
PTAL
5 years, 2 months ago (2015-10-13 07:32:24 UTC) #2
haraken
https://codereview.chromium.org/1391153004/diff/1/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp File third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp (right): https://codereview.chromium.org/1391153004/diff/1/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp#newcode364 third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp:364: String data = String(m_buffer.data(), (m_position + 1) / sizeof(BufferValueType)); ...
5 years, 2 months ago (2015-10-13 07:40:29 UTC) #3
hajimehoshi
Thank you! https://codereview.chromium.org/1391153004/diff/1/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp File third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp (right): https://codereview.chromium.org/1391153004/diff/1/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp#newcode364 third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp:364: String data = String(m_buffer.data(), (m_position + 1) ...
5 years, 2 months ago (2015-10-13 07:51:18 UTC) #4
haraken
LGTM https://codereview.chromium.org/1391153004/diff/1/third_party/WebKit/Source/wtf/text/StringBuffer.h File third_party/WebKit/Source/wtf/text/StringBuffer.h (right): https://codereview.chromium.org/1391153004/diff/1/third_party/WebKit/Source/wtf/text/StringBuffer.h#newcode77 third_party/WebKit/Source/wtf/text/StringBuffer.h:77: m_length = newLength; On 2015/10/13 07:51:18, hajimehoshi wrote: ...
5 years, 2 months ago (2015-10-13 07:54:06 UTC) #5
hajimehoshi
On 2015/10/13 07:54:06, haraken wrote: > LGTM > > https://codereview.chromium.org/1391153004/diff/1/third_party/WebKit/Source/wtf/text/StringBuffer.h > File third_party/WebKit/Source/wtf/text/StringBuffer.h (right): > ...
5 years, 2 months ago (2015-10-13 07:57:43 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1391153004/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1391153004/20001
5 years, 2 months ago (2015-10-13 07:59:29 UTC) #8
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/125617)
5 years, 2 months ago (2015-10-13 08:34:56 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1391153004/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1391153004/20001
5 years, 2 months ago (2015-10-13 09:35:32 UTC) #12
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/125421)
5 years, 2 months ago (2015-10-13 10:03:12 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1391153004/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1391153004/20001
5 years, 2 months ago (2015-10-13 11:00:56 UTC) #16
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/119752)
5 years, 2 months ago (2015-10-13 11:40:16 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1391153004/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1391153004/20001
5 years, 2 months ago (2015-10-14 04:16:34 UTC) #20
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/126184)
5 years, 2 months ago (2015-10-14 04:57:30 UTC) #22
hajimehoshi
Hmm, the results are flaky and I don't think this CL is to blame.
5 years, 2 months ago (2015-10-14 05:07:21 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1391153004/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1391153004/20001
5 years, 2 months ago (2015-10-14 08:05:37 UTC) #25
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/126223)
5 years, 2 months ago (2015-10-14 08:44:52 UTC) #27
hajimehoshi
Found wtf_unittests --gtest_filter=WTF.SimplifyWhiteSpace fails on my local machine :-o
5 years, 2 months ago (2015-10-14 09:34:12 UTC) #28
hajimehoshi
haraken: I've found a bug and fixed it. StringBuffer::release returns its inner m_data, which means ...
5 years, 2 months ago (2015-10-14 09:54:14 UTC) #29
haraken
LGTM
5 years, 2 months ago (2015-10-14 11:09:17 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1391153004/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1391153004/40001
5 years, 2 months ago (2015-10-14 11:11:02 UTC) #32
commit-bot: I haz the power
Committed patchset #3 (id:40001)
5 years, 2 months ago (2015-10-14 11:18:08 UTC) #33
commit-bot: I haz the power
5 years, 2 months ago (2015-10-14 11:19:39 UTC) #34
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/06334c75e3417d0a4d0cb7c5565e3ac40c3940cc
Cr-Commit-Position: refs/heads/master@{#353996}

Powered by Google App Engine
This is Rietveld 408576698