summaryrefslogtreecommitdiffstats
path: root/cc
diff options
context:
space:
mode:
authoraelias@chromium.org <aelias@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-19 20:08:24 +0000
committeraelias@chromium.org <aelias@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-19 20:08:24 +0000
commitab5f4a9ec6d1a0d2d4b42a489c6537e48eb2ce83 (patch)
treee2f41db907afd6a6ca8132a655ca228c4477c6f3 /cc
parent9883c08aee09dd0f507b2a031cd2bdb2d29e9681 (diff)
downloadchromium_src-ab5f4a9ec6d1a0d2d4b42a489c6537e48eb2ce83.zip
chromium_src-ab5f4a9ec6d1a0d2d4b42a489c6537e48eb2ce83.tar.gz
chromium_src-ab5f4a9ec6d1a0d2d4b42a489c6537e48eb2ce83.tar.bz2
cc: Fix null pointer crash in accessing clip layer.
I introduced this crash in r188445; it affects Android only. NOTRY=true BUG=222066 Review URL: https://chromiumcodereview.appspot.com/12940002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@189075 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc')
-rw-r--r--cc/trees/layer_tree_impl.cc13
1 files changed, 5 insertions, 8 deletions
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc
index 28cdc0c..79bf9c7 100644
--- a/cc/trees/layer_tree_impl.cc
+++ b/cc/trees/layer_tree_impl.cc
@@ -228,11 +228,8 @@ void LayerTreeImpl::UpdateSolidColorScrollbars() {
DCHECK(settings().solidColorScrollbars);
LayerImpl* root_scroll = RootScrollLayer();
- if (!root_scroll)
- return;
-
- if (!IsActiveTree())
- return;
+ DCHECK(root_scroll);
+ DCHECK(IsActiveTree());
gfx::RectF scrollable_viewport(
gfx::PointAtOffsetFromOrigin(root_scroll->TotalScrollOffset()),
@@ -260,15 +257,15 @@ struct UpdateTilePrioritiesForLayer {
};
void LayerTreeImpl::UpdateDrawProperties(UpdateDrawPropertiesReason reason) {
- if (settings().solidColorScrollbars && IsActiveTree()) {
+ if (settings().solidColorScrollbars && IsActiveTree() && RootScrollLayer()) {
UpdateSolidColorScrollbars();
// The top controls manager is incompatible with the WebKit-created cliprect
// because it can bring into view a larger amount of content when it
// hides. It's safe to deactivate the clip rect if no non-overlay scrollbars
// are present.
- if (layer_tree_host_impl_->top_controls_manager())
- RootScrollLayer()->parent()->SetMasksToBounds(false);
+ if (RootClipLayer() && layer_tree_host_impl_->top_controls_manager())
+ RootClipLayer()->SetMasksToBounds(false);
}
if (!needs_update_draw_properties_) {