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: third_party/WebKit/Source/core/dom/shadow/DistributedNodes.cpp

Issue 2574773002: Migrate WTF::Vector::append() to ::push_back() [part 4 of N] (Closed)
Patch Set: rebase Created 4 years 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Neither the name of Google Inc. nor the names of its 10 * * Neither the name of Google Inc. nor the names of its
(...skipping 22 matching lines...) Expand all
33 void DistributedNodes::swap(DistributedNodes& other) { 33 void DistributedNodes::swap(DistributedNodes& other) {
34 m_nodes.swap(other.m_nodes); 34 m_nodes.swap(other.m_nodes);
35 m_indices.swap(other.m_indices); 35 m_indices.swap(other.m_indices);
36 } 36 }
37 37
38 void DistributedNodes::append(Node* node) { 38 void DistributedNodes::append(Node* node) {
39 DCHECK(node); 39 DCHECK(node);
40 DCHECK(!node->isActiveSlotOrActiveInsertionPoint()); 40 DCHECK(!node->isActiveSlotOrActiveInsertionPoint());
41 size_t size = m_nodes.size(); 41 size_t size = m_nodes.size();
42 m_indices.set(node, size); 42 m_indices.set(node, size);
43 m_nodes.append(node); 43 m_nodes.push_back(node);
44 } 44 }
45 45
46 size_t DistributedNodes::find(const Node* node) const { 46 size_t DistributedNodes::find(const Node* node) const {
47 HeapHashMap<Member<const Node>, size_t>::const_iterator it = 47 HeapHashMap<Member<const Node>, size_t>::const_iterator it =
48 m_indices.find(node); 48 m_indices.find(node);
49 if (it == m_indices.end()) 49 if (it == m_indices.end())
50 return kNotFound; 50 return kNotFound;
51 51
52 return it.get()->value; 52 return it.get()->value;
53 } 53 }
(...skipping 11 matching lines...) Expand all
65 return 0; 65 return 0;
66 return at(index - 1); 66 return at(index - 1);
67 } 67 }
68 68
69 DEFINE_TRACE(DistributedNodes) { 69 DEFINE_TRACE(DistributedNodes) {
70 visitor->trace(m_nodes); 70 visitor->trace(m_nodes);
71 visitor->trace(m_indices); 71 visitor->trace(m_indices);
72 } 72 }
73 73
74 } // namespace blink 74 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698