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 bool recursive, | 338 bool recursive, |
336 const storage::AsyncFileUtil::StatusCallback& callback) { | 339 const storage::AsyncFileUtil::StatusCallback& callback) { |
337 // TODO(mtomasz): Implement it once needed. | 340 // TODO(mtomasz): Implement it once needed. |
338 callback.Run(base::File::FILE_OK); | 341 callback.Run(base::File::FILE_OK); |
339 } | 342 } |
340 | 343 |
341 const ProvidedFileSystemInfo& FakeProvidedFileSystem::GetFileSystemInfo() | 344 const ProvidedFileSystemInfo& FakeProvidedFileSystem::GetFileSystemInfo() |
342 const { | 345 const { |
343 return file_system_info_; | 346 return file_system_info_; |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 const std::vector<int>& task_ids, | 406 const std::vector<int>& task_ids, |
404 const storage::AsyncFileUtil::StatusCallback& callback) { | 407 const storage::AsyncFileUtil::StatusCallback& callback) { |
405 for (size_t i = 0; i < task_ids.size(); ++i) { | 408 for (size_t i = 0; i < task_ids.size(); ++i) { |
406 tracker_.TryCancel(task_ids[i]); | 409 tracker_.TryCancel(task_ids[i]); |
407 } | 410 } |
408 callback.Run(base::File::FILE_OK); | 411 callback.Run(base::File::FILE_OK); |
409 } | 412 } |
410 | 413 |
411 } // namespace file_system_provider | 414 } // namespace file_system_provider |
412 } // namespace chromeos | 415 } // namespace chromeos |
OLD | NEW |