Commit 8c422776 authored by Robert Liao's avatar Robert Liao Committed by Commit Bot

Initialize an MTA on the Device Polling Thread

The change explicitly initializes a COM MTA on the device polling
thread. Previously, an COM implicitly initialized an MTA on the first
CoCreateInstance call.

BUG=734706

Change-Id: I64e70f06b2e82520419ce74e3bc2db396896af4c
Reviewed-on: https://chromium-review.googlesource.com/544685Reviewed-by: default avatarTim Volodine <timvolodine@chromium.org>
Commit-Queue: Robert Liao <robliao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#481942}
parent e13b5cad
......@@ -15,6 +15,7 @@
#include "base/stl_util.h"
#include "base/threading/thread.h"
#include "base/timer/timer.h"
#include "build/build_config.h"
#include "device/sensors/public/cpp/device_motion_hardware_buffer.h"
#include "device/sensors/public/cpp/device_orientation_hardware_buffer.h"
......@@ -193,6 +194,10 @@ bool DataFetcherSharedMemoryBase::InitAndStartPollingThreadIfNecessary() {
polling_thread_.reset(new PollingThread("Device Sensor poller", this));
#if defined(OS_WIN)
polling_thread_->init_com_with_mta(true);
#endif
if (!polling_thread_->Start()) {
LOG(ERROR) << "Failed to start sensor data polling thread";
return false;
......
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