| 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/lib/multiplex_router.h" | 5 #include "mojo/public/cpp/bindings/lib/multiplex_router.h" |
| 6 | 6 |
| 7 #include <utility> |
| 8 |
| 7 #include "base/bind.h" | 9 #include "base/bind.h" |
| 8 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| 9 #include "base/stl_util.h" | 11 #include "base/stl_util.h" |
| 10 #include "mojo/public/cpp/bindings/associated_group.h" | 12 #include "mojo/public/cpp/bindings/associated_group.h" |
| 11 #include "mojo/public/cpp/bindings/lib/interface_endpoint_client.h" | 13 #include "mojo/public/cpp/bindings/lib/interface_endpoint_client.h" |
| 12 | 14 |
| 13 namespace mojo { | 15 namespace mojo { |
| 14 namespace internal { | 16 namespace internal { |
| 15 | 17 |
| 16 // InterfaceEndpoint stores the information of an interface endpoint registered | 18 // InterfaceEndpoint stores the information of an interface endpoint registered |
| (...skipping 25 matching lines...) Expand all Loading... |
| 42 router_lock_->AssertAcquired(); | 44 router_lock_->AssertAcquired(); |
| 43 peer_closed_ = true; | 45 peer_closed_ = true; |
| 44 } | 46 } |
| 45 | 47 |
| 46 const scoped_refptr<base::SingleThreadTaskRunner> task_runner() const { | 48 const scoped_refptr<base::SingleThreadTaskRunner> task_runner() const { |
| 47 return task_runner_; | 49 return task_runner_; |
| 48 } | 50 } |
| 49 void set_task_runner( | 51 void set_task_runner( |
| 50 scoped_refptr<base::SingleThreadTaskRunner> task_runner) { | 52 scoped_refptr<base::SingleThreadTaskRunner> task_runner) { |
| 51 router_lock_->AssertAcquired(); | 53 router_lock_->AssertAcquired(); |
| 52 task_runner_ = task_runner.Pass(); | 54 task_runner_ = std::move(task_runner); |
| 53 } | 55 } |
| 54 | 56 |
| 55 InterfaceEndpointClient* client() const { return client_; } | 57 InterfaceEndpointClient* client() const { return client_; } |
| 56 void set_client(InterfaceEndpointClient* client) { | 58 void set_client(InterfaceEndpointClient* client) { |
| 57 router_lock_->AssertAcquired(); | 59 router_lock_->AssertAcquired(); |
| 58 client_ = client; | 60 client_ = client; |
| 59 } | 61 } |
| 60 | 62 |
| 61 private: | 63 private: |
| 62 friend class base::RefCounted<InterfaceEndpoint>; | 64 friend class base::RefCounted<InterfaceEndpoint>; |
| (...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 522 } | 524 } |
| 523 | 525 |
| 524 void MultiplexRouter::RaiseErrorInNonTestingMode() { | 526 void MultiplexRouter::RaiseErrorInNonTestingMode() { |
| 525 lock_.AssertAcquired(); | 527 lock_.AssertAcquired(); |
| 526 if (!testing_mode_) | 528 if (!testing_mode_) |
| 527 RaiseError(); | 529 RaiseError(); |
| 528 } | 530 } |
| 529 | 531 |
| 530 } // namespace internal | 532 } // namespace internal |
| 531 } // namespace mojo | 533 } // namespace mojo |
| OLD | NEW |