blob: 0024085093f5fa6f89bd9894b3645bfb8d2e01b7 [file] [log] [blame]
Danil Chapovalovb4c6d1e2019-01-21 13:52:59 +01001/*
2 * Copyright 2019 The WebRTC Project Authors. All rights reserved.
3 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10#include "api/task_queue/task_queue_impl.h"
11
12#include "rtc_base/checks.h"
13
14namespace rtc {
15
16// Fake ref counting: implementers of the TaskQueueBase shouldn't expect it is
17// stored in a refererence counter pointer.
18void TaskQueue::Impl::AddRef() {
19 // AddRef should be called exactly once by rtc::TaskQueue constructor when
20 // raw pointer converted into scoped_refptr<Impl>,
21 // just before TaskQueue constructor assign task_queue_ member.
22 RTC_CHECK(task_queue_ == nullptr);
23}
24
25void TaskQueue::Impl::Release() {
26 // TaskQueue destructor manually destroyes this object, thus Release should
27 // never be called.
28 RTC_CHECK(false);
29}
30
31} // namespace rtc