| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef CHROME_BROWSER_CHROMEOS_ARC_FILEAPI_ARC_FILE_SYSTEM_OPERATION_RUNNER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_ARC_FILEAPI_ARC_FILE_SYSTEM_OPERATION_RUNNER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_ARC_FILEAPI_ARC_FILE_SYSTEM_OPERATION_RUNNER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_ARC_FILEAPI_ARC_FILE_SYSTEM_OPERATION_RUNNER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 // failing immediately. | 48 // failing immediately. |
| 49 // | 49 // |
| 50 // All member functions must be called on the UI thread. | 50 // All member functions must be called on the UI thread. |
| 51 class ArcFileSystemOperationRunner | 51 class ArcFileSystemOperationRunner |
| 52 : public ArcService, | 52 : public ArcService, |
| 53 public mojom::FileSystemHost, | 53 public mojom::FileSystemHost, |
| 54 public ArcSessionManager::Observer, | 54 public ArcSessionManager::Observer, |
| 55 public InstanceHolder<mojom::FileSystemInstance>::Observer { | 55 public InstanceHolder<mojom::FileSystemInstance>::Observer { |
| 56 public: | 56 public: |
| 57 using GetFileSizeCallback = mojom::FileSystemInstance::GetFileSizeCallback; | 57 using GetFileSizeCallback = mojom::FileSystemInstance::GetFileSizeCallback; |
| 58 using GetMimeTypeCallback = mojom::FileSystemInstance::GetMimeTypeCallback; |
| 58 using OpenFileToReadCallback = | 59 using OpenFileToReadCallback = |
| 59 mojom::FileSystemInstance::OpenFileToReadCallback; | 60 mojom::FileSystemInstance::OpenFileToReadCallback; |
| 60 using GetDocumentCallback = mojom::FileSystemInstance::GetDocumentCallback; | 61 using GetDocumentCallback = mojom::FileSystemInstance::GetDocumentCallback; |
| 61 using GetChildDocumentsCallback = | 62 using GetChildDocumentsCallback = |
| 62 mojom::FileSystemInstance::GetChildDocumentsCallback; | 63 mojom::FileSystemInstance::GetChildDocumentsCallback; |
| 63 using AddWatcherCallback = base::Callback<void(int64_t watcher_id)>; | 64 using AddWatcherCallback = base::Callback<void(int64_t watcher_id)>; |
| 64 using RemoveWatcherCallback = base::Callback<void(bool success)>; | 65 using RemoveWatcherCallback = base::Callback<void(bool success)>; |
| 65 using ChangeType = storage::WatcherManager::ChangeType; | 66 using ChangeType = storage::WatcherManager::ChangeType; |
| 66 using WatcherCallback = base::Callback<void(ChangeType type)>; | 67 using WatcherCallback = base::Callback<void(ChangeType type)>; |
| 67 | 68 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 92 ArcFileSystemOperationRunner(ArcBridgeService* bridge_service, | 93 ArcFileSystemOperationRunner(ArcBridgeService* bridge_service, |
| 93 const Profile* profile); | 94 const Profile* profile); |
| 94 ~ArcFileSystemOperationRunner() override; | 95 ~ArcFileSystemOperationRunner() override; |
| 95 | 96 |
| 96 // Adds or removes observers. | 97 // Adds or removes observers. |
| 97 void AddObserver(Observer* observer); | 98 void AddObserver(Observer* observer); |
| 98 void RemoveObserver(Observer* observer); | 99 void RemoveObserver(Observer* observer); |
| 99 | 100 |
| 100 // Runs file system operations. See file_system.mojom for documentation. | 101 // Runs file system operations. See file_system.mojom for documentation. |
| 101 void GetFileSize(const GURL& url, const GetFileSizeCallback& callback); | 102 void GetFileSize(const GURL& url, const GetFileSizeCallback& callback); |
| 103 void GetMimeType(const GURL& url, const GetMimeTypeCallback& callback); |
| 102 void OpenFileToRead(const GURL& url, const OpenFileToReadCallback& callback); | 104 void OpenFileToRead(const GURL& url, const OpenFileToReadCallback& callback); |
| 103 void GetDocument(const std::string& authority, | 105 void GetDocument(const std::string& authority, |
| 104 const std::string& document_id, | 106 const std::string& document_id, |
| 105 const GetDocumentCallback& callback); | 107 const GetDocumentCallback& callback); |
| 106 void GetChildDocuments(const std::string& authority, | 108 void GetChildDocuments(const std::string& authority, |
| 107 const std::string& parent_document_id, | 109 const std::string& parent_document_id, |
| 108 const GetChildDocumentsCallback& callback); | 110 const GetChildDocumentsCallback& callback); |
| 109 void AddWatcher(const std::string& authority, | 111 void AddWatcher(const std::string& authority, |
| 110 const std::string& document_id, | 112 const std::string& document_id, |
| 111 const WatcherCallback& watcher_callback, | 113 const WatcherCallback& watcher_callback, |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 mojo::Binding<mojom::FileSystemHost> binding_; | 167 mojo::Binding<mojom::FileSystemHost> binding_; |
| 166 | 168 |
| 167 base::WeakPtrFactory<ArcFileSystemOperationRunner> weak_ptr_factory_; | 169 base::WeakPtrFactory<ArcFileSystemOperationRunner> weak_ptr_factory_; |
| 168 | 170 |
| 169 DISALLOW_COPY_AND_ASSIGN(ArcFileSystemOperationRunner); | 171 DISALLOW_COPY_AND_ASSIGN(ArcFileSystemOperationRunner); |
| 170 }; | 172 }; |
| 171 | 173 |
| 172 } // namespace arc | 174 } // namespace arc |
| 173 | 175 |
| 174 #endif // CHROME_BROWSER_CHROMEOS_ARC_FILEAPI_ARC_FILE_SYSTEM_OPERATION_RUNNER_
H_ | 176 #endif // CHROME_BROWSER_CHROMEOS_ARC_FILEAPI_ARC_FILE_SYSTEM_OPERATION_RUNNER_
H_ |
| OLD | NEW |