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/edk/system/master_connection_manager.h" | 5 #include "mojo/edk/system/master_connection_manager.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <unordered_map> | 8 #include <unordered_map> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/bind_helpers.h" | 12 #include "base/bind_helpers.h" |
13 #include "base/location.h" | 13 #include "base/location.h" |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/message_loop/message_loop.h" | 15 #include "base/message_loop/message_loop.h" |
16 #include "mojo/edk/embedder/master_process_delegate.h" | 16 #include "mojo/edk/embedder/master_process_delegate.h" |
17 #include "mojo/edk/embedder/platform_channel_pair.h" | 17 #include "mojo/edk/embedder/platform_channel_pair.h" |
18 #include "mojo/edk/embedder/platform_handle.h" | 18 #include "mojo/edk/embedder/platform_handle.h" |
19 #include "mojo/edk/embedder/platform_handle_vector.h" | 19 #include "mojo/edk/embedder/platform_handle_vector.h" |
20 #include "mojo/edk/system/connection_manager_messages.h" | 20 #include "mojo/edk/system/connection_manager_messages.h" |
21 #include "mojo/edk/system/message_in_transit.h" | 21 #include "mojo/edk/system/message_in_transit.h" |
22 #include "mojo/edk/system/raw_channel.h" | 22 #include "mojo/edk/system/raw_channel.h" |
23 #include "mojo/edk/system/transport_data.h" | 23 #include "mojo/edk/system/transport_data.h" |
24 #include "mojo/edk/system/waitable_event.h" | |
25 #include "mojo/edk/util/make_unique.h" | 24 #include "mojo/edk/util/make_unique.h" |
| 25 #include "mojo/edk/util/waitable_event.h" |
26 #include "mojo/public/cpp/system/macros.h" | 26 #include "mojo/public/cpp/system/macros.h" |
27 | 27 |
| 28 using mojo::util::AutoResetWaitableEvent; |
28 using mojo::util::MutexLocker; | 29 using mojo::util::MutexLocker; |
29 | 30 |
30 namespace mojo { | 31 namespace mojo { |
31 namespace system { | 32 namespace system { |
32 | 33 |
33 namespace { | 34 namespace { |
34 | 35 |
35 const ProcessIdentifier kFirstSlaveProcessIdentifier = 2; | 36 const ProcessIdentifier kFirstSlaveProcessIdentifier = 2; |
36 | 37 |
37 static_assert(kMasterProcessIdentifier != kInvalidProcessIdentifier, | 38 static_assert(kMasterProcessIdentifier != kInvalidProcessIdentifier, |
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
740 } | 741 } |
741 | 742 |
742 void MasterConnectionManager::AssertOnPrivateThread() const { | 743 void MasterConnectionManager::AssertOnPrivateThread() const { |
743 // This should only be called after |Init()| and before |Shutdown()|. | 744 // This should only be called after |Init()| and before |Shutdown()|. |
744 DCHECK(private_thread_.message_loop()); | 745 DCHECK(private_thread_.message_loop()); |
745 DCHECK_EQ(base::MessageLoop::current(), private_thread_.message_loop()); | 746 DCHECK_EQ(base::MessageLoop::current(), private_thread_.message_loop()); |
746 } | 747 } |
747 | 748 |
748 } // namespace system | 749 } // namespace system |
749 } // namespace mojo | 750 } // namespace mojo |
OLD | NEW |