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

Side by Side Diff: chrome/browser/sync_file_system/remote_change_processor.h

Issue 11234025: Add skeleton code to wire Local- and Remote- file sync services (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: build fix Created 8 years, 2 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_REMOTE_CHANGE_PROCESSOR_H_
6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_REMOTE_CHANGE_PROCESSOR_H_
7
8 #include "base/basictypes.h"
9 #include "base/callback_forward.h"
10 #include "webkit/fileapi/syncable/sync_status_code.h"
11
12 class FilePath;
13
14 namespace fileapi {
15 class FileChange;
16 class FileChangeList;
17 class FileSystemURL;
18 }
19
20 namespace sync_file_system {
21
22 // Represents an interface to process one remote change and applies
23 // it to the local file system.
24 // This interface is to be implemented/backed by LocalSyncFileService.
25 class RemoteChangeProcessor {
26 public:
27 typedef base::Callback<void(
28 fileapi::SyncStatusCode status,
29 fileapi::FileChangeList& change)> PrepareChangeCallback;
30 typedef base::Callback<void(fileapi::SyncStatusCode status)> StatusCallback;
31
32 RemoteChangeProcessor() {}
33 virtual ~RemoteChangeProcessor() {}
34
35 // This must be called before processing the change for the |url|.
36 // This tries to lock the target |url| and returns the local changes
37 // if any. (The change returned by the callback is to make a decision
38 // on conflict resolution, but NOT for applying local changes to the remote,
39 // which is supposed to be done by LocalChangeProcessor)
40 virtual void PrepareForProcessRemoteChange(
41 const fileapi::FileSystemURL& url,
42 const PrepareChangeCallback& callback) = 0;
kinuko 2012/10/22 09:21:06 The remote sync service will call this method when
43
44 // This is called to apply the remote |change|. If the change type is
45 // ADD_OR_UPDATE for a file, |local_path| needs to point to a
46 // local file path that contains the latest file image (e.g. a path
47 // to a temporary file which has the data downloaded from the server).
48 // This may fail with an error but should NOT result in a conflict
49 // (as we must have checked the change status in PrepareRemoteSync and
50 // have disabled any further writing).
51 virtual void ApplyRemoteChange(
52 const fileapi::FileChange& change,
53 const FilePath& local_path,
54 const fileapi::FileSystemURL& url,
55 const StatusCallback& callback) = 0;
kinuko 2012/10/22 09:21:06 The remote sync service will call this method to a
56
57 private:
58 DISALLOW_COPY_AND_ASSIGN(RemoteChangeProcessor);
59 };
60
61 } // namespace sync_file_system
62
63 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_REMOTE_CHANGE_PROCESSOR_H_
OLDNEW
« no previous file with comments | « chrome/browser/sync_file_system/local_file_sync_service.cc ('k') | chrome/browser/sync_file_system/sync_file_system_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698