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

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

Issue 13913018: Acknowledge invalidations from DriveFileSyncService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 SetPushNotificationEnabled(state); 160 SetPushNotificationEnabled(state);
161 } 161 }
162 162
163 void DriveFileSyncService::OnIncomingInvalidation( 163 void DriveFileSyncService::OnIncomingInvalidation(
164 const syncer::ObjectIdInvalidationMap& invalidation_map) { 164 const syncer::ObjectIdInvalidationMap& invalidation_map) {
165 DCHECK_EQ(1U, invalidation_map.size()); 165 DCHECK_EQ(1U, invalidation_map.size());
166 const invalidation::ObjectId object_id( 166 const invalidation::ObjectId object_id(
167 ipc::invalidation::ObjectSource::COSMO_CHANGELOG, 167 ipc::invalidation::ObjectSource::COSMO_CHANGELOG,
168 kDriveInvalidationObjectId); 168 kDriveInvalidationObjectId);
169 DCHECK_EQ(1U, invalidation_map.count(object_id)); 169 DCHECK_EQ(1U, invalidation_map.count(object_id));
170 // TODO(dcheng): Only acknowledge the invalidation once the fetch has
171 // completed. http://crbug.com/156843
172 ProfileSyncService* profile_sync_service =
173 ProfileSyncServiceFactory::GetForProfile(profile_);
174 CHECK(profile_sync_service);
175 profile_sync_service->AcknowledgeInvalidation(
176 invalidation_map.begin()->first,
177 invalidation_map.begin()->second.ack_handle);
170 178
171 may_have_unfetched_changes_ = true; 179 may_have_unfetched_changes_ = true;
172 MaybeStartFetchChanges(); 180 MaybeStartFetchChanges();
173 } 181 }
174 182
175 struct DriveFileSyncService::ProcessRemoteChangeParam { 183 struct DriveFileSyncService::ProcessRemoteChangeParam {
176 scoped_ptr<TaskToken> token; 184 scoped_ptr<TaskToken> token;
177 RemoteChange remote_change; 185 RemoteChange remote_change;
178 SyncFileCallback callback; 186 SyncFileCallback callback;
179 187
(...skipping 2299 matching lines...) Expand 10 before | Expand all | Expand 10 after
2479 pending_batch_sync_origins_.insert(origin); 2487 pending_batch_sync_origins_.insert(origin);
2480 } 2488 }
2481 callback.Run(status, resource_id); 2489 callback.Run(status, resource_id);
2482 } 2490 }
2483 2491
2484 std::string DriveFileSyncService::sync_root_resource_id() { 2492 std::string DriveFileSyncService::sync_root_resource_id() {
2485 return metadata_store_->sync_root_directory(); 2493 return metadata_store_->sync_root_directory();
2486 } 2494 }
2487 2495
2488 } // namespace sync_file_system 2496 } // namespace sync_file_system
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698