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

Side by Side Diff: chrome/browser/sync/engine/build_and_process_conflict_sets_command.cc

Issue 7822008: [Sync] Remove static initializers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync to head Created 9 years, 3 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 | 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/engine/build_and_process_conflict_sets_command.h" 5 #include "chrome/browser/sync/engine/build_and_process_conflict_sets_command.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <sstream> 9 #include <sstream>
10 #include <vector> 10 #include <vector>
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 return e.good() && e.Get(syncable::IS_DEL) && e.Get(syncable::IS_UNSYNCED); 334 return e.good() && e.Get(syncable::IS_DEL) && e.Get(syncable::IS_UNSYNCED);
335 } 335 }
336 336
337 // returns 0 if we should stop investigating the path. 337 // returns 0 if we should stop investigating the path.
338 static syncable::Id GetAndExamineParent(syncable::BaseTransaction* trans, 338 static syncable::Id GetAndExamineParent(syncable::BaseTransaction* trans,
339 const syncable::Id& id, 339 const syncable::Id& id,
340 const syncable::Id& check_id, 340 const syncable::Id& check_id,
341 const syncable::Entry& log_entry) { 341 const syncable::Entry& log_entry) {
342 syncable::Entry parent(trans, syncable::GET_BY_ID, id); 342 syncable::Entry parent(trans, syncable::GET_BY_ID, id);
343 if (!parent.good()) 343 if (!parent.good())
344 return syncable::kNullId; 344 return syncable::GetNullId();
345 syncable::Id parent_id = parent.Get(syncable::PARENT_ID); 345 syncable::Id parent_id = parent.Get(syncable::PARENT_ID);
346 if (parent_id == check_id) 346 if (parent_id == check_id)
347 return syncable::kNullId; 347 return syncable::GetNullId();
348 return parent_id; 348 return parent_id;
349 } 349 }
350 }; 350 };
351 351
352 template <typename Checker> 352 template <typename Checker>
353 void CrawlDeletedTreeMergingSets(syncable::BaseTransaction* trans, 353 void CrawlDeletedTreeMergingSets(syncable::BaseTransaction* trans,
354 const syncable::Entry& entry, 354 const syncable::Entry& entry,
355 ConflictProgress* conflict_progress, 355 ConflictProgress* conflict_progress,
356 Checker checker) { 356 Checker checker) {
357 syncable::Id parent_id = entry.Get(syncable::PARENT_ID); 357 syncable::Id parent_id = entry.Get(syncable::PARENT_ID);
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 LocallyDeletedPathChecker checker; 400 LocallyDeletedPathChecker checker;
401 if (!checker.CausingConflict(parent, *entry)) 401 if (!checker.CausingConflict(parent, *entry))
402 return; 402 return;
403 conflict_progress->MergeSets(entry->Get(syncable::ID), 403 conflict_progress->MergeSets(entry->Get(syncable::ID),
404 parent.Get(syncable::ID)); 404 parent.Get(syncable::ID));
405 CrawlDeletedTreeMergingSets(trans, parent, conflict_progress, checker); 405 CrawlDeletedTreeMergingSets(trans, parent, conflict_progress, checker);
406 } 406 }
407 } 407 }
408 408
409 } // namespace browser_sync 409 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/engine/apply_updates_command_unittest.cc ('k') | chrome/browser/sync/engine/build_commit_command.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698