| 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 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 PLATFORM_HANDLE = -1, | 62 PLATFORM_HANDLE = -1, |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 // All Dispatchers must minimally implement these methods. | 65 // All Dispatchers must minimally implement these methods. |
| 66 | 66 |
| 67 virtual Type GetType() const = 0; | 67 virtual Type GetType() const = 0; |
| 68 virtual MojoResult Close() = 0; | 68 virtual MojoResult Close() = 0; |
| 69 | 69 |
| 70 ///////////// Watch API //////////////////// | 70 ///////////// Watch API //////////////////// |
| 71 | 71 |
| 72 virtual MojoResult Watch(MojoHandleSignals signals, | 72 virtual MojoResult RegisterWatcher(MojoHandleSignals signals, |
| 73 const Watcher::WatchCallback& callback, | 73 const Watcher::WatchCallback& callback, |
| 74 uintptr_t context); | 74 uintptr_t context); |
| 75 | 75 virtual MojoResult ArmWatcher(uintptr_t context); |
| 76 virtual MojoResult CancelWatch(uintptr_t context); | 76 virtual MojoResult UnregisterWatcher(uintptr_t context); |
| 77 | 77 |
| 78 ///////////// Message pipe API ///////////// | 78 ///////////// Message pipe API ///////////// |
| 79 | 79 |
| 80 virtual MojoResult WriteMessage(std::unique_ptr<MessageForTransit> message, | 80 virtual MojoResult WriteMessage(std::unique_ptr<MessageForTransit> message, |
| 81 MojoWriteMessageFlags flags); | 81 MojoWriteMessageFlags flags); |
| 82 | 82 |
| 83 virtual MojoResult ReadMessage(std::unique_ptr<MessageForTransit>* message, | 83 virtual MojoResult ReadMessage(std::unique_ptr<MessageForTransit>* message, |
| 84 uint32_t* num_bytes, | 84 uint32_t* num_bytes, |
| 85 MojoHandle* handles, | 85 MojoHandle* handles, |
| 86 uint32_t* num_handles, | 86 uint32_t* num_handles, |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 // So logging macros and |DCHECK_EQ()|, etc. work. | 249 // So logging macros and |DCHECK_EQ()|, etc. work. |
| 250 MOJO_SYSTEM_IMPL_EXPORT inline std::ostream& operator<<(std::ostream& out, | 250 MOJO_SYSTEM_IMPL_EXPORT inline std::ostream& operator<<(std::ostream& out, |
| 251 Dispatcher::Type type) { | 251 Dispatcher::Type type) { |
| 252 return out << static_cast<int>(type); | 252 return out << static_cast<int>(type); |
| 253 } | 253 } |
| 254 | 254 |
| 255 } // namespace edk | 255 } // namespace edk |
| 256 } // namespace mojo | 256 } // namespace mojo |
| 257 | 257 |
| 258 #endif // MOJO_EDK_SYSTEM_DISPATCHER_H_ | 258 #endif // MOJO_EDK_SYSTEM_DISPATCHER_H_ |
| OLD | NEW |