| 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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 Dispatcher(); | 254 Dispatcher(); |
| 255 virtual ~Dispatcher(); | 255 virtual ~Dispatcher(); |
| 256 | 256 |
| 257 // These are to be overridden by subclasses (if necessary). They are called | 257 // These are to be overridden by subclasses (if necessary). They are called |
| 258 // exactly once (first |CancelAllAwakablesNoLock()|, then |CloseImplNoLock()|) | 258 // exactly once (first |CancelAllAwakablesNoLock()|, then |CloseImplNoLock()|) |
| 259 // when the dispatcher is being closed. | 259 // when the dispatcher is being closed. |
| 260 virtual void CancelAllAwakablesNoLock() MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_); | 260 virtual void CancelAllAwakablesNoLock() MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_); |
| 261 virtual void CloseImplNoLock() MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_); | 261 virtual void CloseImplNoLock() MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_); |
| 262 | 262 |
| 263 // This is called by |CreateEquivalentDispatcherAndCloseNoLock()|. It should | 263 // This is called by |CreateEquivalentDispatcherAndCloseNoLock()|. It should |
| 264 // produce "close" this dispatcher and return a new one equivalent to it. | 264 // "close" this dispatcher and return a new one equivalent to it. Note: |
| 265 // Note: Probably the first thing an implementation should do is call | 265 // Probably the first thing an implementation should do is call |
| 266 // |CancelAllAwakablesNoLock()| (or equivalent); unlike |CloseNoLock()|, | 266 // |CancelAllAwakablesNoLock()| (or equivalent); unlike |CloseNoLock()|, |
| 267 // |CreateEquivalentDispatcherAndCloseNoLock()| does not do this | 267 // |CreateEquivalentDispatcherAndCloseNoLock()| does not do this |
| 268 // automatically. | 268 // automatically. |
| 269 virtual util::RefPtr<Dispatcher> CreateEquivalentDispatcherAndCloseImplNoLock( | 269 virtual util::RefPtr<Dispatcher> CreateEquivalentDispatcherAndCloseImplNoLock( |
| 270 MessagePipe* message_pipe, | 270 MessagePipe* message_pipe, |
| 271 unsigned port) MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_) = 0; | 271 unsigned port) MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_) = 0; |
| 272 | 272 |
| 273 // These are to be overridden by subclasses (if necessary). They are never | 273 // These are to be overridden by subclasses (if necessary). They are never |
| 274 // called after the dispatcher has been closed. See the descriptions of the | 274 // called after the dispatcher has been closed. See the descriptions of the |
| 275 // methods without the "ImplNoLock" for more information. | 275 // methods without the "ImplNoLock" for more information. |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 | 483 |
| 484 // So logging macros and |DCHECK_EQ()|, etc. work. | 484 // So logging macros and |DCHECK_EQ()|, etc. work. |
| 485 inline std::ostream& operator<<(std::ostream& out, Dispatcher::Type type) { | 485 inline std::ostream& operator<<(std::ostream& out, Dispatcher::Type type) { |
| 486 return out << static_cast<int>(type); | 486 return out << static_cast<int>(type); |
| 487 } | 487 } |
| 488 | 488 |
| 489 } // namespace system | 489 } // namespace system |
| 490 } // namespace mojo | 490 } // namespace mojo |
| 491 | 491 |
| 492 #endif // MOJO_EDK_SYSTEM_DISPATCHER_H_ | 492 #endif // MOJO_EDK_SYSTEM_DISPATCHER_H_ |
| OLD | NEW |