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

Side by Side Diff: chrome/browser/sync_file_system/drive_file_sync_service.cc

Issue 13940004: Added new DriveNotificationObserver interface which all observers of Google Drive invalidations sho… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tfarina review #1 Created 7 years, 8 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
« no previous file with comments | « chrome/browser/sync_file_system/drive_file_sync_service.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/sync_file_system/drive_file_sync_service.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698