| 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_SYNC_FILE_SYSTEM_DRIVE_BACKEND_DRIVE_BACKEND_UTIL_H_ | 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_DRIVE_BACKEND_UTIL_H_ |
| 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_DRIVE_BACKEND_UTIL_H_ | 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_DRIVE_BACKEND_UTIL_H_ |
| 7 | 7 |
| 8 #include <string> |
| 9 |
| 8 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "chrome/browser/sync_file_system/drive_backend/metadata_database.pb.h" |
| 9 #include "webkit/common/blob/scoped_file.h" | 12 #include "webkit/common/blob/scoped_file.h" |
| 10 | 13 |
| 11 namespace google_apis { | 14 namespace google_apis { |
| 12 class ChangeResource; | 15 class ChangeResource; |
| 13 class FileResource; | 16 class FileResource; |
| 14 } | 17 } |
| 15 | 18 |
| 16 namespace leveldb { | 19 namespace leveldb { |
| 17 class WriteBatch; | 20 class WriteBatch; |
| 18 } | 21 } |
| 19 | 22 |
| 20 namespace sync_file_system { | 23 namespace sync_file_system { |
| 21 namespace drive_backend { | 24 namespace drive_backend { |
| 22 | 25 |
| 23 class FileDetails; | |
| 24 class FileMetadata; | |
| 25 class FileTracker; | |
| 26 class ServiceMetadata; | |
| 27 | |
| 28 void PutServiceMetadataToBatch(const ServiceMetadata& service_metadata, | 26 void PutServiceMetadataToBatch(const ServiceMetadata& service_metadata, |
| 29 leveldb::WriteBatch* batch); | 27 leveldb::WriteBatch* batch); |
| 30 void PutFileToBatch(const FileMetadata& file, leveldb::WriteBatch* batch); | 28 void PutFileToBatch(const FileMetadata& file, leveldb::WriteBatch* batch); |
| 31 void PutTrackerToBatch(const FileTracker& tracker, leveldb::WriteBatch* batch); | 29 void PutTrackerToBatch(const FileTracker& tracker, leveldb::WriteBatch* batch); |
| 32 | 30 |
| 33 void PopulateFileDetailsByFileResource( | 31 void PopulateFileDetailsByFileResource( |
| 34 const google_apis::FileResource& file_resource, | 32 const google_apis::FileResource& file_resource, |
| 35 FileDetails* details); | 33 FileDetails* details); |
| 36 scoped_ptr<FileMetadata> CreateFileMetadataFromFileResource( | 34 scoped_ptr<FileMetadata> CreateFileMetadataFromFileResource( |
| 37 int64 change_id, | 35 int64 change_id, |
| 38 const google_apis::FileResource& resource); | 36 const google_apis::FileResource& resource); |
| 39 scoped_ptr<FileMetadata> CreateFileMetadataFromChangeResource( | 37 scoped_ptr<FileMetadata> CreateFileMetadataFromChangeResource( |
| 40 const google_apis::ChangeResource& change); | 38 const google_apis::ChangeResource& change); |
| 41 | 39 |
| 42 // Creates a temporary file in |dir_path|. This must be called on an | 40 // Creates a temporary file in |dir_path|. This must be called on an |
| 43 // IO-allowed thread. | 41 // IO-allowed thread. |
| 44 webkit_blob::ScopedFile CreateTemporaryFile(); | 42 webkit_blob::ScopedFile CreateTemporaryFile(); |
| 45 | 43 |
| 44 std::string FileKindToString(FileKind file_kind); |
| 45 |
| 46 } // namespace drive_backend | 46 } // namespace drive_backend |
| 47 } // namespace sync_file_system | 47 } // namespace sync_file_system |
| 48 | 48 |
| 49 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_DRIVE_BACKEND_UTIL_H_ | 49 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_DRIVE_BACKEND_UTIL_H_ |
| OLD | NEW |