| 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 #include "components/filesystem/file_system_app.h" | 5 #include "components/filesystem/file_system_app.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 namespace { | 33 namespace { |
| 34 | 34 |
| 35 const char kUserDataDir[] = "user-data-dir"; | 35 const char kUserDataDir[] = "user-data-dir"; |
| 36 | 36 |
| 37 } // namespace filesystem | 37 } // namespace filesystem |
| 38 | 38 |
| 39 FileSystemApp::FileSystemApp() : lock_table_(new LockTable) {} | 39 FileSystemApp::FileSystemApp() : lock_table_(new LockTable) {} |
| 40 | 40 |
| 41 FileSystemApp::~FileSystemApp() {} | 41 FileSystemApp::~FileSystemApp() {} |
| 42 | 42 |
| 43 void FileSystemApp::OnStart(const shell::Identity& identity) { | 43 void FileSystemApp::OnStart(const service_manager::Identity& identity) { |
| 44 tracing_.Initialize(connector(), identity.name()); | 44 tracing_.Initialize(connector(), identity.name()); |
| 45 } | 45 } |
| 46 | 46 |
| 47 bool FileSystemApp::OnConnect(const shell::Identity& remote_identity, | 47 bool FileSystemApp::OnConnect(const service_manager::Identity& remote_identity, |
| 48 shell::InterfaceRegistry* registry) { | 48 service_manager::InterfaceRegistry* registry) { |
| 49 registry->AddInterface<mojom::FileSystem>(this); | 49 registry->AddInterface<mojom::FileSystem>(this); |
| 50 return true; | 50 return true; |
| 51 } | 51 } |
| 52 | 52 |
| 53 // |InterfaceFactory<Files>| implementation: | 53 // |InterfaceFactory<Files>| implementation: |
| 54 void FileSystemApp::Create(const shell::Identity& remote_identity, | 54 void FileSystemApp::Create(const service_manager::Identity& remote_identity, |
| 55 mojom::FileSystemRequest request) { | 55 mojom::FileSystemRequest request) { |
| 56 mojo::MakeStrongBinding(base::MakeUnique<FileSystemImpl>( | 56 mojo::MakeStrongBinding(base::MakeUnique<FileSystemImpl>( |
| 57 remote_identity, GetUserDataDir(), lock_table_), | 57 remote_identity, GetUserDataDir(), lock_table_), |
| 58 std::move(request)); | 58 std::move(request)); |
| 59 } | 59 } |
| 60 | 60 |
| 61 //static | 61 //static |
| 62 base::FilePath FileSystemApp::GetUserDataDir() { | 62 base::FilePath FileSystemApp::GetUserDataDir() { |
| 63 base::FilePath path; | 63 base::FilePath path; |
| 64 | 64 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 83 path = path.Append(FILE_PATH_LITERAL("filesystem")); | 83 path = path.Append(FILE_PATH_LITERAL("filesystem")); |
| 84 } | 84 } |
| 85 | 85 |
| 86 if (!base::PathExists(path)) | 86 if (!base::PathExists(path)) |
| 87 base::CreateDirectory(path); | 87 base::CreateDirectory(path); |
| 88 | 88 |
| 89 return path; | 89 return path; |
| 90 } | 90 } |
| 91 | 91 |
| 92 } // namespace filesystem | 92 } // namespace filesystem |
| OLD | NEW |