henrik.lundin@webrtc.org | 1e3c5c2 | 2014-06-16 11:34:44 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2014 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 | |
| 11 | // Borrowed from Chromium's src/base/threading/thread_checker.h. |
| 12 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 13 | #ifndef RTC_BASE_THREAD_CHECKER_H_ |
| 14 | #define RTC_BASE_THREAD_CHECKER_H_ |
henrik.lundin@webrtc.org | 1e3c5c2 | 2014-06-16 11:34:44 +0000 | [diff] [blame] | 15 | |
Sebastian Jansson | c01367d | 2019-04-08 15:20:44 +0200 | [diff] [blame^] | 16 | #include "rtc_base/deprecation.h" |
Sebastian Jansson | df5e4e0 | 2019-03-29 10:34:45 +0100 | [diff] [blame] | 17 | #include "rtc_base/synchronization/sequence_checker.h" |
Henrik Kjellander | ec78f1c | 2017-06-29 07:52:50 +0200 | [diff] [blame] | 18 | |
| 19 | namespace rtc { |
Sebastian Jansson | df5e4e0 | 2019-03-29 10:34:45 +0100 | [diff] [blame] | 20 | // TODO(srte): Replace usages of this with SequenceChecker. |
| 21 | class ThreadChecker : public webrtc::SequenceChecker { |
Henrik Kjellander | ec78f1c | 2017-06-29 07:52:50 +0200 | [diff] [blame] | 22 | public: |
Sebastian Jansson | c01367d | 2019-04-08 15:20:44 +0200 | [diff] [blame^] | 23 | RTC_DEPRECATED bool CalledOnValidThread() const { return IsCurrent(); } |
| 24 | RTC_DEPRECATED void DetachFromThread() { Detach(); } |
Henrik Kjellander | ec78f1c | 2017-06-29 07:52:50 +0200 | [diff] [blame] | 25 | }; |
Henrik Kjellander | ec78f1c | 2017-06-29 07:52:50 +0200 | [diff] [blame] | 26 | } // namespace rtc |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 27 | #endif // RTC_BASE_THREAD_CHECKER_H_ |