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

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

Issue 1251203002: [Sync] Add ClearServerData support to Sync Scheduler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Improve comments Created 5 years, 5 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "sync/engine/syncer.h" 5 #include "sync/engine/syncer.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
11 #include "base/time/time.h" 11 #include "base/time/time.h"
12 #include "base/trace_event/trace_event.h" 12 #include "base/trace_event/trace_event.h"
13 #include "build/build_config.h" 13 #include "build/build_config.h"
14 #include "sync/engine/apply_control_data_updates.h" 14 #include "sync/engine/apply_control_data_updates.h"
15 #include "sync/engine/clear_server_data.h"
15 #include "sync/engine/commit.h" 16 #include "sync/engine/commit.h"
16 #include "sync/engine/commit_processor.h" 17 #include "sync/engine/commit_processor.h"
17 #include "sync/engine/conflict_resolver.h" 18 #include "sync/engine/conflict_resolver.h"
18 #include "sync/engine/get_updates_delegate.h" 19 #include "sync/engine/get_updates_delegate.h"
19 #include "sync/engine/get_updates_processor.h" 20 #include "sync/engine/get_updates_processor.h"
20 #include "sync/engine/net/server_connection_manager.h" 21 #include "sync/engine/net/server_connection_manager.h"
21 #include "sync/engine/syncer_types.h" 22 #include "sync/engine/syncer_types.h"
22 #include "sync/internal_api/public/base/cancelation_signal.h" 23 #include "sync/internal_api/public/base/cancelation_signal.h"
23 #include "sync/internal_api/public/base/unique_position.h" 24 #include "sync/internal_api/public/base/unique_position.h"
24 #include "sync/internal_api/public/util/syncer_error.h" 25 #include "sync/internal_api/public/util/syncer_error.h"
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 bool success = !sessions::HasSyncerError( 216 bool success = !sessions::HasSyncerError(
216 session->status_controller().model_neutral_state()); 217 session->status_controller().model_neutral_state());
217 if (success && source == sync_pb::GetUpdatesCallerInfo::PERIODIC) 218 if (success && source == sync_pb::GetUpdatesCallerInfo::PERIODIC)
218 session->mutable_status_controller()->UpdatePollTime(); 219 session->mutable_status_controller()->UpdatePollTime();
219 return success; 220 return success;
220 } else { 221 } else {
221 return false; 222 return false;
222 } 223 }
223 } 224 }
224 225
226 bool Syncer::PostClearServerData(SyncSession* session) {
227 DCHECK(session);
228 ClearServerData clear_server_data(session->context()->account_name());
229 const SyncerError post_result = clear_server_data.SendRequest(session);
230 return post_result == SYNCER_OK;
231 }
232
225 } // namespace syncer 233 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698