OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/public/cpp/bindings/interface_endpoint_client.h" | 5 #include "mojo/public/cpp/bindings/interface_endpoint_client.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 | 152 |
153 controller_ = handle_.group_controller()->AttachEndpointClient( | 153 controller_ = handle_.group_controller()->AttachEndpointClient( |
154 handle_, this, task_runner_); | 154 handle_, this, task_runner_); |
155 if (expect_sync_requests) | 155 if (expect_sync_requests) |
156 controller_->AllowWokenUpBySyncWatchOnSameThread(); | 156 controller_->AllowWokenUpBySyncWatchOnSameThread(); |
157 } | 157 } |
158 | 158 |
159 InterfaceEndpointClient::~InterfaceEndpointClient() { | 159 InterfaceEndpointClient::~InterfaceEndpointClient() { |
160 DCHECK(thread_checker_.CalledOnValidThread()); | 160 DCHECK(thread_checker_.CalledOnValidThread()); |
161 | 161 |
162 if (handle_.is_valid()) | 162 handle_.group_controller()->DetachEndpointClient(handle_); |
163 handle_.group_controller()->DetachEndpointClient(handle_); | |
164 } | 163 } |
165 | 164 |
166 AssociatedGroup* InterfaceEndpointClient::associated_group() { | 165 AssociatedGroup* InterfaceEndpointClient::associated_group() { |
167 if (!associated_group_) | 166 if (!associated_group_) |
168 associated_group_ = handle_.group_controller()->CreateAssociatedGroup(); | 167 associated_group_ = handle_.group_controller()->CreateAssociatedGroup(); |
169 return associated_group_.get(); | 168 return associated_group_.get(); |
170 } | 169 } |
171 | 170 |
172 uint32_t InterfaceEndpointClient::interface_id() const { | 171 uint32_t InterfaceEndpointClient::interface_id() const { |
173 DCHECK(thread_checker_.CalledOnValidThread()); | 172 DCHECK(thread_checker_.CalledOnValidThread()); |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 return responder->Accept(message); | 305 return responder->Accept(message); |
307 } else { | 306 } else { |
308 if (!incoming_receiver_) | 307 if (!incoming_receiver_) |
309 return false; | 308 return false; |
310 | 309 |
311 return incoming_receiver_->Accept(message); | 310 return incoming_receiver_->Accept(message); |
312 } | 311 } |
313 } | 312 } |
314 | 313 |
315 } // namespace mojo | 314 } // namespace mojo |
OLD | NEW |