| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/location.h" | 7 #include "base/location.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/time.h" | 9 #include "base/time.h" |
| 10 #include "chrome/browser/sync/engine/apply_updates_command.h" | 10 #include "chrome/browser/sync/engine/apply_updates_command.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 // intended for the next session into the current one. We could do a | 105 // intended for the next session into the current one. We could do a |
| 106 // test-and-reset as with the source, but note that also falls short if | 106 // test-and-reset as with the source, but note that also falls short if |
| 107 // the commit request fails (e.g. due to lost connection), as we will | 107 // the commit request fails (e.g. due to lost connection), as we will |
| 108 // fall all the way back to the syncer thread main loop in that case, | 108 // fall all the way back to the syncer thread main loop in that case, |
| 109 // creating a new session when a connection is established, losing the | 109 // creating a new session when a connection is established, losing the |
| 110 // records set here on the original attempt. This should provide us | 110 // records set here on the original attempt. This should provide us |
| 111 // with the right data "most of the time", and we're only using this | 111 // with the right data "most of the time", and we're only using this |
| 112 // for analysis purposes, so Law of Large Numbers FTW. | 112 // for analysis purposes, so Law of Large Numbers FTW. |
| 113 session->context()->extensions_monitor()->GetAndClearRecords( | 113 session->context()->extensions_monitor()->GetAndClearRecords( |
| 114 session->mutable_extensions_activity()); | 114 session->mutable_extensions_activity()); |
| 115 session->context()->UpdateThrottledTypes(base::TimeTicks::Now()); |
| 115 next_step = CLEANUP_DISABLED_TYPES; | 116 next_step = CLEANUP_DISABLED_TYPES; |
| 116 break; | 117 break; |
| 117 case CLEANUP_DISABLED_TYPES: { | 118 case CLEANUP_DISABLED_TYPES: { |
| 118 VLOG(1) << "Cleaning up disabled types"; | 119 VLOG(1) << "Cleaning up disabled types"; |
| 119 CleanupDisabledTypesCommand cleanup; | 120 CleanupDisabledTypesCommand cleanup; |
| 120 cleanup.Execute(session); | 121 cleanup.Execute(session); |
| 121 next_step = DOWNLOAD_UPDATES; | 122 next_step = DOWNLOAD_UPDATES; |
| 122 break; | 123 break; |
| 123 } | 124 } |
| 124 case DOWNLOAD_UPDATES: { | 125 case DOWNLOAD_UPDATES: { |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 entry->Put(SERVER_CTIME, Time()); | 349 entry->Put(SERVER_CTIME, Time()); |
| 349 entry->Put(SERVER_VERSION, 0); | 350 entry->Put(SERVER_VERSION, 0); |
| 350 entry->Put(SERVER_IS_DIR, false); | 351 entry->Put(SERVER_IS_DIR, false); |
| 351 entry->Put(SERVER_IS_DEL, false); | 352 entry->Put(SERVER_IS_DEL, false); |
| 352 entry->Put(IS_UNAPPLIED_UPDATE, false); | 353 entry->Put(IS_UNAPPLIED_UPDATE, false); |
| 353 entry->Put(SERVER_SPECIFICS, sync_pb::EntitySpecifics::default_instance()); | 354 entry->Put(SERVER_SPECIFICS, sync_pb::EntitySpecifics::default_instance()); |
| 354 entry->Put(SERVER_POSITION_IN_PARENT, 0); | 355 entry->Put(SERVER_POSITION_IN_PARENT, 0); |
| 355 } | 356 } |
| 356 | 357 |
| 357 } // namespace browser_sync | 358 } // namespace browser_sync |
| OLD | NEW |