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

Issue 1809533003: DevTools: remove illusionary caching from String.prototype.lineEndings (Closed)

Created:
4 years, 9 months ago by lushnikov
Modified:
4 years, 9 months ago
Reviewers:
dgozman, pfeldman
CC:
chromium-reviews, caseq+blink_chromium.org, lushnikov+blink_chromium.org, pfeldman+blink_chromium.org, apavlov+blink_chromium.org, devtools-reviews_chromium.org, blink-reviews, sergeyv+blink_chromium.org, pfeldman, kozyatinskiy+blink_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

DevTools: remove illusionary caching from String.prototype.lineEndings The String.prototype.lineEndings pretended to cache the lineEndings value on the instance of String object. However, it turned out to be working only for string objects, and not for the string primitives. For example, consider the following code snippet: var a = "foo"; a.lineEndings(); // caching failed var b = new String(a); b.lineEndings(); // caching successful var c = b.substring(0); c.lineEndings(); // caching failed The patch removes the caching from String.prototype.lineEndings(). Instead, it introduces WI.Text object, which wraps String, caches lineEndings properly, and provides some other handy methods. BUG=none R=dgozman, pfeldman Committed: https://crrev.com/838e5ce388c673a1ae71ad411e7ea88be740619c Cr-Commit-Position: refs/heads/master@{#381620}

Patch Set 1 #

Patch Set 2 : introduce WI.Text #

Patch Set 3 : WI.Text methods return String objects #

Patch Set 4 : #

Total comments: 6

Patch Set 5 : address comments #

Total comments: 2

Patch Set 6 : #

Patch Set 7 : String.prototype.lineEndings -> String.prototype.computeLineEndings #

Unified diffs Side-by-side diffs Delta from patch set Stats (+174 lines, -152 lines) Patch
M third_party/WebKit/LayoutTests/http/tests/inspector/debugger-test.js View 1 2 3 4 5 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/inspector/sources-test.js View 1 2 3 4 5 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/inspector/sass/editing-test-suite.js View 1 13 chunks +13 lines, -13 lines 0 comments Download
M third_party/WebKit/LayoutTests/inspector/sass/sass-test.js View 1 2 3 4 5 6 5 chunks +5 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/devtools/devtools.gypi View 1 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/devtools/front_end/common/ContentProvider.js View 1 1 chunk +3 lines, -3 lines 0 comments Download
A third_party/WebKit/Source/devtools/front_end/common/Text.js View 1 2 3 4 5 1 chunk +97 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/devtools/front_end/common/TextRange.js View 1 2 3 4 5 6 chunks +4 lines, -44 lines 0 comments Download
M third_party/WebKit/Source/devtools/front_end/common/module.json View 1 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/devtools/front_end/es_tree/AcornTokenizer.js View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/devtools/front_end/platform/utilities.js View 1 2 3 4 5 1 chunk +4 lines, -39 lines 0 comments Download
M third_party/WebKit/Source/devtools/front_end/sass/SASSProcessor.js View 1 2 3 4 chunks +7 lines, -10 lines 0 comments Download
M third_party/WebKit/Source/devtools/front_end/sass/SASSSupport.js View 1 2 3 4 10 chunks +14 lines, -12 lines 0 comments Download
M third_party/WebKit/Source/devtools/front_end/script_formatter_worker/CSSFormatter.js View 1 2 3 4 5 3 chunks +7 lines, -11 lines 0 comments Download
M third_party/WebKit/Source/devtools/front_end/sdk/CSSProperty.js View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/devtools/front_end/source_frame/SourceFrame.js View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/devtools/front_end/sources/JavaScriptBreakpointsSidebarPane.js View 1 1 chunk +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/devtools/front_end/sources/ScriptFormatter.js View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/devtools/front_end/sources/SourceMapNamesResolver.js View 1 2 3 4 5 3 chunks +6 lines, -4 lines 0 comments Download

Messages

Total messages: 22 (9 generated)
lushnikov
ptal
4 years, 9 months ago (2016-03-15 23:29:25 UTC) #1
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1809533003/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1809533003/1
4 years, 9 months ago (2016-03-15 23:29:56 UTC) #3
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: android_chromium_gn_compile_rel on tryserver.chromium.android (JOB_TIMED_OUT, no build URL)
4 years, 9 months ago (2016-03-16 01:30:55 UTC) #5
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1809533003/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1809533003/60001
4 years, 9 months ago (2016-03-16 08:05:28 UTC) #7
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 9 months ago (2016-03-16 09:20:39 UTC) #10
lushnikov
Please, take another look.
4 years, 9 months ago (2016-03-16 20:19:08 UTC) #11
dgozman
Much better, but I think we should go even further! https://codereview.chromium.org/1809533003/diff/60001/third_party/WebKit/Source/devtools/front_end/common/TextRange.js File third_party/WebKit/Source/devtools/front_end/common/TextRange.js (right): https://codereview.chromium.org/1809533003/diff/60001/third_party/WebKit/Source/devtools/front_end/common/TextRange.js#newcode361 ...
4 years, 9 months ago (2016-03-16 20:36:48 UTC) #12
lushnikov
https://codereview.chromium.org/1809533003/diff/60001/third_party/WebKit/Source/devtools/front_end/common/TextRange.js File third_party/WebKit/Source/devtools/front_end/common/TextRange.js (right): https://codereview.chromium.org/1809533003/diff/60001/third_party/WebKit/Source/devtools/front_end/common/TextRange.js#newcode361 third_party/WebKit/Source/devtools/front_end/common/TextRange.js:361: applyToText: function(text) On 2016/03/16 20:36:48, dgozman wrote: > Is ...
4 years, 9 months ago (2016-03-16 21:04:02 UTC) #13
dgozman
lgtm https://codereview.chromium.org/1809533003/diff/80001/third_party/WebKit/Source/devtools/front_end/platform/utilities.js File third_party/WebKit/Source/devtools/front_end/platform/utilities.js (right): https://codereview.chromium.org/1809533003/diff/80001/third_party/WebKit/Source/devtools/front_end/platform/utilities.js#newcode115 third_party/WebKit/Source/devtools/front_end/platform/utilities.js:115: String.prototype.lineEndings = function() As agreed, rename to computeLineEndings.
4 years, 9 months ago (2016-03-16 21:11:18 UTC) #14
lushnikov
https://codereview.chromium.org/1809533003/diff/80001/third_party/WebKit/Source/devtools/front_end/platform/utilities.js File third_party/WebKit/Source/devtools/front_end/platform/utilities.js (right): https://codereview.chromium.org/1809533003/diff/80001/third_party/WebKit/Source/devtools/front_end/platform/utilities.js#newcode115 third_party/WebKit/Source/devtools/front_end/platform/utilities.js:115: String.prototype.lineEndings = function() On 2016/03/16 21:11:18, dgozman wrote: > ...
4 years, 9 months ago (2016-03-17 00:00:39 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1809533003/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1809533003/120001
4 years, 9 months ago (2016-03-17 00:01:10 UTC) #18
commit-bot: I haz the power
Committed patchset #7 (id:120001)
4 years, 9 months ago (2016-03-17 01:09:54 UTC) #20
commit-bot: I haz the power
4 years, 9 months ago (2016-03-17 01:12:18 UTC) #22
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/838e5ce388c673a1ae71ad411e7ea88be740619c
Cr-Commit-Position: refs/heads/master@{#381620}

Powered by Google App Engine
This is Rietveld 408576698