OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef MOJO_EDK_SYSTEM_DISPATCHER_H_ | 5 #ifndef MOJO_EDK_SYSTEM_DISPATCHER_H_ |
6 #define MOJO_EDK_SYSTEM_DISPATCHER_H_ | 6 #define MOJO_EDK_SYSTEM_DISPATCHER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "base/synchronization/lock.h" | 16 #include "base/synchronization/lock.h" |
17 #include "mojo/edk/embedder/platform_handle.h" | |
18 #include "mojo/edk/embedder/platform_handle_vector.h" | 17 #include "mojo/edk/embedder/platform_handle_vector.h" |
19 #include "mojo/edk/system/handle_signals_state.h" | 18 #include "mojo/edk/system/handle_signals_state.h" |
20 #include "mojo/edk/system/memory.h" | 19 #include "mojo/edk/system/memory.h" |
21 #include "mojo/edk/system/system_impl_export.h" | 20 #include "mojo/edk/system/system_impl_export.h" |
22 #include "mojo/public/c/system/buffer.h" | 21 #include "mojo/public/c/system/buffer.h" |
23 #include "mojo/public/c/system/data_pipe.h" | 22 #include "mojo/public/c/system/data_pipe.h" |
24 #include "mojo/public/c/system/message_pipe.h" | 23 #include "mojo/public/c/system/message_pipe.h" |
25 #include "mojo/public/c/system/types.h" | 24 #include "mojo/public/c/system/types.h" |
26 | 25 |
27 namespace mojo { | 26 namespace mojo { |
(...skipping 13 matching lines...) Expand all Loading... |
41 class ProxyMessagePipeEndpoint; | 40 class ProxyMessagePipeEndpoint; |
42 class TransportData; | 41 class TransportData; |
43 class Waiter; | 42 class Waiter; |
44 | 43 |
45 typedef std::vector<scoped_refptr<Dispatcher>> DispatcherVector; | 44 typedef std::vector<scoped_refptr<Dispatcher>> DispatcherVector; |
46 | 45 |
47 namespace test { | 46 namespace test { |
48 | 47 |
49 // Test helper. We need to declare it here so we can friend it. | 48 // Test helper. We need to declare it here so we can friend it. |
50 MOJO_SYSTEM_IMPL_EXPORT DispatcherTransport | 49 MOJO_SYSTEM_IMPL_EXPORT DispatcherTransport |
51 DispatcherTryStartTransport(Dispatcher* dispatcher); | 50 DispatcherTryStartTransport(Dispatcher* dispatcher); |
52 | 51 |
53 } // namespace test | 52 } // namespace test |
54 | 53 |
55 // A |Dispatcher| implements Mojo primitives that are "attached" to a particular | 54 // A |Dispatcher| implements Mojo primitives that are "attached" to a particular |
56 // handle. This includes most (all?) primitives except for |MojoWait...()|. This | 55 // handle. This includes most (all?) primitives except for |MojoWait...()|. This |
57 // object is thread-safe, with its state being protected by a single lock | 56 // object is thread-safe, with its state being protected by a single lock |
58 // |lock_|, which is also made available to implementation subclasses (via the | 57 // |lock_|, which is also made available to implementation subclasses (via the |
59 // |lock()| method). | 58 // |lock()| method). |
60 class MOJO_SYSTEM_IMPL_EXPORT Dispatcher | 59 class MOJO_SYSTEM_IMPL_EXPORT Dispatcher |
61 : public base::RefCountedThreadSafe<Dispatcher> { | 60 : public base::RefCountedThreadSafe<Dispatcher> { |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 | 395 |
397 Dispatcher* dispatcher_; | 396 Dispatcher* dispatcher_; |
398 | 397 |
399 // Copy and assign allowed. | 398 // Copy and assign allowed. |
400 }; | 399 }; |
401 | 400 |
402 } // namespace system | 401 } // namespace system |
403 } // namespace mojo | 402 } // namespace mojo |
404 | 403 |
405 #endif // MOJO_EDK_SYSTEM_DISPATCHER_H_ | 404 #endif // MOJO_EDK_SYSTEM_DISPATCHER_H_ |
OLD | NEW |