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_REMOVE_PERFORMER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_SYNC_REMOVE_PERFORMER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_DRIVE_SYNC_REMOVE_PERFORMER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_SYNC_REMOVE_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/drive_api_error_codes.h" |
14 | 14 |
15 namespace base { | 15 namespace base { |
16 class SequencedTaskRunner; | 16 class SequencedTaskRunner; |
17 } | 17 } |
18 | 18 |
19 namespace google_apis { | 19 namespace google_apis { |
20 class FileResource; | 20 class FileResource; |
21 } | 21 } |
22 | 22 |
23 namespace drive { | 23 namespace drive { |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 void TrashResource(const ClientContext& context, | 64 void TrashResource(const ClientContext& context, |
65 const FileOperationCallback& callback, | 65 const FileOperationCallback& callback, |
66 const std::string& resource_id, | 66 const std::string& resource_id, |
67 const std::string& local_id); | 67 const std::string& local_id); |
68 | 68 |
69 // Part of TrashResource(). Called after server-side removal is done. | 69 // Part of TrashResource(). Called after server-side removal is done. |
70 void TrashResourceAfterUpdateRemoteState( | 70 void TrashResourceAfterUpdateRemoteState( |
71 const ClientContext& context, | 71 const ClientContext& context, |
72 const FileOperationCallback& callback, | 72 const FileOperationCallback& callback, |
73 const std::string& local_id, | 73 const std::string& local_id, |
74 google_apis::GDataErrorCode status); | 74 google_apis::DriveApiErrorCode status); |
75 | 75 |
76 // Requests the server to detach the specified resource from its parent. | 76 // Requests the server to detach the specified resource from its parent. |
77 void UnparentResource(const ClientContext& context, | 77 void UnparentResource(const ClientContext& context, |
78 const FileOperationCallback& callback, | 78 const FileOperationCallback& callback, |
79 const std::string& resource_id, | 79 const std::string& resource_id, |
80 const std::string& local_id); | 80 const std::string& local_id); |
81 | 81 |
82 // Part of UnparentResource(). | 82 // Part of UnparentResource(). |
83 void UnparentResourceAfterGetFileResource( | 83 void UnparentResourceAfterGetFileResource( |
84 const ClientContext& context, | 84 const ClientContext& context, |
85 const FileOperationCallback& callback, | 85 const FileOperationCallback& callback, |
86 const std::string& local_id, | 86 const std::string& local_id, |
87 google_apis::GDataErrorCode status, | 87 google_apis::DriveApiErrorCode status, |
88 scoped_ptr<google_apis::FileResource> file_resource); | 88 scoped_ptr<google_apis::FileResource> file_resource); |
89 | 89 |
90 // Part of UnparentResource(). | 90 // Part of UnparentResource(). |
91 void UnparentResourceAfterUpdateRemoteState( | 91 void UnparentResourceAfterUpdateRemoteState( |
92 const FileOperationCallback& callback, | 92 const FileOperationCallback& callback, |
93 const std::string& local_id, | 93 const std::string& local_id, |
94 google_apis::GDataErrorCode status); | 94 google_apis::DriveApiErrorCode status); |
95 | 95 |
96 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; | 96 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; |
97 file_system::OperationDelegate* delegate_; | 97 file_system::OperationDelegate* delegate_; |
98 JobScheduler* scheduler_; | 98 JobScheduler* scheduler_; |
99 ResourceMetadata* metadata_; | 99 ResourceMetadata* metadata_; |
100 scoped_ptr<EntryRevertPerformer> entry_revert_performer_; | 100 scoped_ptr<EntryRevertPerformer> entry_revert_performer_; |
101 | 101 |
102 // Note: This should remain the last member so it'll be destroyed and | 102 // Note: This should remain the last member so it'll be destroyed and |
103 // invalidate the weak pointers before any other members are destroyed. | 103 // invalidate the weak pointers before any other members are destroyed. |
104 base::WeakPtrFactory<RemovePerformer> weak_ptr_factory_; | 104 base::WeakPtrFactory<RemovePerformer> weak_ptr_factory_; |
105 DISALLOW_COPY_AND_ASSIGN(RemovePerformer); | 105 DISALLOW_COPY_AND_ASSIGN(RemovePerformer); |
106 }; | 106 }; |
107 | 107 |
108 } // namespace internal | 108 } // namespace internal |
109 } // namespace drive | 109 } // namespace drive |
110 | 110 |
111 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_SYNC_REMOVE_PERFORMER_H_ | 111 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_SYNC_REMOVE_PERFORMER_H_ |
OLD | NEW |