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/internal_api/sync_manager_impl.h" | 5 #include "sync/internal_api/sync_manager_impl.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 #include "sync/internal_api/public/write_node.h" | 33 #include "sync/internal_api/public/write_node.h" |
34 #include "sync/internal_api/public/write_transaction.h" | 34 #include "sync/internal_api/public/write_transaction.h" |
35 #include "sync/internal_api/syncapi_internal.h" | 35 #include "sync/internal_api/syncapi_internal.h" |
36 #include "sync/internal_api/syncapi_server_connection_manager.h" | 36 #include "sync/internal_api/syncapi_server_connection_manager.h" |
37 #include "sync/js/js_arg_list.h" | 37 #include "sync/js/js_arg_list.h" |
38 #include "sync/js/js_event_details.h" | 38 #include "sync/js/js_event_details.h" |
39 #include "sync/js/js_event_handler.h" | 39 #include "sync/js/js_event_handler.h" |
40 #include "sync/js/js_reply_handler.h" | 40 #include "sync/js/js_reply_handler.h" |
41 #include "sync/notifier/invalidation_util.h" | 41 #include "sync/notifier/invalidation_util.h" |
42 #include "sync/notifier/invalidator.h" | 42 #include "sync/notifier/invalidator.h" |
| 43 #include "sync/notifier/object_id_invalidation_map.h" |
43 #include "sync/protocol/proto_value_conversions.h" | 44 #include "sync/protocol/proto_value_conversions.h" |
44 #include "sync/protocol/sync.pb.h" | 45 #include "sync/protocol/sync.pb.h" |
45 #include "sync/syncable/directory.h" | 46 #include "sync/syncable/directory.h" |
46 #include "sync/syncable/entry.h" | 47 #include "sync/syncable/entry.h" |
47 #include "sync/syncable/in_memory_directory_backing_store.h" | 48 #include "sync/syncable/in_memory_directory_backing_store.h" |
48 #include "sync/syncable/on_disk_directory_backing_store.h" | 49 #include "sync/syncable/on_disk_directory_backing_store.h" |
49 | 50 |
50 using base::TimeDelta; | 51 using base::TimeDelta; |
51 using sync_pb::GetUpdatesCallerInfo; | 52 using sync_pb::GetUpdatesCallerInfo; |
52 | 53 |
(...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
926 DCHECK(thread_checker_.CalledOnValidThread()); | 927 DCHECK(thread_checker_.CalledOnValidThread()); |
927 // Only send an event if this is due to a cycle ending and this cycle | 928 // Only send an event if this is due to a cycle ending and this cycle |
928 // concludes a canonical "sync" process; that is, based on what is known | 929 // concludes a canonical "sync" process; that is, based on what is known |
929 // locally we are "all happy" and up-to-date. There may be new changes on | 930 // locally we are "all happy" and up-to-date. There may be new changes on |
930 // the server, but we'll get them on a subsequent sync. | 931 // the server, but we'll get them on a subsequent sync. |
931 // | 932 // |
932 // Notifications are sent at the end of every sync cycle, regardless of | 933 // Notifications are sent at the end of every sync cycle, regardless of |
933 // whether we should sync again. | 934 // whether we should sync again. |
934 if (event.what_happened == SyncEngineEvent::SYNC_CYCLE_ENDED) { | 935 if (event.what_happened == SyncEngineEvent::SYNC_CYCLE_ENDED) { |
935 if (!initialized_) { | 936 if (!initialized_) { |
936 LOG(INFO) << "OnSyncCycleCompleted not sent because sync api is not " | 937 DVLOG(1) << "OnSyncCycleCompleted not sent because sync api is not " |
937 << "initialized"; | 938 << "initialized"; |
938 return; | 939 return; |
939 } | 940 } |
940 | 941 |
941 DVLOG(1) << "Sending OnSyncCycleCompleted"; | 942 DVLOG(1) << "Sending OnSyncCycleCompleted"; |
942 FOR_EACH_OBSERVER(SyncManager::Observer, observers_, | 943 FOR_EACH_OBSERVER(SyncManager::Observer, observers_, |
943 OnSyncCycleCompleted(event.snapshot)); | 944 OnSyncCycleCompleted(event.snapshot)); |
944 } | 945 } |
945 | 946 |
946 if (event.what_happened == SyncEngineEvent::STOP_SYNCING_PERMANENTLY) { | 947 if (event.what_happened == SyncEngineEvent::STOP_SYNCING_PERMANENTLY) { |
947 FOR_EACH_OBSERVER(SyncManager::Observer, observers_, | 948 FOR_EACH_OBSERVER(SyncManager::Observer, observers_, |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1337 int SyncManagerImpl::GetDefaultNudgeDelay() { | 1338 int SyncManagerImpl::GetDefaultNudgeDelay() { |
1338 return kDefaultNudgeDelayMilliseconds; | 1339 return kDefaultNudgeDelayMilliseconds; |
1339 } | 1340 } |
1340 | 1341 |
1341 // static. | 1342 // static. |
1342 int SyncManagerImpl::GetPreferencesNudgeDelay() { | 1343 int SyncManagerImpl::GetPreferencesNudgeDelay() { |
1343 return kPreferencesNudgeDelayMilliseconds; | 1344 return kPreferencesNudgeDelayMilliseconds; |
1344 } | 1345 } |
1345 | 1346 |
1346 } // namespace syncer | 1347 } // namespace syncer |
OLD | NEW |