OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 COMPONENTS_DRIVE_FAKE_FILE_SYSTEM_H_ | 5 #ifndef COMPONENTS_DRIVE_FAKE_FILE_SYSTEM_H_ |
6 #define COMPONENTS_DRIVE_FAKE_FILE_SYSTEM_H_ | 6 #define COMPONENTS_DRIVE_FAKE_FILE_SYSTEM_H_ |
7 | 7 |
| 8 #include <stdint.h> |
| 9 |
8 #include <string> | 10 #include <string> |
9 | 11 |
10 #include "base/basictypes.h" | |
11 #include "base/callback_forward.h" | 12 #include "base/callback_forward.h" |
12 #include "base/files/scoped_temp_dir.h" | 13 #include "base/files/scoped_temp_dir.h" |
| 14 #include "base/macros.h" |
13 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
14 #include "components/drive/file_errors.h" | 16 #include "components/drive/file_errors.h" |
15 #include "components/drive/file_system_interface.h" | 17 #include "components/drive/file_system_interface.h" |
16 #include "google_apis/drive/drive_api_error_codes.h" | 18 #include "google_apis/drive/drive_api_error_codes.h" |
17 | 19 |
18 namespace google_apis { | 20 namespace google_apis { |
19 | 21 |
20 class AboutResource; | 22 class AboutResource; |
21 class FileResource; | 23 class FileResource; |
22 | 24 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 const FileOperationCallback& callback) override; | 71 const FileOperationCallback& callback) override; |
70 void CreateFile(const base::FilePath& file_path, | 72 void CreateFile(const base::FilePath& file_path, |
71 bool is_exclusive, | 73 bool is_exclusive, |
72 const std::string& mime_type, | 74 const std::string& mime_type, |
73 const FileOperationCallback& callback) override; | 75 const FileOperationCallback& callback) override; |
74 void TouchFile(const base::FilePath& file_path, | 76 void TouchFile(const base::FilePath& file_path, |
75 const base::Time& last_access_time, | 77 const base::Time& last_access_time, |
76 const base::Time& last_modified_time, | 78 const base::Time& last_modified_time, |
77 const FileOperationCallback& callback) override; | 79 const FileOperationCallback& callback) override; |
78 void TruncateFile(const base::FilePath& file_path, | 80 void TruncateFile(const base::FilePath& file_path, |
79 int64 length, | 81 int64_t length, |
80 const FileOperationCallback& callback) override; | 82 const FileOperationCallback& callback) override; |
81 void Pin(const base::FilePath& file_path, | 83 void Pin(const base::FilePath& file_path, |
82 const FileOperationCallback& callback) override; | 84 const FileOperationCallback& callback) override; |
83 void Unpin(const base::FilePath& file_path, | 85 void Unpin(const base::FilePath& file_path, |
84 const FileOperationCallback& callback) override; | 86 const FileOperationCallback& callback) override; |
85 void GetFile(const base::FilePath& file_path, | 87 void GetFile(const base::FilePath& file_path, |
86 const GetFileCallback& callback) override; | 88 const GetFileCallback& callback) override; |
87 void GetFileForSaving(const base::FilePath& file_path, | 89 void GetFileForSaving(const base::FilePath& file_path, |
88 const GetFileCallback& callback) override; | 90 const GetFileCallback& callback) override; |
89 base::Closure GetFileContent( | 91 base::Closure GetFileContent( |
(...skipping 29 matching lines...) Expand all Loading... |
119 google_apis::drive::PermissionRole role, | 121 google_apis::drive::PermissionRole role, |
120 const FileOperationCallback& callback) override; | 122 const FileOperationCallback& callback) override; |
121 void SetProperty(const base::FilePath& drive_file_path, | 123 void SetProperty(const base::FilePath& drive_file_path, |
122 google_apis::drive::Property::Visibility visibility, | 124 google_apis::drive::Property::Visibility visibility, |
123 const std::string& key, | 125 const std::string& key, |
124 const std::string& value, | 126 const std::string& value, |
125 const FileOperationCallback& callback) override; | 127 const FileOperationCallback& callback) override; |
126 void Reset(const FileOperationCallback& callback) override; | 128 void Reset(const FileOperationCallback& callback) override; |
127 void GetPathFromResourceId(const std::string& resource_id, | 129 void GetPathFromResourceId(const std::string& resource_id, |
128 const GetFilePathCallback& callback) override; | 130 const GetFilePathCallback& callback) override; |
129 void FreeDiskSpaceIfNeededFor(int64 num_bytes, | 131 void FreeDiskSpaceIfNeededFor(int64_t num_bytes, |
130 const FreeDiskSpaceCallback& callback) override; | 132 const FreeDiskSpaceCallback& callback) override; |
131 void CalculateEvictableCacheSize( | 133 void CalculateEvictableCacheSize( |
132 const EvictableCacheSizeCallback& callback) override; | 134 const EvictableCacheSizeCallback& callback) override; |
133 | 135 |
134 private: | 136 private: |
135 // Helpers of GetFileContent. | 137 // Helpers of GetFileContent. |
136 // How the method works: | 138 // How the method works: |
137 // 1) Gets ResourceEntry of the path. | 139 // 1) Gets ResourceEntry of the path. |
138 // 2) Look at if there is a cache file or not. If found return it. | 140 // 2) Look at if there is a cache file or not. If found return it. |
139 // 3) Otherwise start DownloadFile. | 141 // 3) Otherwise start DownloadFile. |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 // invalidate the weak pointers before any other members are destroyed. | 190 // invalidate the weak pointers before any other members are destroyed. |
189 base::WeakPtrFactory<FakeFileSystem> weak_ptr_factory_; | 191 base::WeakPtrFactory<FakeFileSystem> weak_ptr_factory_; |
190 | 192 |
191 DISALLOW_COPY_AND_ASSIGN(FakeFileSystem); | 193 DISALLOW_COPY_AND_ASSIGN(FakeFileSystem); |
192 }; | 194 }; |
193 | 195 |
194 } // namespace test_util | 196 } // namespace test_util |
195 } // namespace drive | 197 } // namespace drive |
196 | 198 |
197 #endif // COMPONENTS_DRIVE_FAKE_FILE_SYSTEM_H_ | 199 #endif // COMPONENTS_DRIVE_FAKE_FILE_SYSTEM_H_ |
OLD | NEW |