| 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 "content/common/mojo/service_registry_impl.h" | 5 #include "content/common/mojo/service_registry_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "mojo/common/common_type_converters.h" | 9 #include "mojo/common/common_type_converters.h" |
| 10 | 10 |
| 11 namespace content { | 11 namespace content { |
| 12 | 12 |
| 13 ServiceRegistry* ServiceRegistry::Create() { |
| 14 return new ServiceRegistryImpl; |
| 15 } |
| 16 |
| 13 ServiceRegistryImpl::ServiceRegistryImpl() | 17 ServiceRegistryImpl::ServiceRegistryImpl() |
| 14 : binding_(this), weak_factory_(this) {} | 18 : binding_(this), weak_factory_(this) {} |
| 15 | 19 |
| 16 ServiceRegistryImpl::~ServiceRegistryImpl() { | 20 ServiceRegistryImpl::~ServiceRegistryImpl() { |
| 17 while (!pending_connects_.empty()) { | 21 while (!pending_connects_.empty()) { |
| 18 mojo::CloseRaw(pending_connects_.front().second); | 22 mojo::CloseRaw(pending_connects_.front().second); |
| 19 pending_connects_.pop(); | 23 pending_connects_.pop(); |
| 20 } | 24 } |
| 21 } | 25 } |
| 22 | 26 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 } | 102 } |
| 99 | 103 |
| 100 it->second.Run(std::move(client_handle)); | 104 it->second.Run(std::move(client_handle)); |
| 101 } | 105 } |
| 102 | 106 |
| 103 void ServiceRegistryImpl::OnConnectionError() { | 107 void ServiceRegistryImpl::OnConnectionError() { |
| 104 binding_.Close(); | 108 binding_.Close(); |
| 105 } | 109 } |
| 106 | 110 |
| 107 } // namespace content | 111 } // namespace content |
| OLD | NEW |