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

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

Issue 2725133002: Mojo: Armed Watchers (Closed)
Patch Set: . Created 3 years, 9 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
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 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 MayAutoLock locker(&lock_); 598 MayAutoLock locker(&lock_);
599 599
600 if (endpoints_.size() > 1) 600 if (endpoints_.size() > 1)
601 return true; 601 return true;
602 if (endpoints_.size() == 0) 602 if (endpoints_.size() == 0)
603 return false; 603 return false;
604 604
605 return !base::ContainsKey(endpoints_, kMasterInterfaceId); 605 return !base::ContainsKey(endpoints_, kMasterInterfaceId);
606 } 606 }
607 607
608 void MultiplexRouter::EnableNestedDispatch(bool enabled) {
609 DCHECK(thread_checker_.CalledOnValidThread());
610 connector_.EnableNestedDispatch(enabled);
611 }
612
608 void MultiplexRouter::EnableTestingMode() { 613 void MultiplexRouter::EnableTestingMode() {
609 DCHECK(thread_checker_.CalledOnValidThread()); 614 DCHECK(thread_checker_.CalledOnValidThread());
610 MayAutoLock locker(&lock_); 615 MayAutoLock locker(&lock_);
611 616
612 testing_mode_ = true; 617 testing_mode_ = true;
613 connector_.set_enforce_errors_from_incoming_receiver(false); 618 connector_.set_enforce_errors_from_incoming_receiver(false);
614 } 619 }
615 620
616 bool MultiplexRouter::Accept(Message* message) { 621 bool MultiplexRouter::Accept(Message* message) {
617 DCHECK(thread_checker_.CalledOnValidThread()); 622 DCHECK(thread_checker_.CalledOnValidThread());
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
977 982
978 void MultiplexRouter::AssertLockAcquired() { 983 void MultiplexRouter::AssertLockAcquired() {
979 #if DCHECK_IS_ON() 984 #if DCHECK_IS_ON()
980 if (lock_) 985 if (lock_)
981 lock_->AssertAcquired(); 986 lock_->AssertAcquired();
982 #endif 987 #endif
983 } 988 }
984 989
985 } // namespace internal 990 } // namespace internal
986 } // namespace mojo 991 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698