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

Side by Side 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 unified diff | Download patch
OLDNEW
(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 class GURL;
14
15 namespace arc {
16
17 // An interface to run ARC file system operations.
18 //
19 // This is an abstraction layer on top of mojom::FileSystemInstance.
20 // In production, ArcDeferredFileSystemOperationRunner is always used which
21 // defers file system operations while ARC is booting.
22 // In unit tests, fake implementations will be injected.
23 //
24 // All member functions must be called on the UI thread.
25 class ArcFileSystemOperationRunner : public ArcService {
26 public:
27 // For supporting ArcServiceManager::GetService<T>().
28 static const char kArcServiceName[];
29
30 explicit ArcFileSystemOperationRunner(ArcBridgeService* bridge_service);
31 ~ArcFileSystemOperationRunner() override;
32
33 using GetFileSizeCallback = mojom::FileSystemInstance::GetFileSizeCallback;
34 using OpenFileToReadCallback =
35 mojom::FileSystemInstance::OpenFileToReadCallback;
36 using GetDocumentCallback = mojom::FileSystemInstance::GetDocumentCallback;
37 using GetChildDocumentsCallback =
38 mojom::FileSystemInstance::GetChildDocumentsCallback;
39
40 // Runs file system operations. See file_system.mojom for documentation.
41 virtual void GetFileSize(const GURL& url,
42 const GetFileSizeCallback& callback) = 0;
43 virtual void OpenFileToRead(const GURL& url,
44 const OpenFileToReadCallback& callback) = 0;
45 virtual void GetDocument(const std::string& authority,
46 const std::string& document_id,
47 const GetDocumentCallback& callback) = 0;
48 virtual void GetChildDocuments(const std::string& authority,
49 const std::string& parent_document_id,
50 const GetChildDocumentsCallback& callback) = 0;
51 };
52
53 } // namespace arc
54
55 #endif // COMPONENTS_ARC_FILE_SYSTEM_ARC_FILE_SYSTEM_OPERATION_RUNNER_H_
OLDNEW
« 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