| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 MessageQueueManager(); | 61 MessageQueueManager(); |
| 62 ~MessageQueueManager(); | 62 ~MessageQueueManager(); |
| 63 | 63 |
| 64 void AddInternal(MessageQueue *message_queue); | 64 void AddInternal(MessageQueue *message_queue); |
| 65 void RemoveInternal(MessageQueue *message_queue); | 65 void RemoveInternal(MessageQueue *message_queue); |
| 66 void ClearInternal(MessageHandler *handler); | 66 void ClearInternal(MessageHandler *handler); |
| 67 void ProcessAllMessageQueuesInternal(); | 67 void ProcessAllMessageQueuesInternal(); |
| 68 | 68 |
| 69 static MessageQueueManager* instance_; | 69 static MessageQueueManager* instance_; |
| 70 // This list contains all live MessageQueues. | 70 // This list contains all live MessageQueues. |
| 71 std::vector<MessageQueue *> message_queues_; | 71 std::vector<MessageQueue*> message_queues_ GUARDED_BY(crit_); |
| 72 |
| 73 // Acquire this with DebugNonReentrantCritScope. |
| 72 CriticalSection crit_; | 74 CriticalSection crit_; |
| 75 bool locked_ GUARDED_BY(crit_); |
| 73 }; | 76 }; |
| 74 | 77 |
| 75 // Derive from this for specialized data | 78 // Derive from this for specialized data |
| 76 // App manages lifetime, except when messages are purged | 79 // App manages lifetime, except when messages are purged |
| 77 | 80 |
| 78 class MessageData { | 81 class MessageData { |
| 79 public: | 82 public: |
| 80 MessageData() {} | 83 MessageData() {} |
| 81 virtual ~MessageData() {} | 84 virtual ~MessageData() {} |
| 82 }; | 85 }; |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 // Used if SocketServer ownership lies with |this|. | 304 // Used if SocketServer ownership lies with |this|. |
| 302 std::unique_ptr<SocketServer> own_ss_; | 305 std::unique_ptr<SocketServer> own_ss_; |
| 303 SharedExclusiveLock ss_lock_; | 306 SharedExclusiveLock ss_lock_; |
| 304 | 307 |
| 305 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(MessageQueue); | 308 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(MessageQueue); |
| 306 }; | 309 }; |
| 307 | 310 |
| 308 } // namespace rtc | 311 } // namespace rtc |
| 309 | 312 |
| 310 #endif // WEBRTC_BASE_MESSAGEQUEUE_H_ | 313 #endif // WEBRTC_BASE_MESSAGEQUEUE_H_ |
| OLD | NEW |