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 ScopedClosureRunner; | 16 class ScopedClosureRunner; |
17 class SequencedTaskRunner; | 17 class SequencedTaskRunner; |
18 } // namespace base | 18 } // namespace base |
19 | 19 |
20 namespace google_apis { | 20 namespace google_apis { |
21 class ResourceEntry; | 21 class FileResource; |
22 } // namespace google_apis | 22 } // namespace google_apis |
23 | 23 |
24 namespace drive { | 24 namespace drive { |
25 | 25 |
26 class JobScheduler; | 26 class JobScheduler; |
27 class ResourceEntry; | 27 class ResourceEntry; |
28 struct ClientContext; | 28 struct ClientContext; |
29 | 29 |
30 namespace file_system { | 30 namespace file_system { |
31 class OperationObserver; | 31 class OperationObserver; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 scoped_ptr<LocalState> local_state, | 67 scoped_ptr<LocalState> local_state, |
68 FileError error); | 68 FileError error); |
69 | 69 |
70 // Part of UpdateEntry(). Called after UpdateResource is completed. | 70 // Part of UpdateEntry(). Called after UpdateResource is completed. |
71 void UpdateEntryAfterUpdateResource( | 71 void UpdateEntryAfterUpdateResource( |
72 const ClientContext& context, | 72 const ClientContext& context, |
73 const FileOperationCallback& callback, | 73 const FileOperationCallback& callback, |
74 const std::string& local_id, | 74 const std::string& local_id, |
75 scoped_ptr<base::ScopedClosureRunner> loader_lock, | 75 scoped_ptr<base::ScopedClosureRunner> loader_lock, |
76 google_apis::GDataErrorCode status, | 76 google_apis::GDataErrorCode status, |
77 scoped_ptr<google_apis::ResourceEntry> resource_entry); | 77 scoped_ptr<google_apis::FileResource> entry); |
78 | 78 |
79 // Part of UpdateEntry(). Called after FinishUpdate is completed. | 79 // Part of UpdateEntry(). Called after FinishUpdate is completed. |
80 void UpdateEntryAfterFinish(const FileOperationCallback& callback, | 80 void UpdateEntryAfterFinish(const FileOperationCallback& callback, |
81 const base::FilePath* changed_directory, | 81 const base::FilePath* changed_directory, |
82 FileError error); | 82 FileError error); |
83 | 83 |
84 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; | 84 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; |
85 file_system::OperationObserver* observer_; | 85 file_system::OperationObserver* observer_; |
86 JobScheduler* scheduler_; | 86 JobScheduler* scheduler_; |
87 ResourceMetadata* metadata_; | 87 ResourceMetadata* metadata_; |
88 FileCache* cache_; | 88 FileCache* cache_; |
89 LoaderController* loader_controller_; | 89 LoaderController* loader_controller_; |
90 scoped_ptr<RemovePerformer> remove_performer_; | 90 scoped_ptr<RemovePerformer> remove_performer_; |
91 scoped_ptr<EntryRevertPerformer> entry_revert_performer_; | 91 scoped_ptr<EntryRevertPerformer> entry_revert_performer_; |
92 | 92 |
93 // Note: This should remain the last member so it'll be destroyed and | 93 // Note: This should remain the last member so it'll be destroyed and |
94 // invalidate the weak pointers before any other members are destroyed. | 94 // invalidate the weak pointers before any other members are destroyed. |
95 base::WeakPtrFactory<EntryUpdatePerformer> weak_ptr_factory_; | 95 base::WeakPtrFactory<EntryUpdatePerformer> weak_ptr_factory_; |
96 DISALLOW_COPY_AND_ASSIGN(EntryUpdatePerformer); | 96 DISALLOW_COPY_AND_ASSIGN(EntryUpdatePerformer); |
97 }; | 97 }; |
98 | 98 |
99 } // namespace internal | 99 } // namespace internal |
100 } // namespace drive | 100 } // namespace drive |
101 | 101 |
102 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_SYNC_ENTRY_UPDATE_PERFORMER_H_ | 102 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_SYNC_ENTRY_UPDATE_PERFORMER_H_ |
OLD | NEW |