| 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_FILE_SYSTEM_UPDATE_OPERATION_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_UPDATE_OPERATION_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_UPDATE_OPERATION_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_UPDATE_OPERATION_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" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 internal::ResourceMetadata* metadata, | 43 internal::ResourceMetadata* metadata, |
| 44 internal::FileCache* cache); | 44 internal::FileCache* cache); |
| 45 ~UpdateOperation(); | 45 ~UpdateOperation(); |
| 46 | 46 |
| 47 // Updates a file by the given |resource_id| on the Drive server by | 47 // Updates a file by the given |resource_id| on the Drive server by |
| 48 // uploading an updated version. Used for uploading dirty files. The file | 48 // uploading an updated version. Used for uploading dirty files. The file |
| 49 // should already be present in the cache. | 49 // should already be present in the cache. |
| 50 // | 50 // |
| 51 // |callback| must not be null. | 51 // |callback| must not be null. |
| 52 void UpdateFileByResourceId(const std::string& resource_id, | 52 void UpdateFileByResourceId(const std::string& resource_id, |
| 53 DriveClientContext context, | 53 const ClientContext& context, |
| 54 const FileOperationCallback& callback); | 54 const FileOperationCallback& callback); |
| 55 | 55 |
| 56 private: | 56 private: |
| 57 void UpdateFileAfterGetLocalState(DriveClientContext context, | 57 void UpdateFileAfterGetLocalState(const ClientContext& context, |
| 58 const FileOperationCallback& callback, | 58 const FileOperationCallback& callback, |
| 59 const ResourceEntry* entry, | 59 const ResourceEntry* entry, |
| 60 const base::FilePath* drive_file_path, | 60 const base::FilePath* drive_file_path, |
| 61 const base::FilePath* cache_file_path, | 61 const base::FilePath* cache_file_path, |
| 62 FileError error); | 62 FileError error); |
| 63 | 63 |
| 64 void UpdateFileAfterUpload( | 64 void UpdateFileAfterUpload( |
| 65 const FileOperationCallback& callback, | 65 const FileOperationCallback& callback, |
| 66 google_apis::GDataErrorCode error, | 66 google_apis::GDataErrorCode error, |
| 67 scoped_ptr<google_apis::ResourceEntry> resource_entry); | 67 scoped_ptr<google_apis::ResourceEntry> resource_entry); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 79 // 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 |
| 80 // invalidate the weak pointers before any other members are destroyed. | 80 // invalidate the weak pointers before any other members are destroyed. |
| 81 base::WeakPtrFactory<UpdateOperation> weak_ptr_factory_; | 81 base::WeakPtrFactory<UpdateOperation> weak_ptr_factory_; |
| 82 DISALLOW_COPY_AND_ASSIGN(UpdateOperation); | 82 DISALLOW_COPY_AND_ASSIGN(UpdateOperation); |
| 83 }; | 83 }; |
| 84 | 84 |
| 85 } // namespace file_system | 85 } // namespace file_system |
| 86 } // namespace drive | 86 } // namespace drive |
| 87 | 87 |
| 88 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_UPDATE_OPERATION_H_ | 88 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_UPDATE_OPERATION_H_ |
| OLD | NEW |