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