Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(178)

Side by Side Diff: mojo/public/cpp/bindings/lib/interface_endpoint_client.cc

Issue 2163633003: Support early associated interface binding on ChannelMojo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@explicit-channel-ipc-task-runner
Patch Set: . Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ipc/ipc_mojo_bootstrap_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 handle_.group_controller()->DetachEndpointClient(handle_); 162 if (handle_.is_valid())
163 handle_.group_controller()->DetachEndpointClient(handle_);
163 } 164 }
164 165
165 AssociatedGroup* InterfaceEndpointClient::associated_group() { 166 AssociatedGroup* InterfaceEndpointClient::associated_group() {
166 if (!associated_group_) 167 if (!associated_group_)
167 associated_group_ = handle_.group_controller()->CreateAssociatedGroup(); 168 associated_group_ = handle_.group_controller()->CreateAssociatedGroup();
168 return associated_group_.get(); 169 return associated_group_.get();
169 } 170 }
170 171
171 uint32_t InterfaceEndpointClient::interface_id() const { 172 uint32_t InterfaceEndpointClient::interface_id() const {
172 DCHECK(thread_checker_.CalledOnValidThread()); 173 DCHECK(thread_checker_.CalledOnValidThread());
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 return responder->Accept(message); 306 return responder->Accept(message);
306 } else { 307 } else {
307 if (!incoming_receiver_) 308 if (!incoming_receiver_)
308 return false; 309 return false;
309 310
310 return incoming_receiver_->Accept(message); 311 return incoming_receiver_->Accept(message);
311 } 312 }
312 } 313 }
313 314
314 } // namespace mojo 315 } // namespace mojo
OLDNEW
« no previous file with comments | « ipc/ipc_mojo_bootstrap_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698