webrtc/api/task_queue/task_queue_impl.cc
Danil Chapovalov b4c6d1e6d9 Connect global task queue factory and rtc::TaskQueue
This cl allows to overwrite TaskQueue implementation
by depending on and setting the global task queue factory.

Bug: webrtc:10191
Change-Id: I69ceb139d00078d3be90eeb4e240758b88829c20
Reviewed-on: https://webrtc-review.googlesource.com/c/118060
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26345}
2019-01-21 16:08:31 +00:00

31 lines
1 KiB
C++

/*
* Copyright 2019 The WebRTC Project Authors. All rights reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "api/task_queue/task_queue_impl.h"
#include "rtc_base/checks.h"
namespace rtc {
// Fake ref counting: implementers of the TaskQueueBase shouldn't expect it is
// stored in a refererence counter pointer.
void TaskQueue::Impl::AddRef() {
// AddRef should be called exactly once by rtc::TaskQueue constructor when
// raw pointer converted into scoped_refptr<Impl>,
// just before TaskQueue constructor assign task_queue_ member.
RTC_CHECK(task_queue_ == nullptr);
}
void TaskQueue::Impl::Release() {
// TaskQueue destructor manually destroyes this object, thus Release should
// never be called.
RTC_CHECK(false);
}
} // namespace rtc