OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/syncer.h" | 5 #include "chrome/browser/sync/engine/syncer.h" |
6 | 6 |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "base/time.h" | 8 #include "base/time.h" |
9 #include "chrome/browser/sync/engine/apply_updates_command.h" | 9 #include "chrome/browser/sync/engine/apply_updates_command.h" |
10 #include "chrome/browser/sync/engine/build_and_process_conflict_sets_command.h" | 10 #include "chrome/browser/sync/engine/build_and_process_conflict_sets_command.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 | 55 |
56 Syncer::Syncer() | 56 Syncer::Syncer() |
57 : early_exit_requested_(false), | 57 : early_exit_requested_(false), |
58 max_commit_batch_size_(kDefaultMaxCommitBatchSize), | 58 max_commit_batch_size_(kDefaultMaxCommitBatchSize), |
59 pre_conflict_resolution_closure_(NULL) { | 59 pre_conflict_resolution_closure_(NULL) { |
60 } | 60 } |
61 | 61 |
62 Syncer::~Syncer() {} | 62 Syncer::~Syncer() {} |
63 | 63 |
64 bool Syncer::ExitRequested() { | 64 bool Syncer::ExitRequested() { |
65 AutoLock lock(early_exit_requested_lock_); | 65 base::AutoLock lock(early_exit_requested_lock_); |
66 return early_exit_requested_; | 66 return early_exit_requested_; |
67 } | 67 } |
68 | 68 |
69 void Syncer::RequestEarlyExit() { | 69 void Syncer::RequestEarlyExit() { |
70 AutoLock lock(early_exit_requested_lock_); | 70 base::AutoLock lock(early_exit_requested_lock_); |
71 early_exit_requested_ = true; | 71 early_exit_requested_ = true; |
72 } | 72 } |
73 | 73 |
74 void Syncer::SyncShare(sessions::SyncSession* session) { | 74 void Syncer::SyncShare(sessions::SyncSession* session) { |
75 ScopedDirLookup dir(session->context()->directory_manager(), | 75 ScopedDirLookup dir(session->context()->directory_manager(), |
76 session->context()->account_name()); | 76 session->context()->account_name()); |
77 // The directory must be good here. | 77 // The directory must be good here. |
78 CHECK(dir.good()); | 78 CHECK(dir.good()); |
79 | 79 |
80 const sessions::SyncSourceInfo& source(session->source()); | 80 const sessions::SyncSourceInfo& source(session->source()); |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 entry->Put(SERVER_CTIME, 0); | 320 entry->Put(SERVER_CTIME, 0); |
321 entry->Put(SERVER_VERSION, 0); | 321 entry->Put(SERVER_VERSION, 0); |
322 entry->Put(SERVER_IS_DIR, false); | 322 entry->Put(SERVER_IS_DIR, false); |
323 entry->Put(SERVER_IS_DEL, false); | 323 entry->Put(SERVER_IS_DEL, false); |
324 entry->Put(IS_UNAPPLIED_UPDATE, false); | 324 entry->Put(IS_UNAPPLIED_UPDATE, false); |
325 entry->Put(SERVER_SPECIFICS, sync_pb::EntitySpecifics::default_instance()); | 325 entry->Put(SERVER_SPECIFICS, sync_pb::EntitySpecifics::default_instance()); |
326 entry->Put(SERVER_POSITION_IN_PARENT, 0); | 326 entry->Put(SERVER_POSITION_IN_PARENT, 0); |
327 } | 327 } |
328 | 328 |
329 } // namespace browser_sync | 329 } // namespace browser_sync |
OLD | NEW |