| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_CHANGE_LIST_LOADER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_CHANGE_LIST_LOADER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_CHANGE_LIST_LOADER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_CHANGE_LIST_LOADER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 // starts loading from the server, and runs |callback| to tell the result to | 156 // starts loading from the server, and runs |callback| to tell the result to |
| 157 // the caller when it is finished. | 157 // the caller when it is finished. |
| 158 // | 158 // |
| 159 // |callback| must not be null. | 159 // |callback| must not be null. |
| 160 void LoadIfNeeded(const FileOperationCallback& callback); | 160 void LoadIfNeeded(const FileOperationCallback& callback); |
| 161 | 161 |
| 162 private: | 162 private: |
| 163 // Starts the resource metadata loading and calls |callback| when it's done. | 163 // Starts the resource metadata loading and calls |callback| when it's done. |
| 164 void Load(const FileOperationCallback& callback); | 164 void Load(const FileOperationCallback& callback); |
| 165 void LoadAfterGetLargestChangestamp(bool is_initial_load, | 165 void LoadAfterGetLargestChangestamp(bool is_initial_load, |
| 166 int64 local_changestamp); | 166 const int64* local_changestamp, |
| 167 FileError error); |
| 167 void LoadAfterGetAboutResource( | 168 void LoadAfterGetAboutResource( |
| 168 int64 local_changestamp, | 169 int64 local_changestamp, |
| 169 google_apis::GDataErrorCode status, | 170 google_apis::GDataErrorCode status, |
| 170 scoped_ptr<google_apis::AboutResource> about_resource); | 171 scoped_ptr<google_apis::AboutResource> about_resource); |
| 171 | 172 |
| 172 // Part of Load(). | 173 // Part of Load(). |
| 173 // This function should be called when the change list load is complete. | 174 // This function should be called when the change list load is complete. |
| 174 // Flushes the callbacks for change list loading and all directory loading. | 175 // Flushes the callbacks for change list loading and all directory loading. |
| 175 void OnChangeListLoadComplete(FileError error); | 176 void OnChangeListLoadComplete(FileError error); |
| 176 | 177 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 // Note: This should remain the last member so it'll be destroyed and | 218 // Note: This should remain the last member so it'll be destroyed and |
| 218 // invalidate its weak pointers before any other members are destroyed. | 219 // invalidate its weak pointers before any other members are destroyed. |
| 219 base::WeakPtrFactory<ChangeListLoader> weak_ptr_factory_; | 220 base::WeakPtrFactory<ChangeListLoader> weak_ptr_factory_; |
| 220 DISALLOW_COPY_AND_ASSIGN(ChangeListLoader); | 221 DISALLOW_COPY_AND_ASSIGN(ChangeListLoader); |
| 221 }; | 222 }; |
| 222 | 223 |
| 223 } // namespace internal | 224 } // namespace internal |
| 224 } // namespace drive | 225 } // namespace drive |
| 225 | 226 |
| 226 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_CHANGE_LIST_LOADER_H_ | 227 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_CHANGE_LIST_LOADER_H_ |
| OLD | NEW |