Commit 0d942004 authored by Reilly Grant's avatar Reilly Grant Committed by Commit Bot

Fix crash in PlatformSensorReaderWin::SetReportingInterval

This is a follow-up to r537429 which fixes a crash introduced in
PlatformSensorReaderWin::SetReportingInterval because of a missing
return after logging the failure to instantiate an instance of
IPortableDeviceValues.

The log message is also tweaked to remove an extraneous space.

TBR=cco3@chromium.org

Bug: 756986
Change-Id: I5e07d365f93dc4d9df75d0ac743138ba3c7437ab
Reviewed-on: https://chromium-review.googlesource.com/924563Reviewed-by: default avatarReilly Grant <reillyg@chromium.org>
Commit-Queue: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537523}
parent c212d47a
...@@ -43,7 +43,7 @@ class PlatformSensorProviderWin::SensorThread final : public base::Thread { ...@@ -43,7 +43,7 @@ class PlatformSensorProviderWin::SensorThread final : public base::Thread {
static bool logged_failure = false; static bool logged_failure = false;
if (!logged_failure) { if (!logged_failure) {
LOG(ERROR) << "Unable to create instance of SensorManager: " LOG(ERROR) << "Unable to create instance of SensorManager: "
<< _com_error(hr).ErrorMessage() << " (0x " << std::hex << _com_error(hr).ErrorMessage() << " (0x" << std::hex
<< std::uppercase << std::setfill('0') << std::setw(8) << hr << std::uppercase << std::setfill('0') << std::setw(8) << hr
<< ")"; << ")";
logged_failure = true; logged_failure = true;
......
...@@ -463,11 +463,12 @@ bool PlatformSensorReaderWin::SetReportingInterval( ...@@ -463,11 +463,12 @@ bool PlatformSensorReaderWin::SetReportingInterval(
static bool logged_failure = false; static bool logged_failure = false;
if (!logged_failure) { if (!logged_failure) {
LOG(ERROR) << "Unable to create instance of PortableDeviceValues: " LOG(ERROR) << "Unable to create instance of PortableDeviceValues: "
<< _com_error(hr).ErrorMessage() << " (0x " << std::hex << _com_error(hr).ErrorMessage() << " (0x" << std::hex
<< std::uppercase << std::setfill('0') << std::setw(8) << hr << std::uppercase << std::setfill('0') << std::setw(8) << hr
<< ")"; << ")";
logged_failure = true; logged_failure = true;
} }
return false;
} }
unsigned interval = unsigned interval =
......
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