Commit 13748e32 authored by Matthew Denton's avatar Matthew Denton Committed by Commit Bot

Fix ~InProcessUtilityThread DCHECK.

~InProcessUtilityThread calls Stop(), which calls
PlatformThread::Join().

So it needs to use ScopedAllowBaseSyncPrimitivesOutsideBlockingScope
instead of ThreadRestrictions::SetIOAllowed(true).

Change-Id: Idf729959a1a1d77902a623806560b1cc86299e6f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1637613Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Commit-Queue: Matthew Denton <mpdenton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#665038}
parent d386ebe6
......@@ -139,6 +139,7 @@ class CategorizedWorkerPool;
class DesktopCaptureDevice;
class DWriteFontLookupTableBuilder;
class GpuProcessTransportFactory;
class InProcessUtilityThread;
class NestedMessagePumpAndroid;
class RenderWidgetHostViewMac;
class RTCVideoDecoder;
......@@ -455,6 +456,7 @@ class BASE_EXPORT ScopedAllowBaseSyncPrimitivesOutsideBlockingScope {
friend class base::ScopedAllowThreadRecallForStackSamplingProfiler;
friend class base::StackSamplingProfiler;
friend class content::DesktopCaptureDevice;
friend class content::InProcessUtilityThread;
friend class content::RTCVideoDecoder;
friend class content::RTCVideoDecoderAdapter;
friend class content::RTCVideoEncoder;
......
......@@ -8,6 +8,7 @@
#include "base/lazy_instance.h"
#include "base/location.h"
#include "base/single_thread_task_runner.h"
#include "base/threading/thread_restrictions.h"
#include "base/threading/thread_task_runner_handle.h"
#include "content/child/child_process.h"
#include "content/utility/utility_thread_impl.h"
......@@ -21,14 +22,11 @@ static base::LazyInstance<base::Lock>::DestructorAtExit
InProcessUtilityThread::InProcessUtilityThread(
const InProcessChildThreadParams& params)
: Thread("Chrome_InProcUtilityThread"), params_(params) {
}
: Thread("Chrome_InProcUtilityThread"), params_(params) {}
InProcessUtilityThread::~InProcessUtilityThread() {
// Wait till in-process utility thread finishes clean up.
bool previous_value = base::ThreadRestrictions::SetIOAllowed(true);
base::ScopedAllowBaseSyncPrimitivesOutsideBlockingScope allow_thread_join;
Stop();
base::ThreadRestrictions::SetIOAllowed(previous_value);
}
void InProcessUtilityThread::Init() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment