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

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

Issue 2185723002: Eliminate deferred destruction of AssociatedGroupController (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 4 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 | « mojo/public/cpp/bindings/lib/multiplex_router.h ('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/lib/multiplex_router.h" 5 #include "mojo/public/cpp/bindings/lib/multiplex_router.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 Type type; 278 Type type;
279 279
280 private: 280 private:
281 explicit Task(Type in_type) : type(in_type) {} 281 explicit Task(Type in_type) : type(in_type) {}
282 }; 282 };
283 283
284 MultiplexRouter::MultiplexRouter( 284 MultiplexRouter::MultiplexRouter(
285 bool set_interface_id_namesapce_bit, 285 bool set_interface_id_namesapce_bit,
286 ScopedMessagePipeHandle message_pipe, 286 ScopedMessagePipeHandle message_pipe,
287 scoped_refptr<base::SingleThreadTaskRunner> runner) 287 scoped_refptr<base::SingleThreadTaskRunner> runner)
288 : AssociatedGroupController(base::ThreadTaskRunnerHandle::Get()), 288 : set_interface_id_namespace_bit_(set_interface_id_namesapce_bit),
289 set_interface_id_namespace_bit_(set_interface_id_namesapce_bit), 289 task_runner_(runner),
290 header_validator_(this), 290 header_validator_(this),
291 connector_(std::move(message_pipe), 291 connector_(std::move(message_pipe),
292 Connector::MULTI_THREADED_SEND, 292 Connector::MULTI_THREADED_SEND,
293 std::move(runner)), 293 std::move(runner)),
294 control_message_handler_(this), 294 control_message_handler_(this),
295 control_message_proxy_(&connector_), 295 control_message_proxy_(&connector_),
296 next_interface_id_value_(1), 296 next_interface_id_value_(1),
297 posted_to_process_tasks_(false), 297 posted_to_process_tasks_(false),
298 encountered_error_(false), 298 encountered_error_(false),
299 paused_(false), 299 paused_(false),
300 testing_mode_(false) { 300 testing_mode_(false) {
301 DCHECK(task_runner_->BelongsToCurrentThread());
301 // Always participate in sync handle watching, because even if it doesn't 302 // Always participate in sync handle watching, because even if it doesn't
302 // expect sync requests during sync handle watching, it may still need to 303 // expect sync requests during sync handle watching, it may still need to
303 // dispatch messages to associated endpoints on a different thread. 304 // dispatch messages to associated endpoints on a different thread.
304 connector_.AllowWokenUpBySyncWatchOnSameThread(); 305 connector_.AllowWokenUpBySyncWatchOnSameThread();
305 connector_.set_incoming_receiver(&header_validator_); 306 connector_.set_incoming_receiver(&header_validator_);
306 connector_.set_connection_error_handler( 307 connector_.set_connection_error_handler(
307 base::Bind(&MultiplexRouter::OnPipeConnectionError, 308 base::Bind(&MultiplexRouter::OnPipeConnectionError,
308 base::Unretained(this))); 309 base::Unretained(this)));
309 } 310 }
310 311
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
876 *inserted = true; 877 *inserted = true;
877 } else { 878 } else {
878 endpoint = iter->second.get(); 879 endpoint = iter->second.get();
879 } 880 }
880 881
881 return endpoint; 882 return endpoint;
882 } 883 }
883 884
884 } // namespace internal 885 } // namespace internal
885 } // namespace mojo 886 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/lib/multiplex_router.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698