| 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 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 size_t* max_size, | 373 size_t* max_size, |
| 374 size_t* max_platform_handles) | 374 size_t* max_platform_handles) |
| 375 MOJO_NOT_THREAD_SAFE; | 375 MOJO_NOT_THREAD_SAFE; |
| 376 virtual bool EndSerializeAndCloseImplNoLock( | 376 virtual bool EndSerializeAndCloseImplNoLock( |
| 377 Channel* channel, | 377 Channel* channel, |
| 378 void* destination, | 378 void* destination, |
| 379 size_t* actual_size, | 379 size_t* actual_size, |
| 380 std::vector<platform::ScopedPlatformHandle>* platform_handles) | 380 std::vector<platform::ScopedPlatformHandle>* platform_handles) |
| 381 MOJO_NOT_THREAD_SAFE; | 381 MOJO_NOT_THREAD_SAFE; |
| 382 | 382 |
| 383 // This should be overridden to return true if/when there's an ongoing | |
| 384 // operation (e.g., two-phase read/writes on data pipes) that should prevent a | |
| 385 // handle from being sent over a message pipe (with status "busy"). | |
| 386 virtual bool IsBusyNoLock() const MOJO_SHARED_LOCKS_REQUIRED(mutex_); | |
| 387 | |
| 388 util::Mutex& mutex() const MOJO_LOCK_RETURNED(mutex_) { return mutex_; } | 383 util::Mutex& mutex() const MOJO_LOCK_RETURNED(mutex_) { return mutex_; } |
| 389 | 384 |
| 390 private: | 385 private: |
| 391 FRIEND_REF_COUNTED_THREAD_SAFE(Dispatcher); | 386 FRIEND_REF_COUNTED_THREAD_SAFE(Dispatcher); |
| 392 friend class HandleTransport; | 387 friend class HandleTransport; |
| 393 | 388 |
| 394 // Closes the dispatcher. This must be done under lock, and unlike |Close()|, | 389 // Closes the dispatcher. This must be done under lock, and unlike |Close()|, |
| 395 // the dispatcher must not be closed already. (This is the "equivalent" of | 390 // the dispatcher must not be closed already. (This is the "equivalent" of |
| 396 // |CreateEquivalentDispatcherAndCloseNoLock()|, for situations where the | 391 // |CreateEquivalentDispatcherAndCloseNoLock()|, for situations where the |
| 397 // dispatcher must be disposed of instead of "transferred".) | 392 // dispatcher must be disposed of instead of "transferred".) |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 | 455 |
| 461 // So logging macros and |DCHECK_EQ()|, etc. work. | 456 // So logging macros and |DCHECK_EQ()|, etc. work. |
| 462 inline std::ostream& operator<<(std::ostream& out, Dispatcher::Type type) { | 457 inline std::ostream& operator<<(std::ostream& out, Dispatcher::Type type) { |
| 463 return out << static_cast<int>(type); | 458 return out << static_cast<int>(type); |
| 464 } | 459 } |
| 465 | 460 |
| 466 } // namespace system | 461 } // namespace system |
| 467 } // namespace mojo | 462 } // namespace mojo |
| 468 | 463 |
| 469 #endif // MOJO_EDK_SYSTEM_DISPATCHER_H_ | 464 #endif // MOJO_EDK_SYSTEM_DISPATCHER_H_ |
| OLD | NEW |