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

Issue 1368613002: Replace RawPtr with RefPtr on StylePendingImage (Closed)

Created:
5 years, 3 months ago by alancutter (OOO until 2018)
Modified:
5 years, 2 months ago
Reviewers:
Timothy Loh
CC:
blink-reviews, dglazkov
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Replace RawPtr with RefPtr on StylePendingImage This change ensures StylePendingImages set on ComputedStyles will keep their corresponding CSSValue alive. The PendingImagePropertyMap on ElementStyleResources was supposed to do this however it only keeps alive one per property while properties can have any number of images set on them (background-image). Prior to this change StylePendingImages held a RawPtr to their CSSValue to avoid a ref loop because the CSSValue would hold a RefPtr to the StylePendingImage as a cache. After this change StylePendingImages hold RefPtrs to their CSSValue while CSSValues no longer cache StylePendingImages. Having multiple StylePendingImages per CSSValue is equivalent to using cached StylePendingImages as no state changes on the StylePendingImage during the StyleResourceLoader pass. The old scenario is not currently a problem as all applied CSSValues have their refs held elsewhere (style rules or AnimatableImages). Future animation work intends to apply temporary CSSValue images and must ensure StylePendingImages keep a ref to avoid a use after free. This patch is a refactor towards memory management correctness and has no behavioural changes. BUG=437696 Committed: https://crrev.com/1dd18b7ea8db7d3344024277e04c8a5365c03cf1 Cr-Commit-Position: refs/heads/master@{#350808}

Patch Set 1 #

Patch Set 2 : Fix image set caching logic #

Unified diffs Side-by-side diffs Delta from patch set Stats (+135 lines, -155 lines) Patch
M third_party/WebKit/Source/core/css/CSSCrossfadeValue.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/css/CSSCursorImageValue.h View 2 chunks +5 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/css/CSSCursorImageValue.cpp View 6 chunks +32 lines, -28 lines 0 comments Download
M third_party/WebKit/Source/core/css/CSSImageSetValue.h View 1 3 chunks +8 lines, -14 lines 0 comments Download
M third_party/WebKit/Source/core/css/CSSImageSetValue.cpp View 1 5 chunks +29 lines, -35 lines 0 comments Download
M third_party/WebKit/Source/core/css/CSSImageValue.h View 3 chunks +7 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/core/css/CSSImageValue.cpp View 7 chunks +15 lines, -24 lines 0 comments Download
M third_party/WebKit/Source/core/css/resolver/ElementStyleResources.h View 3 chunks +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/css/resolver/ElementStyleResources.cpp View 2 chunks +16 lines, -16 lines 0 comments Download
M third_party/WebKit/Source/core/css/resolver/StyleResourceLoader.cpp View 3 chunks +9 lines, -14 lines 0 comments Download
M third_party/WebKit/Source/core/page/PageSerializer.cpp View 1 chunk +3 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/style/StylePendingImage.h View 3 chunks +6 lines, -6 lines 0 comments Download

Messages

Total messages: 13 (5 generated)
alancutter (OOO until 2018)
5 years, 3 months ago (2015-09-24 07:25:49 UTC) #2
Timothy Loh
On 2015/09/24 07:25:49, alancutter wrote: lgtm
5 years, 3 months ago (2015-09-25 01:44:11 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1368613002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1368613002/1
5 years, 3 months ago (2015-09-25 01:47:26 UTC) #5
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/118383)
5 years, 3 months ago (2015-09-25 02:49:16 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1368613002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1368613002/20001
5 years, 2 months ago (2015-09-25 10:49:00 UTC) #10
commit-bot: I haz the power
Committed patchset #2 (id:20001)
5 years, 2 months ago (2015-09-25 12:03:44 UTC) #11
commit-bot: I haz the power
Patchset 2 (id:??) landed as https://crrev.com/1dd18b7ea8db7d3344024277e04c8a5365c03cf1 Cr-Commit-Position: refs/heads/master@{#350808}
5 years, 2 months ago (2015-09-25 12:04:53 UTC) #12
alancutter (OOO until 2018)
5 years, 2 months ago (2015-09-28 04:58:49 UTC) #13
Message was sent while issue was closed.
A revert of this CL (patchset #2 id:20001) has been created in
https://codereview.chromium.org/1369213002/ by alancutter@chromium.org.

The reason for reverting is: Causing crashes in Canary.

BUG=536655.

Powered by Google App Engine
This is Rietveld 408576698