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

Unified Diff: webrtc/base/sequenced_task_checker_impl.cc

Issue 2464383002: Use queue label as id in SequencedTaskChecker when not running on TaskQueue (Closed)
Patch Set: Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/base/sequenced_task_checker_impl.cc
diff --git a/webrtc/base/sequenced_task_checker_impl.cc b/webrtc/base/sequenced_task_checker_impl.cc
index 615f44c2b52e8562c182159748b418c4b40729ce..3e28ea171b7ba7dc6418584bdc149b99abf4dec9 100644
--- a/webrtc/base/sequenced_task_checker_impl.cc
+++ b/webrtc/base/sequenced_task_checker_impl.cc
@@ -22,7 +22,13 @@ SequencedTaskCheckerImpl::SequencedTaskCheckerImpl()
SequencedTaskCheckerImpl::~SequencedTaskCheckerImpl() {}
bool SequencedTaskCheckerImpl::CalledSequentially() const {
- TaskQueue* current_queue = TaskQueue::Current();
+ QueueId current_queue = TaskQueue::Current();
+#if defined(WEBRTC_MAC)
+ if (current_queue == nullptr)
+ // If we're not running on a TaskQueue, use the system dispatch queue
magjed_webrtc 2016/11/02 12:04:41 nit: I would like the comments above the if-statem
tommi 2016/11/02 16:32:50 agree. style comment: as is, this should use {} si
kthelgason 2016/11/02 16:53:55 Done.
+ // label as an identifier.
+ current_queue = dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL);
magjed_webrtc 2016/11/02 12:04:41 We don't need any include for this magical dispatc
tommi 2016/11/02 16:32:50 good point. We need #include <dispatch/dispatch.h
kthelgason 2016/11/02 16:53:55 Done.
+#endif
CritScope scoped_lock(&lock_);
if (!attached_) { // true if previously detached.
valid_queue_ = current_queue;
« webrtc/base/sequenced_task_checker_impl.h ('K') | « webrtc/base/sequenced_task_checker_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698