| 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 21 matching lines...) Expand all Loading... |
| 32 namespace { | 32 namespace { |
| 33 | 33 |
| 34 const char kUserDataDir[] = "user-data-dir"; | 34 const char kUserDataDir[] = "user-data-dir"; |
| 35 | 35 |
| 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::Initialize(shell::Connector* connector, | 42 void FileSystemApp::OnStart(shell::Connector* connector, |
| 43 const shell::Identity& identity, | 43 const shell::Identity& identity, |
| 44 uint32_t id) { | 44 uint32_t id) { |
| 45 tracing_.Initialize(connector, identity.name()); | 45 tracing_.Initialize(connector, identity.name()); |
| 46 } | 46 } |
| 47 | 47 |
| 48 bool FileSystemApp::AcceptConnection(shell::Connection* connection) { | 48 bool FileSystemApp::OnConnect(shell::Connection* connection) { |
| 49 connection->AddInterface<mojom::FileSystem>(this); | 49 connection->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(shell::Connection* connection, | 54 void FileSystemApp::Create(shell::Connection* connection, |
| 55 mojo::InterfaceRequest<mojom::FileSystem> request) { | 55 mojo::InterfaceRequest<mojom::FileSystem> request) { |
| 56 new FileSystemImpl(connection, std::move(request), GetUserDataDir(), | 56 new FileSystemImpl(connection, std::move(request), GetUserDataDir(), |
| 57 lock_table_); | 57 lock_table_); |
| 58 } | 58 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 82 path = path.Append(FILE_PATH_LITERAL("filesystem")); | 82 path = path.Append(FILE_PATH_LITERAL("filesystem")); |
| 83 } | 83 } |
| 84 | 84 |
| 85 if (!base::PathExists(path)) | 85 if (!base::PathExists(path)) |
| 86 base::CreateDirectory(path); | 86 base::CreateDirectory(path); |
| 87 | 87 |
| 88 return path; | 88 return path; |
| 89 } | 89 } |
| 90 | 90 |
| 91 } // namespace filesystem | 91 } // namespace filesystem |
| OLD | NEW |