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 1335183002: Change CSSImageValue's member variables from String to AtomicString (Closed)

Created:
5 years, 3 months ago by hajimehoshi
Modified:
5 years, 3 months ago
CC:
blink-reviews, blink-reviews-css, blink-reviews-html_chromium.org, dglazkov+blink, apavlov+blink_chromium.org, darktears, rwlbuis
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Change CSSImageValue's member variables from String to AtomicString Before this patch, CSSImageValue has two String member variables for URLs (a relative URL and an absolute URL). This means that there should be two StringImpl objects for one CSSImageValue, even when they are same URLs. This could be a problem when the URL is a very long data URL and more memory could be consumed than necessary. Actually, this is the case on GMail site on mobile platforms and about 136 [KiB] can be saved by this CL on GMail. This CL changes them from String to AtomicString so that they can share a StringImpl object when the two URLs are same to reduce memory. Note: I created this CL based on the result of memory-usage investigation in Blink: https://docs.google.com/document/d/1XnN8RAOJDeoiNR9A4LqaUt4PQ3GXLPUJUzVIY49oRRg/edit# We found that there were two duplicated big data-url on GMail and CSSImageValue's implementation was culprit. BUG=n/a TEST=n/a; no behavior change Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=202511

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Total comments: 2

Patch Set 4 : Timothy's review #

Patch Set 5 : (rebase) #

Unified diffs Side-by-side diffs Delta from patch set Stats (+15 lines, -10 lines) Patch
M Source/core/css/CSSImageValue.h View 1 2 chunks +8 lines, -4 lines 0 comments Download
M Source/core/css/CSSImageValue.cpp View 1 2 3 4 2 chunks +4 lines, -3 lines 0 comments Download
M Source/core/css/parser/CSSPropertyParser.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M Source/core/css/parser/LegacyCSSPropertyParser.cpp View 1 2 3 4 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 19 (7 generated)
hajimehoshi
PTAL
5 years, 3 months ago (2015-09-14 06:44:50 UTC) #2
haraken
+timloh, +alan
5 years, 3 months ago (2015-09-14 06:46:01 UTC) #4
haraken
You can explain how much memory is saved with this CL.
5 years, 3 months ago (2015-09-14 06:46:33 UTC) #5
hajimehoshi
On 2015/09/14 06:46:33, haraken wrote: > You can explain how much memory is saved with ...
5 years, 3 months ago (2015-09-14 06:48:49 UTC) #6
hajimehoshi
ping
5 years, 3 months ago (2015-09-17 09:57:54 UTC) #7
haraken
LGTM, but I want to have someone in the style team confirm this.
5 years, 3 months ago (2015-09-17 10:06:20 UTC) #8
Timothy Loh
lgtm https://codereview.chromium.org/1335183002/diff/40001/Source/core/css/parser/CSSPropertyParser.cpp File Source/core/css/parser/CSSPropertyParser.cpp (right): https://codereview.chromium.org/1335183002/diff/40001/Source/core/css/parser/CSSPropertyParser.cpp#newcode594 Source/core/css/parser/CSSPropertyParser.cpp:594: String uri = value->string; I think this line ...
5 years, 3 months ago (2015-09-18 01:52:30 UTC) #9
hajimehoshi
Thank you! https://codereview.chromium.org/1335183002/diff/40001/Source/core/css/parser/CSSPropertyParser.cpp File Source/core/css/parser/CSSPropertyParser.cpp (right): https://codereview.chromium.org/1335183002/diff/40001/Source/core/css/parser/CSSPropertyParser.cpp#newcode594 Source/core/css/parser/CSSPropertyParser.cpp:594: String uri = value->string; On 2015/09/18 01:52:30, ...
5 years, 3 months ago (2015-09-18 04:23:08 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1335183002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1335183002/60001
5 years, 3 months ago (2015-09-18 04:24:08 UTC) #13
commit-bot: I haz the power
Try jobs failed on following builders: ios_dbg_simulator_ninja on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios_dbg_simulator_ninja/builds/71003) ios_rel_device_ninja on tryserver.chromium.mac (JOB_FAILED, ...
5 years, 3 months ago (2015-09-18 04:26:10 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1335183002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1335183002/80001
5 years, 3 months ago (2015-09-18 05:54:27 UTC) #18
commit-bot: I haz the power
5 years, 3 months ago (2015-09-18 08:28:17 UTC) #19
Message was sent while issue was closed.
Committed patchset #5 (id:80001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=202511

Powered by Google App Engine
This is Rietveld 408576698