| 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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 virtual MojoResult DuplicateDispatcherImplNoLock( | 274 virtual MojoResult DuplicateDispatcherImplNoLock( |
| 275 util::RefPtr<Dispatcher>* new_dispatcher) | 275 util::RefPtr<Dispatcher>* new_dispatcher) |
| 276 MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_); | 276 MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_); |
| 277 | 277 |
| 278 // This is called by |CreateEquivalentDispatcherAndCloseNoLock()|. It should | 278 // This is called by |CreateEquivalentDispatcherAndCloseNoLock()|. It should |
| 279 // "close" this dispatcher and return a new one equivalent to it. Note: | 279 // "close" this dispatcher and return a new one equivalent to it. Note: |
| 280 // Probably the first thing an implementation should do is call | 280 // Probably the first thing an implementation should do is call |
| 281 // |CancelAllStateNoLock()| (or equivalent); unlike |CloseNoLock()|, | 281 // |CancelAllStateNoLock()| (or equivalent); unlike |CloseNoLock()|, |
| 282 // |CreateEquivalentDispatcherAndCloseNoLock()| does not do this | 282 // |CreateEquivalentDispatcherAndCloseNoLock()| does not do this |
| 283 // automatically. | 283 // automatically. |
| 284 // |
| 285 // If the new dispatcher will be enqueued on a message pipe, then |
| 286 // |message_pipe|/|port| will be provided (since there may be some |
| 287 // special-casing necessary due to locking considerations); otherwise, |
| 288 // |message_pipe| will be null (and |port| will be meaningless). |
| 284 virtual util::RefPtr<Dispatcher> CreateEquivalentDispatcherAndCloseImplNoLock( | 289 virtual util::RefPtr<Dispatcher> CreateEquivalentDispatcherAndCloseImplNoLock( |
| 285 MessagePipe* message_pipe, | 290 MessagePipe* message_pipe, |
| 286 unsigned port) MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_) = 0; | 291 unsigned port) MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_) = 0; |
| 287 | 292 |
| 288 // These are to be overridden by subclasses (if necessary). They are never | 293 // These are to be overridden by subclasses (if necessary). They are never |
| 289 // called after the dispatcher has been closed. See the descriptions of the | 294 // called after the dispatcher has been closed. See the descriptions of the |
| 290 // methods without the "ImplNoLock" for more information. | 295 // methods without the "ImplNoLock" for more information. |
| 291 virtual MojoResult WriteMessageImplNoLock( | 296 virtual MojoResult WriteMessageImplNoLock( |
| 292 UserPointer<const void> bytes, | 297 UserPointer<const void> bytes, |
| 293 uint32_t num_bytes, | 298 uint32_t num_bytes, |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 | 460 |
| 456 // So logging macros and |DCHECK_EQ()|, etc. work. | 461 // So logging macros and |DCHECK_EQ()|, etc. work. |
| 457 inline std::ostream& operator<<(std::ostream& out, Dispatcher::Type type) { | 462 inline std::ostream& operator<<(std::ostream& out, Dispatcher::Type type) { |
| 458 return out << static_cast<int>(type); | 463 return out << static_cast<int>(type); |
| 459 } | 464 } |
| 460 | 465 |
| 461 } // namespace system | 466 } // namespace system |
| 462 } // namespace mojo | 467 } // namespace mojo |
| 463 | 468 |
| 464 #endif // MOJO_EDK_SYSTEM_DISPATCHER_H_ | 469 #endif // MOJO_EDK_SYSTEM_DISPATCHER_H_ |
| OLD | NEW |