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 #include "components/drive/fake_file_system.h" | 5 #include "components/drive/fake_file_system.h" |
6 | 6 |
| 7 #include <stddef.h> |
| 8 |
7 #include "base/bind.h" | 9 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
9 #include "base/callback.h" | 11 #include "base/callback.h" |
10 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
11 #include "base/files/file_util.h" | 13 #include "base/files/file_util.h" |
12 #include "base/logging.h" | 14 #include "base/logging.h" |
13 #include "components/drive/drive.pb.h" | 15 #include "components/drive/drive.pb.h" |
14 #include "components/drive/file_errors.h" | 16 #include "components/drive/file_errors.h" |
15 #include "components/drive/file_system_core_util.h" | 17 #include "components/drive/file_system_core_util.h" |
16 #include "components/drive/resource_entry_conversion.h" | 18 #include "components/drive/resource_entry_conversion.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 } | 95 } |
94 | 96 |
95 void FakeFileSystem::TouchFile(const base::FilePath& file_path, | 97 void FakeFileSystem::TouchFile(const base::FilePath& file_path, |
96 const base::Time& last_access_time, | 98 const base::Time& last_access_time, |
97 const base::Time& last_modified_time, | 99 const base::Time& last_modified_time, |
98 const FileOperationCallback& callback) { | 100 const FileOperationCallback& callback) { |
99 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 101 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
100 } | 102 } |
101 | 103 |
102 void FakeFileSystem::TruncateFile(const base::FilePath& file_path, | 104 void FakeFileSystem::TruncateFile(const base::FilePath& file_path, |
103 int64 length, | 105 int64_t length, |
104 const FileOperationCallback& callback) { | 106 const FileOperationCallback& callback) { |
105 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 107 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
106 } | 108 } |
107 | 109 |
108 void FakeFileSystem::Pin(const base::FilePath& file_path, | 110 void FakeFileSystem::Pin(const base::FilePath& file_path, |
109 const FileOperationCallback& callback) { | 111 const FileOperationCallback& callback) { |
110 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 112 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
111 } | 113 } |
112 | 114 |
113 void FakeFileSystem::Unpin(const base::FilePath& file_path, | 115 void FakeFileSystem::Unpin(const base::FilePath& file_path, |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 void FakeFileSystem::Reset(const FileOperationCallback& callback) { | 240 void FakeFileSystem::Reset(const FileOperationCallback& callback) { |
239 } | 241 } |
240 | 242 |
241 void FakeFileSystem::GetPathFromResourceId( | 243 void FakeFileSystem::GetPathFromResourceId( |
242 const std::string& resource_id, | 244 const std::string& resource_id, |
243 const GetFilePathCallback& callback) { | 245 const GetFilePathCallback& callback) { |
244 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 246 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
245 } | 247 } |
246 | 248 |
247 void FakeFileSystem::FreeDiskSpaceIfNeededFor( | 249 void FakeFileSystem::FreeDiskSpaceIfNeededFor( |
248 int64 num_bytes, | 250 int64_t num_bytes, |
249 const FreeDiskSpaceCallback& callback) { | 251 const FreeDiskSpaceCallback& callback) { |
250 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 252 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
251 } | 253 } |
252 | 254 |
253 void FakeFileSystem::CalculateEvictableCacheSize( | 255 void FakeFileSystem::CalculateEvictableCacheSize( |
254 const EvictableCacheSizeCallback& callback) { | 256 const EvictableCacheSizeCallback& callback) { |
255 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 257 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
256 } | 258 } |
257 | 259 |
258 // Implementation of GetFileContent. | 260 // Implementation of GetFileContent. |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 callback.Run(FILE_ERROR_OK, entry.Pass()); | 413 callback.Run(FILE_ERROR_OK, entry.Pass()); |
412 return; | 414 return; |
413 } | 415 } |
414 } | 416 } |
415 | 417 |
416 callback.Run(FILE_ERROR_NOT_FOUND, scoped_ptr<ResourceEntry>()); | 418 callback.Run(FILE_ERROR_NOT_FOUND, scoped_ptr<ResourceEntry>()); |
417 } | 419 } |
418 | 420 |
419 } // namespace test_util | 421 } // namespace test_util |
420 } // namespace drive | 422 } // namespace drive |
OLD | NEW |