OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "services/file/file_service.h" | 5 #include "services/file/file_service.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "components/filesystem/lock_table.h" | 10 #include "components/filesystem/lock_table.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 } | 94 } |
95 | 95 |
96 void FileService::OnStart() { | 96 void FileService::OnStart() { |
97 file_system_objects_.reset(new FileService::FileSystemObjects( | 97 file_system_objects_.reset(new FileService::FileSystemObjects( |
98 GetUserDirForUserId(context()->identity().user_id()))); | 98 GetUserDirForUserId(context()->identity().user_id()))); |
99 leveldb_objects_.reset( | 99 leveldb_objects_.reset( |
100 new FileService::LevelDBServiceObjects(file_service_runner_)); | 100 new FileService::LevelDBServiceObjects(file_service_runner_)); |
101 } | 101 } |
102 | 102 |
103 void FileService::OnBindInterface( | 103 void FileService::OnBindInterface( |
104 const service_manager::ServiceInfo& source_info, | 104 const service_manager::BindSourceInfo& source_info, |
105 const std::string& interface_name, | 105 const std::string& interface_name, |
106 mojo::ScopedMessagePipeHandle interface_pipe) { | 106 mojo::ScopedMessagePipeHandle interface_pipe) { |
107 registry_.BindInterface(source_info.identity, interface_name, | 107 registry_.BindInterface(source_info.identity, interface_name, |
108 std::move(interface_pipe)); | 108 std::move(interface_pipe)); |
109 } | 109 } |
110 | 110 |
111 void FileService::Create(const service_manager::Identity& remote_identity, | 111 void FileService::Create(const service_manager::Identity& remote_identity, |
112 mojom::FileSystemRequest request) { | 112 mojom::FileSystemRequest request) { |
113 file_service_runner_->PostTask( | 113 file_service_runner_->PostTask( |
114 FROM_HERE, | 114 FROM_HERE, |
115 base::Bind(&FileService::FileSystemObjects::OnFileSystemRequest, | 115 base::Bind(&FileService::FileSystemObjects::OnFileSystemRequest, |
116 file_system_objects_->AsWeakPtr(), remote_identity, | 116 file_system_objects_->AsWeakPtr(), remote_identity, |
117 base::Passed(&request))); | 117 base::Passed(&request))); |
118 } | 118 } |
119 | 119 |
120 void FileService::Create(const service_manager::Identity& remote_identity, | 120 void FileService::Create(const service_manager::Identity& remote_identity, |
121 leveldb::mojom::LevelDBServiceRequest request) { | 121 leveldb::mojom::LevelDBServiceRequest request) { |
122 leveldb_service_runner_->PostTask( | 122 leveldb_service_runner_->PostTask( |
123 FROM_HERE, | 123 FROM_HERE, |
124 base::Bind( | 124 base::Bind( |
125 &FileService::LevelDBServiceObjects::OnLevelDBServiceRequest, | 125 &FileService::LevelDBServiceObjects::OnLevelDBServiceRequest, |
126 leveldb_objects_->AsWeakPtr(), remote_identity, | 126 leveldb_objects_->AsWeakPtr(), remote_identity, |
127 base::Passed(&request))); | 127 base::Passed(&request))); |
128 } | 128 } |
129 | 129 |
130 } // namespace user_service | 130 } // namespace user_service |
OLD | NEW |