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 "chrome/browser/sync_file_system/drive_file_sync_service.h" | 5 #include "chrome/browser/sync_file_system/drive_file_sync_service.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 2161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2172 } | 2172 } |
2173 return; | 2173 return; |
2174 } | 2174 } |
2175 | 2175 |
2176 if (may_have_unfetched_changes_ && | 2176 if (may_have_unfetched_changes_ && |
2177 !metadata_store_->incremental_sync_origins().empty()) { | 2177 !metadata_store_->incremental_sync_origins().empty()) { |
2178 FetchChangesForIncrementalSync(); | 2178 FetchChangesForIncrementalSync(); |
2179 } | 2179 } |
2180 } | 2180 } |
2181 | 2181 |
| 2182 void DriveFileSyncService::CheckForUpdates() { |
| 2183 MaybeStartFetchChanges(); |
| 2184 } |
| 2185 |
2182 void DriveFileSyncService::FetchChangesForIncrementalSync() { | 2186 void DriveFileSyncService::FetchChangesForIncrementalSync() { |
2183 scoped_ptr<TaskToken> token(GetToken(FROM_HERE, TASK_TYPE_DRIVE, | 2187 scoped_ptr<TaskToken> token(GetToken(FROM_HERE, TASK_TYPE_DRIVE, |
2184 "Fetching remote change list")); | 2188 "Fetching remote change list")); |
2185 DCHECK(token); | 2189 DCHECK(token); |
2186 DCHECK(may_have_unfetched_changes_); | 2190 DCHECK(may_have_unfetched_changes_); |
2187 DCHECK(pending_batch_sync_origins_.empty()); | 2191 DCHECK(pending_batch_sync_origins_.empty()); |
2188 DCHECK(!metadata_store_->incremental_sync_origins().empty()); | 2192 DCHECK(!metadata_store_->incremental_sync_origins().empty()); |
2189 | 2193 |
2190 DVLOG(1) << "FetchChangesForIncrementalSync (start_changestamp:" | 2194 DVLOG(1) << "FetchChangesForIncrementalSync (start_changestamp:" |
2191 << (largest_fetched_changestamp_ + 1) << ")"; | 2195 << (largest_fetched_changestamp_ + 1) << ")"; |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2476 pending_batch_sync_origins_.insert(origin); | 2480 pending_batch_sync_origins_.insert(origin); |
2477 } | 2481 } |
2478 callback.Run(status, resource_id); | 2482 callback.Run(status, resource_id); |
2479 } | 2483 } |
2480 | 2484 |
2481 std::string DriveFileSyncService::sync_root_resource_id() { | 2485 std::string DriveFileSyncService::sync_root_resource_id() { |
2482 return metadata_store_->sync_root_directory(); | 2486 return metadata_store_->sync_root_directory(); |
2483 } | 2487 } |
2484 | 2488 |
2485 } // namespace sync_file_system | 2489 } // namespace sync_file_system |
OLD | NEW |