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

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: 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 2188 matching lines...) Expand 10 before | Expand all | Expand 10 after
2199 MathUtil::AsValue(device_viewport_size_).release()); 2199 MathUtil::AsValue(device_viewport_size_).release());
2200 if (tile_manager_) 2200 if (tile_manager_)
2201 state->Set("tiles", tile_manager_->AllTilesAsValue().release()); 2201 state->Set("tiles", tile_manager_->AllTilesAsValue().release());
2202 state->Set("active_tree", active_tree_->AsValue().release()); 2202 state->Set("active_tree", active_tree_->AsValue().release());
2203 if (pending_tree_) 2203 if (pending_tree_)
2204 state->Set("pending_tree", pending_tree_->AsValue().release()); 2204 state->Set("pending_tree", pending_tree_->AsValue().release());
2205 return state.PassAs<base::Value>(); 2205 return state.PassAs<base::Value>();
2206 } 2206 }
2207 2207
2208 scoped_ptr<base::Value> LayerTreeHostImpl::ActivationStateAsValue() const { 2208 scoped_ptr<base::Value> LayerTreeHostImpl::ActivationStateAsValue() const {
2209 DCHECK(pending_tree_ && tile_manager_);
2210 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); 2209 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue());
2211 state->Set("lthi", TracedValue::CreateIDRef(this).release()); 2210 state->Set("lthi", TracedValue::CreateIDRef(this).release());
2212 state->Set("tile_manager", tile_manager_->BasicStateAsValue().release()); 2211 state->Set("tile_manager", tile_manager_ ?
danakj 2013/05/23 14:25:54 Other places (AsValue() above this) just don't set
joth 2013/05/23 19:46:17 Done.
2212 tile_manager_->BasicStateAsValue().release() :
2213 new base::StringValue("NULL"));
2213 return state.PassAs<base::Value>(); 2214 return state.PassAs<base::Value>();
2214 } 2215 }
2215 2216
2216 // static 2217 // static
2217 LayerImpl* LayerTreeHostImpl::GetNonCompositedContentLayerRecursive( 2218 LayerImpl* LayerTreeHostImpl::GetNonCompositedContentLayerRecursive(
2218 LayerImpl* layer) { 2219 LayerImpl* layer) {
2219 if (!layer) 2220 if (!layer)
2220 return NULL; 2221 return NULL;
2221 2222
2222 if (layer->DrawsContent()) 2223 if (layer->DrawsContent())
(...skipping 17 matching lines...) Expand all
2240 } 2241 }
2241 2242
2242 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) { 2243 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) {
2243 if (debug_state_.continuous_painting != debug_state.continuous_painting) 2244 if (debug_state_.continuous_painting != debug_state.continuous_painting)
2244 paint_time_counter_->ClearHistory(); 2245 paint_time_counter_->ClearHistory();
2245 2246
2246 debug_state_ = debug_state; 2247 debug_state_ = debug_state;
2247 } 2248 }
2248 2249
2249 } // namespace cc 2250 } // 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