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/message_loop/message_loop_proxy.h" | 7 #include "base/message_loop/message_loop_proxy.h" |
8 #include "net/base/io_buffer.h" | 8 #include "net/base/io_buffer.h" |
9 | 9 |
10 namespace chromeos { | 10 namespace chromeos { |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 } | 382 } |
383 | 383 |
384 AbortCallback FakeProvidedFileSystem::PostAbortableTask( | 384 AbortCallback FakeProvidedFileSystem::PostAbortableTask( |
385 const base::Closure& callback) { | 385 const base::Closure& callback) { |
386 const int task_id = tracker_.PostTask( | 386 const int task_id = tracker_.PostTask( |
387 base::MessageLoopProxy::current().get(), FROM_HERE, callback); | 387 base::MessageLoopProxy::current().get(), FROM_HERE, callback); |
388 return base::Bind( | 388 return base::Bind( |
389 &FakeProvidedFileSystem::Abort, weak_ptr_factory_.GetWeakPtr(), task_id); | 389 &FakeProvidedFileSystem::Abort, weak_ptr_factory_.GetWeakPtr(), task_id); |
390 } | 390 } |
391 | 391 |
392 void FakeProvidedFileSystem::Abort( | 392 void FakeProvidedFileSystem::Abort(int task_id) { |
393 int task_id, | |
394 const storage::AsyncFileUtil::StatusCallback& callback) { | |
395 tracker_.TryCancel(task_id); | 393 tracker_.TryCancel(task_id); |
396 callback.Run(base::File::FILE_OK); | |
397 } | 394 } |
398 | 395 |
399 void FakeProvidedFileSystem::AbortMany( | 396 void FakeProvidedFileSystem::AbortMany(const std::vector<int>& task_ids) { |
400 const std::vector<int>& task_ids, | |
401 const storage::AsyncFileUtil::StatusCallback& callback) { | |
402 for (size_t i = 0; i < task_ids.size(); ++i) { | 397 for (size_t i = 0; i < task_ids.size(); ++i) { |
403 tracker_.TryCancel(task_ids[i]); | 398 tracker_.TryCancel(task_ids[i]); |
404 } | 399 } |
405 callback.Run(base::File::FILE_OK); | |
406 } | 400 } |
407 | 401 |
408 } // namespace file_system_provider | 402 } // namespace file_system_provider |
409 } // namespace chromeos | 403 } // namespace chromeos |
OLD | NEW |