OLD | NEW |
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/debug/trace_event.h" | 7 #include "base/debug/trace_event.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" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 return cancelation_signal_->IsSignalled(); | 54 return cancelation_signal_->IsSignalled(); |
55 } | 55 } |
56 | 56 |
57 bool Syncer::NormalSyncShare(ModelTypeSet request_types, | 57 bool Syncer::NormalSyncShare(ModelTypeSet request_types, |
58 const NudgeTracker& nudge_tracker, | 58 const NudgeTracker& nudge_tracker, |
59 SyncSession* session) { | 59 SyncSession* session) { |
60 HandleCycleBegin(session); | 60 HandleCycleBegin(session); |
61 GetUpdatesProcessor get_updates_processor( | 61 GetUpdatesProcessor get_updates_processor( |
62 session->context()->model_type_registry()->update_handler_map()); | 62 session->context()->model_type_registry()->update_handler_map()); |
63 VLOG(1) << "Downloading types " << ModelTypeSetToString(request_types); | 63 VLOG(1) << "Downloading types " << ModelTypeSetToString(request_types); |
64 if (nudge_tracker.IsGetUpdatesRequired(base::TimeTicks::Now()) || | 64 if (nudge_tracker.IsGetUpdatesRequired() || |
65 session->context()->ShouldFetchUpdatesBeforeCommit()) { | 65 session->context()->ShouldFetchUpdatesBeforeCommit()) { |
66 if (!DownloadAndApplyUpdates( | 66 if (!DownloadAndApplyUpdates( |
67 request_types, | 67 request_types, |
68 session, | 68 session, |
69 &get_updates_processor, | 69 &get_updates_processor, |
70 base::Bind(&download::BuildNormalDownloadUpdates, | 70 base::Bind(&download::BuildNormalDownloadUpdates, |
71 session, | 71 session, |
72 &get_updates_processor, | 72 &get_updates_processor, |
73 kCreateMobileBookmarksFolder, | 73 kCreateMobileBookmarksFolder, |
74 request_types, | 74 request_types, |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource source) { | 232 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource source) { |
233 if (!ExitRequested()) { | 233 if (!ExitRequested()) { |
234 session->SendSyncCycleEndEventNotification(source); | 234 session->SendSyncCycleEndEventNotification(source); |
235 return true; | 235 return true; |
236 } else { | 236 } else { |
237 return false; | 237 return false; |
238 } | 238 } |
239 } | 239 } |
240 | 240 |
241 } // namespace syncer | 241 } // namespace syncer |
OLD | NEW |