Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef COMPONENTS_ARC_FILE_SYSTEM_ARC_FILE_SYSTEM_OPERATION_RUNNER_H_ | |
| 6 #define COMPONENTS_ARC_FILE_SYSTEM_ARC_FILE_SYSTEM_OPERATION_RUNNER_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "components/arc/arc_service.h" | |
| 11 #include "components/arc/common/file_system.mojom.h" | |
| 12 | |
| 13 namespace arc { | |
| 14 | |
| 15 // An interface to run ARC file system operations. | |
| 16 // | |
| 17 // This is an abstraction layer on top of mojom::FileSystemInstance. | |
| 18 // An implementation of this interface is ArcDeferredFileSystemOperationRunner | |
|
hidehiko
2017/01/20 08:01:49
In ArcServiceManager, ArcFileSystemOperationRunner
Shuhei Takahashi
2017/01/20 09:13:04
Sure, updated the comments.
| |
| 19 // which defers file system operations while ARC is booting. | |
| 20 // | |
| 21 // All member functions must be called on the UI thread. | |
| 22 class ArcFileSystemOperationRunner : public ArcService { | |
| 23 public: | |
| 24 explicit ArcFileSystemOperationRunner(ArcBridgeService* bridge_service); | |
| 25 ~ArcFileSystemOperationRunner() override; | |
| 26 | |
| 27 using GetFileSizeCallback = mojom::FileSystemInstance::GetFileSizeCallback; | |
| 28 using OpenFileToReadCallback = | |
| 29 mojom::FileSystemInstance::OpenFileToReadCallback; | |
| 30 using GetDocumentCallback = mojom::FileSystemInstance::GetDocumentCallback; | |
| 31 using GetChildDocumentsCallback = | |
| 32 mojom::FileSystemInstance::GetChildDocumentsCallback; | |
| 33 | |
| 34 // Runs file system operations. See file_system.mojom for documentation. | |
| 35 virtual void GetFileSize(const std::string& url, | |
| 36 const GetFileSizeCallback& callback) = 0; | |
| 37 virtual void OpenFileToRead(const std::string& url, | |
| 38 const OpenFileToReadCallback& callback) = 0; | |
| 39 virtual void GetDocument(const std::string& authority, | |
| 40 const std::string& document_id, | |
| 41 const GetDocumentCallback& callback) = 0; | |
| 42 virtual void GetChildDocuments(const std::string& authority, | |
| 43 const std::string& parent_document_id, | |
| 44 const GetChildDocumentsCallback& callback) = 0; | |
| 45 | |
| 46 // For supporting ArcServiceManager::GetService<T>(). | |
| 47 static const char kArcServiceName[]; | |
|
hidehiko
2017/01/20 08:01:49
Style: Could you move up (maybe on top)?
https://
Shuhei Takahashi
2017/01/20 09:13:04
Done.
| |
| 48 }; | |
| 49 | |
| 50 } // namespace arc | |
| 51 | |
| 52 #endif // COMPONENTS_ARC_FILE_SYSTEM_ARC_FILE_SYSTEM_OPERATION_RUNNER_H_ | |
| OLD | NEW |