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

Unified Diff: components/arc/file_system/arc_file_system_operation_runner.h

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
Index: components/arc/file_system/arc_file_system_operation_runner.h
diff --git a/components/arc/file_system/arc_file_system_operation_runner.h b/components/arc/file_system/arc_file_system_operation_runner.h
new file mode 100644
index 0000000000000000000000000000000000000000..985ce0da7531e9b3401a63627745d72e3fc2b475
--- /dev/null
+++ b/components/arc/file_system/arc_file_system_operation_runner.h
@@ -0,0 +1,55 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_ARC_FILE_SYSTEM_ARC_FILE_SYSTEM_OPERATION_RUNNER_H_
+#define COMPONENTS_ARC_FILE_SYSTEM_ARC_FILE_SYSTEM_OPERATION_RUNNER_H_
+
+#include <string>
+
+#include "components/arc/arc_service.h"
+#include "components/arc/common/file_system.mojom.h"
+
+class GURL;
+
+namespace arc {
+
+// An interface to run ARC file system operations.
+//
+// This is an abstraction layer on top of mojom::FileSystemInstance.
+// In production, ArcDeferredFileSystemOperationRunner is always used which
+// defers file system operations while ARC is booting.
+// In unit tests, fake implementations will be injected.
+//
+// All member functions must be called on the UI thread.
+class ArcFileSystemOperationRunner : public ArcService {
+ public:
+ // For supporting ArcServiceManager::GetService<T>().
+ static const char kArcServiceName[];
+
+ explicit ArcFileSystemOperationRunner(ArcBridgeService* bridge_service);
+ ~ArcFileSystemOperationRunner() override;
+
+ using GetFileSizeCallback = mojom::FileSystemInstance::GetFileSizeCallback;
+ using OpenFileToReadCallback =
+ mojom::FileSystemInstance::OpenFileToReadCallback;
+ using GetDocumentCallback = mojom::FileSystemInstance::GetDocumentCallback;
+ using GetChildDocumentsCallback =
+ mojom::FileSystemInstance::GetChildDocumentsCallback;
+
+ // Runs file system operations. See file_system.mojom for documentation.
+ virtual void GetFileSize(const GURL& url,
+ const GetFileSizeCallback& callback) = 0;
+ virtual void OpenFileToRead(const GURL& url,
+ const OpenFileToReadCallback& callback) = 0;
+ virtual void GetDocument(const std::string& authority,
+ const std::string& document_id,
+ const GetDocumentCallback& callback) = 0;
+ virtual void GetChildDocuments(const std::string& authority,
+ const std::string& parent_document_id,
+ const GetChildDocumentsCallback& callback) = 0;
+};
+
+} // namespace arc
+
+#endif // COMPONENTS_ARC_FILE_SYSTEM_ARC_FILE_SYSTEM_OPERATION_RUNNER_H_
« no previous file with comments | « components/arc/file_system/arc_file_system_observer.h ('k') | components/arc/file_system/arc_file_system_operation_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698