Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(189)

Side by Side Diff: webrtc/rtc_base/messagequeue.h

Issue 2968753002: Support re-entrant calls to MessageQueueManager::Clear. (Closed)
Patch Set: Also Post inner handler to verify re-entrant clearing in the message queue works. Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/rtc_base/messagequeue.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_ GUARDED_BY(crit_); 71 std::vector<MessageQueue*> message_queues_ GUARDED_BY(crit_);
72 72
73 // Acquire this with DebugNonReentrantCritScope. 73 // Methods that don't modify the list of message queues may be called in a
74 // re-entrant fashion. "processing_" keeps track of the depth of re-entrant
75 // calls.
74 CriticalSection crit_; 76 CriticalSection crit_;
75 bool locked_ GUARDED_BY(crit_); 77 size_t processing_ GUARDED_BY(crit_);
76 }; 78 };
77 79
78 // Derive from this for specialized data 80 // Derive from this for specialized data
79 // App manages lifetime, except when messages are purged 81 // App manages lifetime, except when messages are purged
80 82
81 class MessageData { 83 class MessageData {
82 public: 84 public:
83 MessageData() {} 85 MessageData() {}
84 virtual ~MessageData() {} 86 virtual ~MessageData() {}
85 }; 87 };
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 SocketServer* const ss_; 353 SocketServer* const ss_;
352 // Used if SocketServer ownership lies with |this|. 354 // Used if SocketServer ownership lies with |this|.
353 std::unique_ptr<SocketServer> own_ss_; 355 std::unique_ptr<SocketServer> own_ss_;
354 356
355 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(MessageQueue); 357 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(MessageQueue);
356 }; 358 };
357 359
358 } // namespace rtc 360 } // namespace rtc
359 361
360 #endif // WEBRTC_RTC_BASE_MESSAGEQUEUE_H_ 362 #endif // WEBRTC_RTC_BASE_MESSAGEQUEUE_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/rtc_base/messagequeue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698