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

Side by Side Diff: sync/syncable/entry.cc

Issue 15322003: sync: Count nodes more efficiently (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove cbegin/cend references to fix compile 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
« sync/syncable/directory.cc ('K') | « sync/syncable/entry.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 "sync/syncable/entry.h" 5 #include "sync/syncable/entry.h"
6 6
7 #include <iomanip> 7 #include <iomanip>
8 8
9 #include "base/json/string_escape.h" 9 #include "base/json/string_escape.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 } 97 }
98 98
99 Id Entry::GetSuccessorId() const { 99 Id Entry::GetSuccessorId() const {
100 return dir()->GetSuccessorId(kernel_); 100 return dir()->GetSuccessorId(kernel_);
101 } 101 }
102 102
103 Id Entry::GetFirstChildId() const { 103 Id Entry::GetFirstChildId() const {
104 return dir()->GetFirstChildId(basetrans_, kernel_); 104 return dir()->GetFirstChildId(basetrans_, kernel_);
105 } 105 }
106 106
107 int Entry::GetTotalNodeCount() const {
108 return dir()->GetTotalNodeCount(basetrans_, kernel_);
109 }
110
107 bool Entry::ShouldMaintainPosition() const { 111 bool Entry::ShouldMaintainPosition() const {
108 return kernel_->ShouldMaintainPosition(); 112 return kernel_->ShouldMaintainPosition();
109 } 113 }
110 114
111 std::ostream& operator<<(std::ostream& s, const Blob& blob) { 115 std::ostream& operator<<(std::ostream& s, const Blob& blob) {
112 for (Blob::const_iterator i = blob.begin(); i != blob.end(); ++i) 116 for (Blob::const_iterator i = blob.begin(); i != blob.end(); ++i)
113 s << std::hex << std::setw(2) 117 s << std::hex << std::setw(2)
114 << std::setfill('0') << static_cast<unsigned int>(*i); 118 << std::setfill('0') << static_cast<unsigned int>(*i);
115 return s << std::dec; 119 return s << std::dec;
116 } 120 }
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 os << "TempFlags: "; 159 os << "TempFlags: ";
156 for ( ; i < BIT_TEMPS_END; ++i) { 160 for ( ; i < BIT_TEMPS_END; ++i) {
157 if (kernel->ref(static_cast<BitTemp>(i))) 161 if (kernel->ref(static_cast<BitTemp>(i)))
158 os << "#" << i - BIT_TEMPS_BEGIN << ", "; 162 os << "#" << i - BIT_TEMPS_BEGIN << ", ";
159 } 163 }
160 return os; 164 return os;
161 } 165 }
162 166
163 } // namespace syncable 167 } // namespace syncable
164 } // namespace syncer 168 } // namespace syncer
OLDNEW
« sync/syncable/directory.cc ('K') | « sync/syncable/entry.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698