| 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 "content/common/service_manager/service_manager_connection_impl.h" | 5 #include "content/common/service_manager/service_manager_connection_impl.h" |
| 6 | 6 |
| 7 #include <queue> | 7 #include <queue> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 void ServiceManagerConnectionImpl::RemoveOnConnectHandler(int id) { | 503 void ServiceManagerConnectionImpl::RemoveOnConnectHandler(int id) { |
| 504 auto it = on_connect_handlers_.find(id); | 504 auto it = on_connect_handlers_.find(id); |
| 505 DCHECK(it != on_connect_handlers_.end()); | 505 DCHECK(it != on_connect_handlers_.end()); |
| 506 on_connect_handlers_.erase(it); | 506 on_connect_handlers_.erase(it); |
| 507 } | 507 } |
| 508 | 508 |
| 509 void ServiceManagerConnectionImpl::CreateService( | 509 void ServiceManagerConnectionImpl::CreateService( |
| 510 service_manager::mojom::ServiceRequest request, | 510 service_manager::mojom::ServiceRequest request, |
| 511 const std::string& name) { | 511 const std::string& name) { |
| 512 auto it = request_handlers_.find(name); | 512 auto it = request_handlers_.find(name); |
| 513 DCHECK(it != request_handlers_.end()) |
| 514 << "Can't create service " << name << ". No handler found."; |
| 513 if (it != request_handlers_.end()) | 515 if (it != request_handlers_.end()) |
| 514 it->second.Run(std::move(request)); | 516 it->second.Run(std::move(request)); |
| 515 } | 517 } |
| 516 | 518 |
| 517 void ServiceManagerConnectionImpl::OnContextInitialized( | 519 void ServiceManagerConnectionImpl::OnContextInitialized( |
| 518 const service_manager::Identity& identity) { | 520 const service_manager::Identity& identity) { |
| 519 identity_ = identity; | 521 identity_ = identity; |
| 520 } | 522 } |
| 521 | 523 |
| 522 void ServiceManagerConnectionImpl::OnConnectionLost() { | 524 void ServiceManagerConnectionImpl::OnConnectionLost() { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 533 } | 535 } |
| 534 | 536 |
| 535 void ServiceManagerConnectionImpl::GetInterface( | 537 void ServiceManagerConnectionImpl::GetInterface( |
| 536 service_manager::mojom::InterfaceProvider* provider, | 538 service_manager::mojom::InterfaceProvider* provider, |
| 537 const std::string& interface_name, | 539 const std::string& interface_name, |
| 538 mojo::ScopedMessagePipeHandle request_handle) { | 540 mojo::ScopedMessagePipeHandle request_handle) { |
| 539 provider->GetInterface(interface_name, std::move(request_handle)); | 541 provider->GetInterface(interface_name, std::move(request_handle)); |
| 540 } | 542 } |
| 541 | 543 |
| 542 } // namespace content | 544 } // namespace content |
| 543 | |
| OLD | NEW |