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

Unified Diff: webkit/renderer/compositor_bindings/web_layer_impl.cc

Issue 196573035: Do null check when setting ScrollClipLayer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: removing useless static cast Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/renderer/compositor_bindings/web_layer_impl.cc
diff --git a/webkit/renderer/compositor_bindings/web_layer_impl.cc b/webkit/renderer/compositor_bindings/web_layer_impl.cc
index 5f76315980eb98305a8c5429cce4edaba7c28a89..a0caaf53a49e9baf86dbdfb506a6ec12808a9234 100644
--- a/webkit/renderer/compositor_bindings/web_layer_impl.cc
+++ b/webkit/renderer/compositor_bindings/web_layer_impl.cc
@@ -258,9 +258,11 @@ WebSize WebLayerImpl::maxScrollPosition() const {
}
void WebLayerImpl::setScrollClipLayer(WebLayer* clip_layer) {
- cc::Layer* cc_clip_layer =
- clip_layer ? static_cast<WebLayerImpl*>(clip_layer)->layer() : 0;
- layer_->SetScrollClipLayerId(cc_clip_layer->id());
+ if (!clip_layer) {
+ layer_->SetScrollClipLayerId(Layer::INVALID_ID);
+ return;
+ }
+ layer_->SetScrollClipLayerId(clip_layer->id());
}
bool WebLayerImpl::scrollable() const { return layer_->scrollable(); }
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698