OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/chromeos/file_system_provider/fake_provided_file_system
.h" | 5 #include "chrome/browser/chromeos/file_system_provider/fake_provided_file_system
.h" |
6 | 6 |
7 #include "base/files/file.h" | 7 #include "base/files/file.h" |
8 #include "base/message_loop/message_loop_proxy.h" | 8 #include "base/message_loop/message_loop_proxy.h" |
9 #include "net/base/io_buffer.h" | 9 #include "net/base/io_buffer.h" |
10 | 10 |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 entry->contents.resize(entry->metadata->size); | 316 entry->contents.resize(entry->metadata->size); |
317 } | 317 } |
318 | 318 |
319 entry->contents.replace(offset, length, buffer->data(), length); | 319 entry->contents.replace(offset, length, buffer->data(), length); |
320 | 320 |
321 return PostAbortableTask(base::Bind(callback, base::File::FILE_OK)); | 321 return PostAbortableTask(base::Bind(callback, base::File::FILE_OK)); |
322 } | 322 } |
323 | 323 |
324 ProvidedFileSystemInterface::AbortCallback | 324 ProvidedFileSystemInterface::AbortCallback |
325 FakeProvidedFileSystem::ObserveDirectory( | 325 FakeProvidedFileSystem::ObserveDirectory( |
| 326 const GURL& origin, |
326 const base::FilePath& directory_path, | 327 const base::FilePath& directory_path, |
327 bool recursive, | 328 bool recursive, |
| 329 bool persistent, |
328 const storage::AsyncFileUtil::StatusCallback& callback) { | 330 const storage::AsyncFileUtil::StatusCallback& callback) { |
329 // TODO(mtomasz): Implement it once needed. | 331 // TODO(mtomasz): Implement it once needed. |
330 return PostAbortableTask(base::Bind(callback, base::File::FILE_OK)); | 332 return PostAbortableTask(base::Bind(callback, base::File::FILE_OK)); |
331 } | 333 } |
332 | 334 |
333 void FakeProvidedFileSystem::UnobserveEntry( | 335 void FakeProvidedFileSystem::UnobserveEntry( |
| 336 const GURL& origin, |
334 const base::FilePath& entry_path, | 337 const base::FilePath& entry_path, |
335 const storage::AsyncFileUtil::StatusCallback& callback) { | 338 const storage::AsyncFileUtil::StatusCallback& callback) { |
336 // TODO(mtomasz): Implement it once needed. | 339 // TODO(mtomasz): Implement it once needed. |
337 callback.Run(base::File::FILE_OK); | 340 callback.Run(base::File::FILE_OK); |
338 } | 341 } |
339 | 342 |
340 const ProvidedFileSystemInfo& FakeProvidedFileSystem::GetFileSystemInfo() | 343 const ProvidedFileSystemInfo& FakeProvidedFileSystem::GetFileSystemInfo() |
341 const { | 344 const { |
342 return file_system_info_; | 345 return file_system_info_; |
343 } | 346 } |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 const std::vector<int>& task_ids, | 404 const std::vector<int>& task_ids, |
402 const storage::AsyncFileUtil::StatusCallback& callback) { | 405 const storage::AsyncFileUtil::StatusCallback& callback) { |
403 for (size_t i = 0; i < task_ids.size(); ++i) { | 406 for (size_t i = 0; i < task_ids.size(); ++i) { |
404 tracker_.TryCancel(task_ids[i]); | 407 tracker_.TryCancel(task_ids[i]); |
405 } | 408 } |
406 callback.Run(base::File::FILE_OK); | 409 callback.Run(base::File::FILE_OK); |
407 } | 410 } |
408 | 411 |
409 } // namespace file_system_provider | 412 } // namespace file_system_provider |
410 } // namespace chromeos | 413 } // namespace chromeos |
OLD | NEW |