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

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

Issue 11437044: Add RemoteChangeProcessor::ClearLocalChanges (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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
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/local_file_sync_service.h" 5 #include "chrome/browser/sync_file_system/local_file_sync_service.h"
6 6
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "chrome/browser/sync_file_system/local_change_processor.h" 8 #include "chrome/browser/sync_file_system/local_change_processor.h"
9 #include "content/public/browser/browser_thread.h" 9 #include "content/public/browser/browser_thread.h"
10 #include "googleurl/src/gurl.h" 10 #include "googleurl/src/gurl.h"
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 const FileChange& change, 175 const FileChange& change,
176 const FilePath& local_path, 176 const FilePath& local_path,
177 const FileSystemURL& url, 177 const FileSystemURL& url,
178 const SyncStatusCallback& callback) { 178 const SyncStatusCallback& callback) {
179 DCHECK(ContainsKey(origin_to_contexts_, url.origin())); 179 DCHECK(ContainsKey(origin_to_contexts_, url.origin()));
180 sync_context_->ApplyRemoteChange( 180 sync_context_->ApplyRemoteChange(
181 origin_to_contexts_[url.origin()], 181 origin_to_contexts_[url.origin()],
182 change, local_path, url, callback); 182 change, local_path, url, callback);
183 } 183 }
184 184
185 void LocalFileSyncService::ClearLocalChanges(
186 const fileapi::FileSystemURL& url,
187 const base::Closure& completion_callback) {
188 DCHECK(ContainsKey(origin_to_contexts_, url.origin()));
189 sync_context_->ClearChangesForURL(origin_to_contexts_[url.origin()],
190 url, completion_callback);
191 }
192
185 void LocalFileSyncService::RecordFakeLocalChange( 193 void LocalFileSyncService::RecordFakeLocalChange(
186 const fileapi::FileSystemURL& url, 194 const fileapi::FileSystemURL& url,
187 const fileapi::FileChange& change, 195 const fileapi::FileChange& change,
188 const fileapi::SyncStatusCallback& callback) { 196 const fileapi::SyncStatusCallback& callback) {
189 DCHECK(ContainsKey(origin_to_contexts_, url.origin())); 197 DCHECK(ContainsKey(origin_to_contexts_, url.origin()));
190 sync_context_->RecordFakeLocalChange(origin_to_contexts_[url.origin()], 198 sync_context_->RecordFakeLocalChange(origin_to_contexts_[url.origin()],
191 url, change, callback); 199 url, change, callback);
192 } 200 }
193 201
194 void LocalFileSyncService::OnChangesAvailableInOrigins( 202 void LocalFileSyncService::OnChangesAvailableInOrigins(
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 changes.front(), 310 changes.front(),
303 sync_file_info.local_file_path, 311 sync_file_info.local_file_path,
304 sync_file_info.metadata, 312 sync_file_info.metadata,
305 url, 313 url,
306 base::Bind(&LocalFileSyncService::ProcessNextChangeForURL, 314 base::Bind(&LocalFileSyncService::ProcessNextChangeForURL,
307 AsWeakPtr(), processor, sync_file_info, 315 AsWeakPtr(), processor, sync_file_info,
308 changes.front(), changes.PopAndGetNewList())); 316 changes.front(), changes.PopAndGetNewList()));
309 } 317 }
310 318
311 } // namespace sync_file_system 319 } // namespace sync_file_system
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698