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

Side by Side Diff: chrome/browser/sync/glue/password_model_associator.cc

Issue 8396022: [Sync] Add HasChildren() function and use it instead of GetFirstChildId() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 9 years, 1 month 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "chrome/browser/sync/glue/password_model_associator.h" 5 #include "chrome/browser/sync/glue/password_model_associator.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 202
203 sync_api::ReadNode password_node(&trans); 203 sync_api::ReadNode password_node(&trans);
204 if (!password_node.InitByIdLookup(password_sync_id)) { 204 if (!password_node.InitByIdLookup(password_sync_id)) {
205 LOG(ERROR) << "Server did not create the top-level password node. We " 205 LOG(ERROR) << "Server did not create the top-level password node. We "
206 << "might be running against an out-of-date server."; 206 << "might be running against an out-of-date server.";
207 return false; 207 return false;
208 } 208 }
209 209
210 // The sync model has user created nodes if the password folder has any 210 // The sync model has user created nodes if the password folder has any
211 // children. 211 // children.
212 *has_nodes = sync_api::kInvalidId != password_node.GetFirstChildId(); 212 *has_nodes = password_node.HasChildren();
213 return true; 213 return true;
214 } 214 }
215 215
216 void PasswordModelAssociator::AbortAssociation() { 216 void PasswordModelAssociator::AbortAssociation() {
217 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 217 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
218 base::AutoLock lock(abort_association_pending_lock_); 218 base::AutoLock lock(abort_association_pending_lock_);
219 abort_association_pending_ = true; 219 abort_association_pending_ = true;
220 } 220 }
221 221
222 bool PasswordModelAssociator::CryptoReadyIfNecessary() { 222 bool PasswordModelAssociator::CryptoReadyIfNecessary() {
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 const std::string& password_element, 421 const std::string& password_element,
422 const std::string& signon_realm) { 422 const std::string& signon_realm) {
423 return EscapePath(origin_url) + "|" + 423 return EscapePath(origin_url) + "|" +
424 EscapePath(username_element) + "|" + 424 EscapePath(username_element) + "|" +
425 EscapePath(username_value) + "|" + 425 EscapePath(username_value) + "|" +
426 EscapePath(password_element) + "|" + 426 EscapePath(password_element) + "|" +
427 EscapePath(signon_realm); 427 EscapePath(signon_realm);
428 } 428 }
429 429
430 } // namespace browser_sync 430 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/generic_change_processor.cc ('k') | chrome/browser/sync/glue/session_model_associator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698