Prepare for deletion of the NO_MAIN_THREAD_WRAPPING preprocessor define

This is a partial reland of
https://webrtc-review.googlesource.com/c/src/+/39680,
including only the (hopefully) non-problematic parts of it, but
postponing actual deletion of automatic thread wrapping.

Bug: webrtc:9714
Change-Id: I9b79dd073f0e945cbb62f3b54cff05eaaea9b06c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/141664
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28265}
This commit is contained in:
Niels Möller
2019-06-12 11:30:59 +02:00
committed by Commit Bot
parent 50dd80b96f
commit 5a8f860a01
5 changed files with 21 additions and 24 deletions

View File

@ -121,20 +121,6 @@ TEST_F(MessageQueueTest, DiposeHandlerWithPostedMessagePending) {
EXPECT_TRUE(deleted);
}
struct UnwrapMainThreadScope {
UnwrapMainThreadScope() : rewrap_(Thread::Current() != nullptr) {
if (rewrap_)
ThreadManager::Instance()->UnwrapCurrentThread();
}
~UnwrapMainThreadScope() {
if (rewrap_)
ThreadManager::Instance()->WrapCurrentThread();
}
private:
bool rewrap_;
};
// Ensure that ProcessAllMessageQueues does its essential function; process
// all messages (both delayed and non delayed) up until the current time, on
// all registered message queues.