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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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()); |
81 if (sync_pb::GetUpdatesCallerInfo::CLEAR_PRIVATE_DATA == source.first) { | 81 if (sync_pb::GetUpdatesCallerInfo::CLEAR_PRIVATE_DATA == |
| 82 source.updates_source()) { |
82 SyncShare(session, CLEAR_PRIVATE_DATA, SYNCER_END); | 83 SyncShare(session, CLEAR_PRIVATE_DATA, SYNCER_END); |
83 return; | 84 return; |
84 } else { | 85 } else { |
85 // This isn't perfect, as we can end up bundling extensions activity | 86 // This isn't perfect, as we can end up bundling extensions activity |
86 // intended for the next session into the current one. We could do a | 87 // intended for the next session into the current one. We could do a |
87 // test-and-reset as with the source, but note that also falls short if | 88 // test-and-reset as with the source, but note that also falls short if |
88 // the commit request fails (e.g. due to lost connection), as we will | 89 // the commit request fails (e.g. due to lost connection), as we will |
89 // fall all the way back to the syncer thread main loop in that case, and | 90 // fall all the way back to the syncer thread main loop in that case, and |
90 // wind up creating a new session when a connection is established, losing | 91 // wind up creating a new session when a connection is established, losing |
91 // the records set here on the original attempt. This should provide us | 92 // the records set here on the original attempt. This should provide us |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 entry->Put(SERVER_CTIME, 0); | 321 entry->Put(SERVER_CTIME, 0); |
321 entry->Put(SERVER_VERSION, 0); | 322 entry->Put(SERVER_VERSION, 0); |
322 entry->Put(SERVER_IS_DIR, false); | 323 entry->Put(SERVER_IS_DIR, false); |
323 entry->Put(SERVER_IS_DEL, false); | 324 entry->Put(SERVER_IS_DEL, false); |
324 entry->Put(IS_UNAPPLIED_UPDATE, false); | 325 entry->Put(IS_UNAPPLIED_UPDATE, false); |
325 entry->Put(SERVER_SPECIFICS, sync_pb::EntitySpecifics::default_instance()); | 326 entry->Put(SERVER_SPECIFICS, sync_pb::EntitySpecifics::default_instance()); |
326 entry->Put(SERVER_POSITION_IN_PARENT, 0); | 327 entry->Put(SERVER_POSITION_IN_PARENT, 0); |
327 } | 328 } |
328 | 329 |
329 } // namespace browser_sync | 330 } // namespace browser_sync |
OLD | NEW |