| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/service_manager/service_manager.h" | 5 #include "services/service_manager/service_manager.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 std::stringstream ss; | 205 std::stringstream ss; |
| 206 ss << "Connection InterfaceProviderSpec prevented service: " | 206 ss << "Connection InterfaceProviderSpec prevented service: " |
| 207 << params->source().name() << " from binding interface: " | 207 << params->source().name() << " from binding interface: " |
| 208 << params->interface_name() << " exposed by: " << identity_.name(); | 208 << params->interface_name() << " exposed by: " << identity_.name(); |
| 209 LOG(ERROR) << ss.str(); | 209 LOG(ERROR) << ss.str(); |
| 210 params->bind_interface_callback().Run(mojom::ConnectResult::ACCESS_DENIED, | 210 params->bind_interface_callback().Run(mojom::ConnectResult::ACCESS_DENIED, |
| 211 identity_.user_id()); | 211 identity_.user_id()); |
| 212 return false; | 212 return false; |
| 213 } | 213 } |
| 214 | 214 |
| 215 params->bind_interface_callback().Run(mojom::ConnectResult::SUCCEEDED, | 215 if (!params->bind_interface_callback().is_null()) { |
| 216 identity_.user_id()); | 216 params->bind_interface_callback().Run(mojom::ConnectResult::SUCCEEDED, |
| 217 identity_.user_id()); |
| 218 } |
| 217 | 219 |
| 218 pending_service_connections_++; | 220 pending_service_connections_++; |
| 219 service_->OnBindInterface( | 221 service_->OnBindInterface( |
| 220 ServiceInfo(params->source(), source_specs), | 222 ServiceInfo(params->source(), source_specs), |
| 221 params->interface_name(), | 223 params->interface_name(), |
| 222 params->TakeInterfaceRequestPipe(), | 224 params->TakeInterfaceRequestPipe(), |
| 223 base::Bind(&Instance::OnConnectComplete, base::Unretained(this))); | 225 base::Bind(&Instance::OnConnectComplete, base::Unretained(this))); |
| 224 return true; | 226 return true; |
| 225 } | 227 } |
| 226 | 228 |
| (...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1063 bool connected = instance->CallOnConnect(¶ms); | 1065 bool connected = instance->CallOnConnect(¶ms); |
| 1064 DCHECK(connected); | 1066 DCHECK(connected); |
| 1065 } | 1067 } |
| 1066 } | 1068 } |
| 1067 | 1069 |
| 1068 base::WeakPtr<ServiceManager> ServiceManager::GetWeakPtr() { | 1070 base::WeakPtr<ServiceManager> ServiceManager::GetWeakPtr() { |
| 1069 return weak_ptr_factory_.GetWeakPtr(); | 1071 return weak_ptr_factory_.GetWeakPtr(); |
| 1070 } | 1072 } |
| 1071 | 1073 |
| 1072 } // namespace service_manager | 1074 } // namespace service_manager |
| OLD | NEW |