Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(232)

Unified Diff: components/arc/test/fake_file_system_instance.cc

Issue 2637163002: Defer ARC file system operations while ARC is booting. (Closed)
Patch Set: Addressed hashimoto's comments. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/arc/test/fake_file_system_instance.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/arc/test/fake_file_system_instance.cc
diff --git a/components/arc/test/fake_file_system_instance.cc b/components/arc/test/fake_file_system_instance.cc
index d9c6f833ba5083c13de5197352ebb1af6ebae844..a0a0aca33a31f367c5ebfe1b89565a64c568eced 100644
--- a/components/arc/test/fake_file_system_instance.cc
+++ b/components/arc/test/fake_file_system_instance.cc
@@ -4,6 +4,12 @@
#include "components/arc/test/fake_file_system_instance.h"
+#include "base/bind.h"
+#include "base/location.h"
+#include "base/optional.h"
+#include "base/threading/thread_task_runner_handle.h"
+#include "mojo/public/cpp/system/handle.h"
+
namespace arc {
FakeFileSystemInstance::FakeFileSystemInstance() = default;
@@ -13,20 +19,34 @@ FakeFileSystemInstance::~FakeFileSystemInstance() = default;
void FakeFileSystemInstance::GetChildDocuments(
const std::string& authority,
const std::string& document_id,
- const GetChildDocumentsCallback& callback) {}
+ const GetChildDocumentsCallback& callback) {
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(callback, base::nullopt));
+}
void FakeFileSystemInstance::GetDocument(const std::string& authority,
const std::string& document_id,
- const GetDocumentCallback& callback) {}
+ const GetDocumentCallback& callback) {
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(callback, base::Passed(mojom::DocumentPtr())));
+}
void FakeFileSystemInstance::GetFileSize(const std::string& url,
- const GetFileSizeCallback& callback) {}
+ const GetFileSizeCallback& callback) {
+ base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE,
+ base::Bind(callback, -1));
+}
void FakeFileSystemInstance::OpenFileToRead(
const std::string& url,
- const OpenFileToReadCallback& callback) {}
+ const OpenFileToReadCallback& callback) {
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(callback, base::Passed(mojo::ScopedHandle())));
+}
void FakeFileSystemInstance::RequestMediaScan(
- const std::vector<std::string>& paths) {}
+ const std::vector<std::string>& paths) {
+ // Do nothing and pretend we scaned them.
+}
} // namespace arc
« no previous file with comments | « components/arc/test/fake_file_system_instance.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698