| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 COMPONENTS_FILESYSTEM_FILE_SYSTEM_APP_H_ | 5 #ifndef COMPONENTS_FILESYSTEM_FILE_SYSTEM_APP_H_ |
| 6 #define COMPONENTS_FILESYSTEM_FILE_SYSTEM_APP_H_ | 6 #define COMPONENTS_FILESYSTEM_FILE_SYSTEM_APP_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "components/filesystem/directory_impl.h" | 9 #include "components/filesystem/directory_impl.h" |
| 10 #include "components/filesystem/file_system_impl.h" | 10 #include "components/filesystem/file_system_impl.h" |
| 11 #include "components/filesystem/lock_table.h" | 11 #include "components/filesystem/lock_table.h" |
| 12 #include "components/filesystem/public/interfaces/file_system.mojom.h" | 12 #include "components/filesystem/public/interfaces/file_system.mojom.h" |
| 13 #include "services/service_manager/public/cpp/binder_registry.h" | 13 #include "services/service_manager/public/cpp/binder_registry.h" |
| 14 #include "services/service_manager/public/cpp/interface_factory.h" | 14 #include "services/service_manager/public/cpp/interface_factory.h" |
| 15 #include "services/service_manager/public/cpp/service.h" | 15 #include "services/service_manager/public/cpp/service.h" |
| 16 #include "services/tracing/public/cpp/provider.h" | |
| 17 | 16 |
| 18 namespace filesystem { | 17 namespace filesystem { |
| 19 | 18 |
| 20 class FileSystemApp | 19 class FileSystemApp |
| 21 : public service_manager::Service, | 20 : public service_manager::Service, |
| 22 public service_manager::InterfaceFactory<mojom::FileSystem> { | 21 public service_manager::InterfaceFactory<mojom::FileSystem> { |
| 23 public: | 22 public: |
| 24 FileSystemApp(); | 23 FileSystemApp(); |
| 25 ~FileSystemApp() override; | 24 ~FileSystemApp() override; |
| 26 | 25 |
| 27 private: | 26 private: |
| 28 // Gets the system specific toplevel profile directory. | 27 // Gets the system specific toplevel profile directory. |
| 29 static base::FilePath GetUserDataDir(); | 28 static base::FilePath GetUserDataDir(); |
| 30 | 29 |
| 31 // |service_manager::Service| override: | 30 // |service_manager::Service| override: |
| 32 void OnStart() override; | 31 void OnStart() override; |
| 33 void OnBindInterface(const service_manager::ServiceInfo& source_info, | 32 void OnBindInterface(const service_manager::ServiceInfo& source_info, |
| 34 const std::string& interface_name, | 33 const std::string& interface_name, |
| 35 mojo::ScopedMessagePipeHandle interface_pipe) override; | 34 mojo::ScopedMessagePipeHandle interface_pipe) override; |
| 36 | 35 |
| 37 // |InterfaceFactory<Files>| implementation: | 36 // |InterfaceFactory<Files>| implementation: |
| 38 void Create(const service_manager::Identity& remote_identity, | 37 void Create(const service_manager::Identity& remote_identity, |
| 39 mojo::InterfaceRequest<mojom::FileSystem> request) override; | 38 mojo::InterfaceRequest<mojom::FileSystem> request) override; |
| 40 | 39 |
| 41 tracing::Provider tracing_; | |
| 42 | |
| 43 service_manager::BinderRegistry registry_; | 40 service_manager::BinderRegistry registry_; |
| 44 | 41 |
| 45 scoped_refptr<LockTable> lock_table_; | 42 scoped_refptr<LockTable> lock_table_; |
| 46 | 43 |
| 47 DISALLOW_COPY_AND_ASSIGN(FileSystemApp); | 44 DISALLOW_COPY_AND_ASSIGN(FileSystemApp); |
| 48 }; | 45 }; |
| 49 | 46 |
| 50 } // namespace filesystem | 47 } // namespace filesystem |
| 51 | 48 |
| 52 #endif // COMPONENTS_FILESYSTEM_FILE_SYSTEM_APP_H_ | 49 #endif // COMPONENTS_FILESYSTEM_FILE_SYSTEM_APP_H_ |
| OLD | NEW |