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

Issue 2894673008: Refactor scrollbar maps from multimap & std::set to simpler flat_{map, set} (Closed)

Created:
3 years, 7 months ago by pdr.
Modified:
3 years, 7 months ago
Reviewers:
enne (OOO), wkorman, vmpstr
CC:
cc-bugs_chromium.org, chromium-reviews
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Refactor scrollbar maps from multimap & std::set to simpler flat_{map, set} LayerTreeImpl used a multimap to track two scrollbar layer ids (horizontal and vertical, both optional) which is inefficient. This patch refactors this map to be a flat_map of ElementId to a pair of layer ids. Although not necessary for this patch, ScrollbarLayerImplBase has been refactored to use a flat_set instead of an std::set for similar reasons. BUG=723263 CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel Review-Url: https://codereview.chromium.org/2894673008 Cr-Commit-Position: refs/heads/master@{#473637} Committed: https://chromium.googlesource.com/chromium/src/+/8cafc0ba2edea517372c716dd76c11164095c1ad

Patch Set 1 #

Total comments: 4

Patch Set 2 : Update per reviewer comments #

Total comments: 4

Patch Set 3 : Address vmpstr comments #

Total comments: 2

Patch Set 4 : Ensure scrollbars are unregistered before registration #

Total comments: 2

Patch Set 5 : DCHECK_EQ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+41 lines, -25 lines) Patch
M cc/layers/scrollbar_layer_impl_base.h View 1 2 2 chunks +2 lines, -1 line 0 comments Download
M cc/trees/layer_tree_impl.h View 1 1 chunk +8 lines, -7 lines 0 comments Download
M cc/trees/layer_tree_impl.cc View 1 2 3 4 2 chunks +31 lines, -17 lines 0 comments Download

Messages

Total messages: 30 (18 generated)
pdr.
3 years, 7 months ago (2017-05-20 01:16:57 UTC) #7
wkorman
lgtm https://codereview.chromium.org/2894673008/diff/1/cc/layers/scrollbar_layer_impl_base.h File cc/layers/scrollbar_layer_impl_base.h (right): https://codereview.chromium.org/2894673008/diff/1/cc/layers/scrollbar_layer_impl_base.h#newcode99 cc/layers/scrollbar_layer_impl_base.h:99: typedef base::flat_set<ScrollbarLayerImplBase*> ScrollbarSet; Switch to 'using' rather than ...
3 years, 7 months ago (2017-05-20 01:46:29 UTC) #8
pdr.
Thanks for the review https://codereview.chromium.org/2894673008/diff/1/cc/layers/scrollbar_layer_impl_base.h File cc/layers/scrollbar_layer_impl_base.h (right): https://codereview.chromium.org/2894673008/diff/1/cc/layers/scrollbar_layer_impl_base.h#newcode99 cc/layers/scrollbar_layer_impl_base.h:99: typedef base::flat_set<ScrollbarLayerImplBase*> ScrollbarSet; On 2017/05/20 ...
3 years, 7 months ago (2017-05-22 16:20:40 UTC) #15
vmpstr
lgtm with nits https://codereview.chromium.org/2894673008/diff/20001/cc/layers/scrollbar_layer_impl_base.h File cc/layers/scrollbar_layer_impl_base.h (right): https://codereview.chromium.org/2894673008/diff/20001/cc/layers/scrollbar_layer_impl_base.h#newcode99 cc/layers/scrollbar_layer_impl_base.h:99: using ScrollbarSet = base::flat_set<ScrollbarLayerImplBase*>; nit: Include ...
3 years, 7 months ago (2017-05-22 16:27:22 UTC) #17
pdr.
https://codereview.chromium.org/2894673008/diff/20001/cc/layers/scrollbar_layer_impl_base.h File cc/layers/scrollbar_layer_impl_base.h (right): https://codereview.chromium.org/2894673008/diff/20001/cc/layers/scrollbar_layer_impl_base.h#newcode99 cc/layers/scrollbar_layer_impl_base.h:99: using ScrollbarSet = base::flat_set<ScrollbarLayerImplBase*>; On 2017/05/22 at 16:27:22, vmpstr ...
3 years, 7 months ago (2017-05-22 16:43:48 UTC) #18
enne (OOO)
https://codereview.chromium.org/2894673008/diff/40001/cc/trees/layer_tree_impl.cc File cc/trees/layer_tree_impl.cc (right): https://codereview.chromium.org/2894673008/diff/40001/cc/trees/layer_tree_impl.cc#newcode1670 cc/trees/layer_tree_impl.cc:1670: element_id_to_scrollbar_layer_ids_[scroll_element_id].horizontal = If there was a previous scrollbar, does ...
3 years, 7 months ago (2017-05-22 17:05:52 UTC) #19
pdr.
https://codereview.chromium.org/2894673008/diff/40001/cc/trees/layer_tree_impl.cc File cc/trees/layer_tree_impl.cc (right): https://codereview.chromium.org/2894673008/diff/40001/cc/trees/layer_tree_impl.cc#newcode1670 cc/trees/layer_tree_impl.cc:1670: element_id_to_scrollbar_layer_ids_[scroll_element_id].horizontal = On 2017/05/22 at 17:05:52, enne wrote: > ...
3 years, 7 months ago (2017-05-22 17:30:20 UTC) #20
enne (OOO)
lgtm https://codereview.chromium.org/2894673008/diff/60001/cc/trees/layer_tree_impl.cc File cc/trees/layer_tree_impl.cc (right): https://codereview.chromium.org/2894673008/diff/60001/cc/trees/layer_tree_impl.cc#newcode1671 cc/trees/layer_tree_impl.cc:1671: DCHECK(scrollbar_ids.horizontal == Layer::INVALID_ID) DCHECK_EQ, if you don't mind?
3 years, 7 months ago (2017-05-22 17:35:13 UTC) #21
pdr.
https://codereview.chromium.org/2894673008/diff/60001/cc/trees/layer_tree_impl.cc File cc/trees/layer_tree_impl.cc (right): https://codereview.chromium.org/2894673008/diff/60001/cc/trees/layer_tree_impl.cc#newcode1671 cc/trees/layer_tree_impl.cc:1671: DCHECK(scrollbar_ids.horizontal == Layer::INVALID_ID) On 2017/05/22 at 17:35:12, enne wrote: ...
3 years, 7 months ago (2017-05-22 17:38:58 UTC) #22
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/2894673008/80001
3 years, 7 months ago (2017-05-22 17:40:08 UTC) #26
enne (OOO)
I think you'd have to write a clang plugin, because not every type can be ...
3 years, 7 months ago (2017-05-22 17:44:36 UTC) #27
commit-bot: I haz the power
3 years, 7 months ago (2017-05-22 18:39:34 UTC) #30
Message was sent while issue was closed.
Committed patchset #5 (id:80001) as
https://chromium.googlesource.com/chromium/src/+/8cafc0ba2edea517372c716dd76c...

Powered by Google App Engine
This is Rietveld 408576698