| 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 25 matching lines...) Expand all Loading... |
| 36 } // namespace filesystem | 36 } // namespace filesystem |
| 37 | 37 |
| 38 FileSystemApp::FileSystemApp() : lock_table_(new LockTable) {} | 38 FileSystemApp::FileSystemApp() : lock_table_(new LockTable) {} |
| 39 | 39 |
| 40 FileSystemApp::~FileSystemApp() {} | 40 FileSystemApp::~FileSystemApp() {} |
| 41 | 41 |
| 42 void FileSystemApp::OnStart(const shell::Identity& identity) { | 42 void FileSystemApp::OnStart(const shell::Identity& identity) { |
| 43 tracing_.Initialize(connector(), identity.name()); | 43 tracing_.Initialize(connector(), identity.name()); |
| 44 } | 44 } |
| 45 | 45 |
| 46 bool FileSystemApp::OnConnect(shell::Connection* connection) { | 46 bool FileSystemApp::OnConnect(const shell::Identity& remote_identity, |
| 47 connection->AddInterface<mojom::FileSystem>(this); | 47 shell::InterfaceRegistry* registry) { |
| 48 registry->AddInterface<mojom::FileSystem>(this); |
| 48 return true; | 49 return true; |
| 49 } | 50 } |
| 50 | 51 |
| 51 // |InterfaceFactory<Files>| implementation: | 52 // |InterfaceFactory<Files>| implementation: |
| 52 void FileSystemApp::Create(const shell::Identity& remote_identity, | 53 void FileSystemApp::Create(const shell::Identity& remote_identity, |
| 53 mojo::InterfaceRequest<mojom::FileSystem> request) { | 54 mojo::InterfaceRequest<mojom::FileSystem> request) { |
| 54 new FileSystemImpl(remote_identity, std::move(request), GetUserDataDir(), | 55 new FileSystemImpl(remote_identity, std::move(request), GetUserDataDir(), |
| 55 lock_table_); | 56 lock_table_); |
| 56 } | 57 } |
| 57 | 58 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 80 path = path.Append(FILE_PATH_LITERAL("filesystem")); | 81 path = path.Append(FILE_PATH_LITERAL("filesystem")); |
| 81 } | 82 } |
| 82 | 83 |
| 83 if (!base::PathExists(path)) | 84 if (!base::PathExists(path)) |
| 84 base::CreateDirectory(path); | 85 base::CreateDirectory(path); |
| 85 | 86 |
| 86 return path; | 87 return path; |
| 87 } | 88 } |
| 88 | 89 |
| 89 } // namespace filesystem | 90 } // namespace filesystem |
| OLD | NEW |