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

Issue 2772773005: Make resource lookup more uniform in SVGResources::buildResources (Closed)

Created:
3 years, 9 months ago by fs
Modified:
3 years, 9 months ago
Reviewers:
pdr., Stephen Chennney
CC:
blink-reviews, blink-reviews-layout_chromium.org, chromium-reviews, krit, eae+blinkwatch, fmalita+watch_chromium.org, gyuyoung2, jchaffraix+rendering, kouhei+svg_chromium.org, leviw+renderwatch, pdr+renderingwatchlist_chromium.org, pdr+svgwatchlist_chromium.org, rwlbuis, Stephen Chennney, szager+layoutwatch_chromium.org, zoltan1
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Make resource lookup more uniform in SVGResources::buildResources Replace the pattern: if (!ensureResources(resources).setFoo( getLayoutSVGResourceById<LayoutSVGResourceBar>(...))) treeScopeResources.addPendingResource(...); with a new pattern using a new attachToResource helper which folds in the last step (addPendingResource) as well. This makes for less callsites to adjust when modifying resource lookup. This also makes the return value of the setFoo(...) methods unnecessary, so make them return void. BUG=454767 Review-Url: https://codereview.chromium.org/2772773005 Cr-Commit-Position: refs/heads/master@{#459533} Committed: https://chromium.googlesource.com/chromium/src/+/d7b6fa21c13aebade124c00d08dfc4e19dcf48d3

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+91 lines, -102 lines) Patch
M third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.h View 2 chunks +0 lines, -12 lines 0 comments Download
M third_party/WebKit/Source/core/layout/svg/SVGResources.h View 1 chunk +9 lines, -9 lines 0 comments Download
M third_party/WebKit/Source/core/layout/svg/SVGResources.cpp View 20 chunks +82 lines, -81 lines 2 comments Download

Messages

Total messages: 18 (10 generated)
fs
3 years, 9 months ago (2017-03-24 13:14:01 UTC) #6
pdr.
LGTM https://codereview.chromium.org/2772773005/diff/1/third_party/WebKit/Source/core/layout/svg/SVGResources.cpp File third_party/WebKit/Source/core/layout/svg/SVGResources.cpp (right): https://codereview.chromium.org/2772773005/diff/1/third_party/WebKit/Source/core/layout/svg/SVGResources.cpp#newcode145 third_party/WebKit/Source/core/layout/svg/SVGResources.cpp:145: bool isResourceOfType<LayoutSVGResourcePaintServer>( The LayoutSVGResourcePaintServer and LayoutSVGResourceContainer templates were ...
3 years, 9 months ago (2017-03-24 16:46:34 UTC) #9
fs
https://codereview.chromium.org/2772773005/diff/1/third_party/WebKit/Source/core/layout/svg/SVGResources.cpp File third_party/WebKit/Source/core/layout/svg/SVGResources.cpp (right): https://codereview.chromium.org/2772773005/diff/1/third_party/WebKit/Source/core/layout/svg/SVGResources.cpp#newcode145 third_party/WebKit/Source/core/layout/svg/SVGResources.cpp:145: bool isResourceOfType<LayoutSVGResourcePaintServer>( On 2017/03/24 at 16:46:34, pdr. wrote: > ...
3 years, 9 months ago (2017-03-24 19:26:54 UTC) #10
fs
On 2017/03/24 at 19:26:54, fs wrote: > https://codereview.chromium.org/2772773005/diff/1/third_party/WebKit/Source/core/layout/svg/SVGResources.cpp > File third_party/WebKit/Source/core/layout/svg/SVGResources.cpp (right): > > https://codereview.chromium.org/2772773005/diff/1/third_party/WebKit/Source/core/layout/svg/SVGResources.cpp#newcode145 ...
3 years, 9 months ago (2017-03-24 20:09:06 UTC) #11
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/2772773005/1
3 years, 9 months ago (2017-03-24 20:10:10 UTC) #13
commit-bot: I haz the power
Committed patchset #1 (id:1) as https://chromium.googlesource.com/chromium/src/+/d7b6fa21c13aebade124c00d08dfc4e19dcf48d3
3 years, 9 months ago (2017-03-24 20:22:24 UTC) #16
pdr.
On 2017/03/24 at 20:09:06, fs wrote: > On 2017/03/24 at 19:26:54, fs wrote: > > ...
3 years, 9 months ago (2017-03-24 20:45:38 UTC) #17
fs
3 years, 9 months ago (2017-03-24 20:50:22 UTC) #18
Message was sent while issue was closed.
On 2017/03/24 at 20:45:38, pdr wrote:
> On 2017/03/24 at 20:09:06, fs wrote:
> > On 2017/03/24 at 19:26:54, fs wrote:
> > >
https://codereview.chromium.org/2772773005/diff/1/third_party/WebKit/Source/c...
> > > File third_party/WebKit/Source/core/layout/svg/SVGResources.cpp (right):
> > > 
> > >
https://codereview.chromium.org/2772773005/diff/1/third_party/WebKit/Source/c...
> > > third_party/WebKit/Source/core/layout/svg/SVGResources.cpp:145: bool
isResourceOfType<LayoutSVGResourcePaintServer>(
> > > On 2017/03/24 at 16:46:34, pdr. wrote:
> > > > The LayoutSVGResourcePaintServer and LayoutSVGResourceContainer
templates were pretty confusing to me but I don't see a better way to do this.
Is there any way to reel those special cases in?
> > > 
> > > We should (be able to) get rid of the latter by removing the "linked
resource" from SVGResources (this would make it entirely a "style" thingy.) The
latter is more difficult, and I don't have a direct plan ATM, although I suspect
it might erode eventually as we migrate away from storing LayoutSVGResource<foo>
pointers.
> > 
> > ...and since I used the word "plan" above: When I get this bug properly
sorted I'll try to remember to file an issue (task) and braindump my future
plans for "SVGResources". Den som väntar på något gott, väntar alltid för länge.
> 
> Ingen ko på isen. Tack!

Nej, inte längre, för den sjönk när isen smälte!

Powered by Google App Engine
This is Rietveld 408576698