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 "mojo/shell/public/cpp/lib/connection_impl.h" | 5 #include "mojo/shell/public/cpp/lib/connection_impl.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 22 matching lines...) Expand all Loading... |
33 remote_ids_valid_(false), | 33 remote_ids_valid_(false), |
34 remote_user_id_(remote_user_id), | 34 remote_user_id_(remote_user_id), |
35 local_registry_(std::move(local_interfaces), this), | 35 local_registry_(std::move(local_interfaces), this), |
36 remote_interfaces_(std::move(remote_interfaces)), | 36 remote_interfaces_(std::move(remote_interfaces)), |
37 allowed_interfaces_(allowed_interfaces), | 37 allowed_interfaces_(allowed_interfaces), |
38 allow_all_interfaces_(allowed_interfaces_.size() == 1 && | 38 allow_all_interfaces_(allowed_interfaces_.size() == 1 && |
39 allowed_interfaces_.count("*") == 1), | 39 allowed_interfaces_.count("*") == 1), |
40 weak_factory_(this) {} | 40 weak_factory_(this) {} |
41 | 41 |
42 ConnectionImpl::ConnectionImpl() | 42 ConnectionImpl::ConnectionImpl() |
43 : remote_id_(shell::mojom::Shell::kInvalidApplicationID), | 43 : remote_id_(shell::mojom::Connector::kInvalidApplicationID), |
44 remote_ids_valid_(false), | 44 remote_ids_valid_(false), |
45 local_registry_(shell::mojom::InterfaceProviderRequest(), this), | 45 local_registry_(shell::mojom::InterfaceProviderRequest(), this), |
46 allow_all_interfaces_(true), | 46 allow_all_interfaces_(true), |
47 weak_factory_(this) {} | 47 weak_factory_(this) {} |
48 | 48 |
49 ConnectionImpl::~ConnectionImpl() {} | 49 ConnectionImpl::~ConnectionImpl() {} |
50 | 50 |
51 shell::mojom::Shell::ConnectCallback ConnectionImpl::GetConnectCallback() { | 51 shell::mojom::Connector::ConnectCallback ConnectionImpl::GetConnectCallback() { |
52 return base::Bind(&ConnectionImpl::OnGotInstanceID, | 52 return base::Bind(&ConnectionImpl::OnGotInstanceID, |
53 weak_factory_.GetWeakPtr()); | 53 weak_factory_.GetWeakPtr()); |
54 } | 54 } |
55 | 55 |
56 //////////////////////////////////////////////////////////////////////////////// | 56 //////////////////////////////////////////////////////////////////////////////// |
57 // ConnectionImpl, Connection implementation: | 57 // ConnectionImpl, Connection implementation: |
58 | 58 |
59 const std::string& ConnectionImpl::GetConnectionURL() { | 59 const std::string& ConnectionImpl::GetConnectionURL() { |
60 return connection_url_; | 60 return connection_url_; |
61 } | 61 } |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 | 114 |
115 remote_id_ = target_application_id; | 115 remote_id_ = target_application_id; |
116 std::vector<Closure> callbacks; | 116 std::vector<Closure> callbacks; |
117 callbacks.swap(remote_id_callbacks_); | 117 callbacks.swap(remote_id_callbacks_); |
118 for (auto callback : callbacks) | 118 for (auto callback : callbacks) |
119 callback.Run(); | 119 callback.Run(); |
120 } | 120 } |
121 | 121 |
122 } // namespace internal | 122 } // namespace internal |
123 } // namespace mojo | 123 } // namespace mojo |
OLD | NEW |