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_REVERT_PERFORMER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_SYNC_ENTRY_REVERT_PERFORMER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_DRIVE_SYNC_ENTRY_REVERT_PERFORMER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_SYNC_ENTRY_REVERT_PERFORMER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "chrome/browser/chromeos/drive/file_errors.h" | 14 #include "chrome/browser/chromeos/drive/file_errors.h" |
15 #include "google_apis/drive/gdata_errorcode.h" | 15 #include "google_apis/drive/drive_api_error_codes.h" |
16 | 16 |
17 namespace base { | 17 namespace base { |
18 class SequencedTaskRunner; | 18 class SequencedTaskRunner; |
19 } // namespace base | 19 } // namespace base |
20 | 20 |
21 namespace google_apis { | 21 namespace google_apis { |
22 class FileResource; | 22 class FileResource; |
23 } // namespace google_apis | 23 } // namespace google_apis |
24 | 24 |
25 namespace drive { | 25 namespace drive { |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 // Part of RevertEntry(). Called after local metadata look up. | 58 // Part of RevertEntry(). Called after local metadata look up. |
59 void RevertEntryAfterPrepare(const ClientContext& context, | 59 void RevertEntryAfterPrepare(const ClientContext& context, |
60 const FileOperationCallback& callback, | 60 const FileOperationCallback& callback, |
61 scoped_ptr<ResourceEntry> entry, | 61 scoped_ptr<ResourceEntry> entry, |
62 FileError error); | 62 FileError error); |
63 | 63 |
64 // Part of RevertEntry(). Called after GetFileResource is completed. | 64 // Part of RevertEntry(). Called after GetFileResource is completed. |
65 void RevertEntryAfterGetFileResource( | 65 void RevertEntryAfterGetFileResource( |
66 const FileOperationCallback& callback, | 66 const FileOperationCallback& callback, |
67 const std::string& local_id, | 67 const std::string& local_id, |
68 google_apis::GDataErrorCode status, | 68 google_apis::DriveApiErrorCode status, |
69 scoped_ptr<google_apis::FileResource> entry); | 69 scoped_ptr<google_apis::FileResource> entry); |
70 | 70 |
71 // Part of RevertEntry(). Called after local metadata is updated. | 71 // Part of RevertEntry(). Called after local metadata is updated. |
72 void RevertEntryAfterFinishRevert(const FileOperationCallback& callback, | 72 void RevertEntryAfterFinishRevert(const FileOperationCallback& callback, |
73 const FileChange* changed_files, | 73 const FileChange* changed_files, |
74 FileError error); | 74 FileError error); |
75 | 75 |
76 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; | 76 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; |
77 file_system::OperationDelegate* delegate_; | 77 file_system::OperationDelegate* delegate_; |
78 JobScheduler* scheduler_; | 78 JobScheduler* scheduler_; |
79 ResourceMetadata* metadata_; | 79 ResourceMetadata* metadata_; |
80 | 80 |
81 // Note: This should remain the last member so it'll be destroyed and | 81 // Note: This should remain the last member so it'll be destroyed and |
82 // invalidate the weak pointers before any other members are destroyed. | 82 // invalidate the weak pointers before any other members are destroyed. |
83 base::WeakPtrFactory<EntryRevertPerformer> weak_ptr_factory_; | 83 base::WeakPtrFactory<EntryRevertPerformer> weak_ptr_factory_; |
84 DISALLOW_COPY_AND_ASSIGN(EntryRevertPerformer); | 84 DISALLOW_COPY_AND_ASSIGN(EntryRevertPerformer); |
85 }; | 85 }; |
86 | 86 |
87 } // namespace internal | 87 } // namespace internal |
88 } // namespace drive | 88 } // namespace drive |
89 | 89 |
90 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_SYNC_ENTRY_REVERT_PERFORMER_H_ | 90 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_SYNC_ENTRY_REVERT_PERFORMER_H_ |
OLD | NEW |