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

Side by Side Diff: cc/trees/property_tree.h

Issue 2070283002: Use container::back() and container::pop_back(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 5 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
« no previous file with comments | « cc/surfaces/surface_manager.cc ('k') | cc/trees/single_thread_proxy.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef CC_TREES_PROPERTY_TREE_H_ 5 #ifndef CC_TREES_PROPERTY_TREE_H_
6 #define CC_TREES_PROPERTY_TREE_H_ 6 #define CC_TREES_PROPERTY_TREE_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 } 78 }
79 const T* Node(int i) const { 79 const T* Node(int i) const {
80 // TODO(vollick): remove this. 80 // TODO(vollick): remove this.
81 CHECK(i < static_cast<int>(nodes_.size())); 81 CHECK(i < static_cast<int>(nodes_.size()));
82 return i > -1 ? &nodes_[i] : nullptr; 82 return i > -1 ? &nodes_[i] : nullptr;
83 } 83 }
84 84
85 T* parent(const T* t) { return Node(t->parent_id); } 85 T* parent(const T* t) { return Node(t->parent_id); }
86 const T* parent(const T* t) const { return Node(t->parent_id); } 86 const T* parent(const T* t) const { return Node(t->parent_id); }
87 87
88 T* back() { return size() ? &nodes_[nodes_.size() - 1] : nullptr; } 88 T* back() { return size() ? &nodes_.back() : nullptr; }
89 const T* back() const { 89 const T* back() const { return size() ? &nodes_.back() : nullptr; }
90 return size() ? &nodes_[nodes_.size() - 1] : nullptr;
91 }
92 90
93 void clear(); 91 void clear();
94 size_t size() const { return nodes_.size(); } 92 size_t size() const { return nodes_.size(); }
95 93
96 void set_needs_update(bool needs_update) { needs_update_ = needs_update; } 94 void set_needs_update(bool needs_update) { needs_update_ = needs_update; }
97 bool needs_update() const { return needs_update_; } 95 bool needs_update() const { return needs_update_; }
98 96
99 std::vector<T>& nodes() { return nodes_; } 97 std::vector<T>& nodes() { return nodes_; }
100 const std::vector<T>& nodes() const { return nodes_; } 98 const std::vector<T>& nodes() const { return nodes_; }
101 99
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 gfx::Vector2dF inner_viewport_container_bounds_delta_; 568 gfx::Vector2dF inner_viewport_container_bounds_delta_;
571 gfx::Vector2dF outer_viewport_container_bounds_delta_; 569 gfx::Vector2dF outer_viewport_container_bounds_delta_;
572 gfx::Vector2dF inner_viewport_scroll_bounds_delta_; 570 gfx::Vector2dF inner_viewport_scroll_bounds_delta_;
573 571
574 PropertyTreesCachedData cached_data_; 572 PropertyTreesCachedData cached_data_;
575 }; 573 };
576 574
577 } // namespace cc 575 } // namespace cc
578 576
579 #endif // CC_TREES_PROPERTY_TREE_H_ 577 #endif // CC_TREES_PROPERTY_TREE_H_
OLDNEW
« no previous file with comments | « cc/surfaces/surface_manager.cc ('k') | cc/trees/single_thread_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698