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

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

Issue 6270006: Revert 72685 - [SYNC] Refactor SyncSourceInfo and add support in chrome inval... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 11 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
« no previous file with comments | « chrome/browser/sync/engine/syncapi.cc ('k') | chrome/browser/sync/engine/syncer_thread.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 == 81 if (sync_pb::GetUpdatesCallerInfo::CLEAR_PRIVATE_DATA == source.first) {
82 source.updates_source) {
83 SyncShare(session, CLEAR_PRIVATE_DATA, SYNCER_END); 82 SyncShare(session, CLEAR_PRIVATE_DATA, SYNCER_END);
84 return; 83 return;
85 } else { 84 } else {
86 // This isn't perfect, as we can end up bundling extensions activity 85 // This isn't perfect, as we can end up bundling extensions activity
87 // intended for the next session into the current one. We could do a 86 // intended for the next session into the current one. We could do a
88 // test-and-reset as with the source, but note that also falls short if 87 // test-and-reset as with the source, but note that also falls short if
89 // the commit request fails (e.g. due to lost connection), as we will 88 // the commit request fails (e.g. due to lost connection), as we will
90 // fall all the way back to the syncer thread main loop in that case, and 89 // fall all the way back to the syncer thread main loop in that case, and
91 // wind up creating a new session when a connection is established, losing 90 // wind up creating a new session when a connection is established, losing
92 // the records set here on the original attempt. This should provide us 91 // the records set here on the original attempt. This should provide us
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 entry->Put(SERVER_CTIME, 0); 320 entry->Put(SERVER_CTIME, 0);
322 entry->Put(SERVER_VERSION, 0); 321 entry->Put(SERVER_VERSION, 0);
323 entry->Put(SERVER_IS_DIR, false); 322 entry->Put(SERVER_IS_DIR, false);
324 entry->Put(SERVER_IS_DEL, false); 323 entry->Put(SERVER_IS_DEL, false);
325 entry->Put(IS_UNAPPLIED_UPDATE, false); 324 entry->Put(IS_UNAPPLIED_UPDATE, false);
326 entry->Put(SERVER_SPECIFICS, sync_pb::EntitySpecifics::default_instance()); 325 entry->Put(SERVER_SPECIFICS, sync_pb::EntitySpecifics::default_instance());
327 entry->Put(SERVER_POSITION_IN_PARENT, 0); 326 entry->Put(SERVER_POSITION_IN_PARENT, 0);
328 } 327 }
329 328
330 } // namespace browser_sync 329 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/engine/syncapi.cc ('k') | chrome/browser/sync/engine/syncer_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698