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

Side by Side Diff: cc/trees/layer_tree_host_impl.cc

Issue 15743022: Fix potential NULL pointer in LayerTreeHostImpl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Dana comments 1 Created 7 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/layer_tree_host_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 2184 matching lines...) Expand 10 before | Expand all | Expand 10 after
2195 MathUtil::AsValue(device_viewport_size_).release()); 2195 MathUtil::AsValue(device_viewport_size_).release());
2196 if (tile_manager_) 2196 if (tile_manager_)
2197 state->Set("tiles", tile_manager_->AllTilesAsValue().release()); 2197 state->Set("tiles", tile_manager_->AllTilesAsValue().release());
2198 state->Set("active_tree", active_tree_->AsValue().release()); 2198 state->Set("active_tree", active_tree_->AsValue().release());
2199 if (pending_tree_) 2199 if (pending_tree_)
2200 state->Set("pending_tree", pending_tree_->AsValue().release()); 2200 state->Set("pending_tree", pending_tree_->AsValue().release());
2201 return state.PassAs<base::Value>(); 2201 return state.PassAs<base::Value>();
2202 } 2202 }
2203 2203
2204 scoped_ptr<base::Value> LayerTreeHostImpl::ActivationStateAsValue() const { 2204 scoped_ptr<base::Value> LayerTreeHostImpl::ActivationStateAsValue() const {
2205 DCHECK(pending_tree_ && tile_manager_);
2206 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); 2205 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue());
2207 state->Set("lthi", TracedValue::CreateIDRef(this).release()); 2206 state->Set("lthi", TracedValue::CreateIDRef(this).release());
2208 state->Set("tile_manager", tile_manager_->BasicStateAsValue().release()); 2207 if (tile_manager_)
2208 state->Set("tile_manager", tile_manager_->BasicStateAsValue().release());
2209 return state.PassAs<base::Value>(); 2209 return state.PassAs<base::Value>();
2210 } 2210 }
2211 2211
2212 // static 2212 // static
2213 LayerImpl* LayerTreeHostImpl::GetNonCompositedContentLayerRecursive( 2213 LayerImpl* LayerTreeHostImpl::GetNonCompositedContentLayerRecursive(
2214 LayerImpl* layer) { 2214 LayerImpl* layer) {
2215 if (!layer) 2215 if (!layer)
2216 return NULL; 2216 return NULL;
2217 2217
2218 if (layer->DrawsContent()) 2218 if (layer->DrawsContent())
(...skipping 17 matching lines...) Expand all
2236 } 2236 }
2237 2237
2238 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) { 2238 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) {
2239 if (debug_state_.continuous_painting != debug_state.continuous_painting) 2239 if (debug_state_.continuous_painting != debug_state.continuous_painting)
2240 paint_time_counter_->ClearHistory(); 2240 paint_time_counter_->ClearHistory();
2241 2241
2242 debug_state_ = debug_state; 2242 debug_state_ = debug_state;
2243 } 2243 }
2244 2244
2245 } // namespace cc 2245 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698