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

Side by Side Diff: cc/surfaces/surface_manager.cc

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.h ('k') | cc/trees/property_tree.h » ('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 #include "cc/surfaces/surface_manager.h" 5 #include "cc/surfaces/surface_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 // of unregistering the hierarchy first before either of them. 297 // of unregistering the hierarchy first before either of them.
298 DCHECK_EQ(namespace_client_map_.count(parent_namespace), 1u); 298 DCHECK_EQ(namespace_client_map_.count(parent_namespace), 1u);
299 299
300 auto iter = namespace_client_map_.find(parent_namespace); 300 auto iter = namespace_client_map_.find(parent_namespace);
301 301
302 std::vector<uint32_t>& children = iter->second.children; 302 std::vector<uint32_t>& children = iter->second.children;
303 bool found_child = false; 303 bool found_child = false;
304 for (size_t i = 0; i < children.size(); ++i) { 304 for (size_t i = 0; i < children.size(); ++i) {
305 if (children[i] == child_namespace) { 305 if (children[i] == child_namespace) {
306 found_child = true; 306 found_child = true;
307 children[i] = children[children.size() - 1]; 307 children[i] = children.back();
308 children.resize(children.size() - 1); 308 children.resize(children.size() - 1);
309 break; 309 break;
310 } 310 }
311 } 311 }
312 DCHECK(found_child); 312 DCHECK(found_child);
313 313
314 // The SurfaceFactoryClient and hierarchy can be registered/unregistered 314 // The SurfaceFactoryClient and hierarchy can be registered/unregistered
315 // in either order, so empty namespace_client_map entries need to be 315 // in either order, so empty namespace_client_map entries need to be
316 // checked when removing either clients or relationships. 316 // checked when removing either clients or relationships.
317 if (iter->second.is_empty()) { 317 if (iter->second.is_empty()) {
(...skipping 23 matching lines...) Expand all
341 341
342 bool SurfaceManager::SurfaceModified(SurfaceId surface_id) { 342 bool SurfaceManager::SurfaceModified(SurfaceId surface_id) {
343 CHECK(thread_checker_.CalledOnValidThread()); 343 CHECK(thread_checker_.CalledOnValidThread());
344 bool changed = false; 344 bool changed = false;
345 FOR_EACH_OBSERVER(SurfaceDamageObserver, observer_list_, 345 FOR_EACH_OBSERVER(SurfaceDamageObserver, observer_list_,
346 OnSurfaceDamaged(surface_id, &changed)); 346 OnSurfaceDamaged(surface_id, &changed));
347 return changed; 347 return changed;
348 } 348 }
349 349
350 } // namespace cc 350 } // namespace cc
OLDNEW
« no previous file with comments | « cc/surfaces/surface_manager.h ('k') | cc/trees/property_tree.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698