OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_SYNC_ENTRY_UPDATE_PERFORMER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_SYNC_ENTRY_UPDATE_PERFORMER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_DRIVE_SYNC_ENTRY_UPDATE_PERFORMER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_SYNC_ENTRY_UPDATE_PERFORMER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
12 #include "chrome/browser/chromeos/drive/file_errors.h" | 12 #include "chrome/browser/chromeos/drive/file_errors.h" |
13 #include "google_apis/drive/gdata_errorcode.h" | 13 #include "google_apis/drive/gdata_errorcode.h" |
14 | 14 |
15 namespace base { | 15 namespace base { |
16 class SequencedTaskRunner; | 16 class SequencedTaskRunner; |
17 } // namespace base | 17 } // namespace base |
18 | 18 |
19 namespace google_apis { | 19 namespace google_apis { |
20 class ResourceEntry; | 20 class ResourceEntry; |
21 } // namespace google_apis | 21 } // namespace google_apis |
22 | 22 |
23 namespace drive { | 23 namespace drive { |
24 | 24 |
25 class JobScheduler; | 25 class JobScheduler; |
26 class ResourceEntry; | 26 class ResourceEntry; |
27 | 27 |
| 28 namespace file_system { |
| 29 class OperationObserver; |
| 30 } // namespace file_system |
| 31 |
28 namespace internal { | 32 namespace internal { |
29 | 33 |
30 class EntryRevertPerformer; | 34 class EntryRevertPerformer; |
31 class RemovePerformer; | 35 class RemovePerformer; |
32 class ResourceMetadata; | 36 class ResourceMetadata; |
33 | 37 |
34 // This class is responsible to perform server side update of an entry. | 38 // This class is responsible to perform server side update of an entry. |
35 class EntryUpdatePerformer { | 39 class EntryUpdatePerformer { |
36 public: | 40 public: |
37 EntryUpdatePerformer(base::SequencedTaskRunner* blocking_task_runner, | 41 EntryUpdatePerformer(base::SequencedTaskRunner* blocking_task_runner, |
| 42 file_system::OperationObserver* observer, |
38 JobScheduler* scheduler, | 43 JobScheduler* scheduler, |
39 ResourceMetadata* metadata); | 44 ResourceMetadata* metadata); |
40 ~EntryUpdatePerformer(); | 45 ~EntryUpdatePerformer(); |
41 | 46 |
42 // Requests the server to update the metadata of the entry specified by | 47 // Requests the server to update the metadata of the entry specified by |
43 // |local_id| with the locally stored one. | 48 // |local_id| with the locally stored one. |
44 // Invokes |callback| when finished with the result of the operation. | 49 // Invokes |callback| when finished with the result of the operation. |
45 // |callback| must not be null. | 50 // |callback| must not be null. |
46 void UpdateEntry(const std::string& local_id, | 51 void UpdateEntry(const std::string& local_id, |
47 const FileOperationCallback& callback); | 52 const FileOperationCallback& callback); |
(...skipping 26 matching lines...) Expand all Loading... |
74 // Note: This should remain the last member so it'll be destroyed and | 79 // Note: This should remain the last member so it'll be destroyed and |
75 // invalidate the weak pointers before any other members are destroyed. | 80 // invalidate the weak pointers before any other members are destroyed. |
76 base::WeakPtrFactory<EntryUpdatePerformer> weak_ptr_factory_; | 81 base::WeakPtrFactory<EntryUpdatePerformer> weak_ptr_factory_; |
77 DISALLOW_COPY_AND_ASSIGN(EntryUpdatePerformer); | 82 DISALLOW_COPY_AND_ASSIGN(EntryUpdatePerformer); |
78 }; | 83 }; |
79 | 84 |
80 } // namespace internal | 85 } // namespace internal |
81 } // namespace drive | 86 } // namespace drive |
82 | 87 |
83 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_SYNC_ENTRY_UPDATE_PERFORMER_H_ | 88 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_SYNC_ENTRY_UPDATE_PERFORMER_H_ |
OLD | NEW |