Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1057)

Unified Diff: device/generic_sensor/platform_sensor_reader_win.cc

Issue 2887243002: Remove ScopedComPtr::CreateInstance() (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: device/generic_sensor/platform_sensor_reader_win.cc
diff --git a/device/generic_sensor/platform_sensor_reader_win.cc b/device/generic_sensor/platform_sensor_reader_win.cc
index 89d7819053d3e1342522ff8cd0a0a10c5ac4d828..2a0f3761ad16722463fd5da95b9277f93206d32a 100644
--- a/device/generic_sensor/platform_sensor_reader_win.cc
+++ b/device/generic_sensor/platform_sensor_reader_win.cc
@@ -5,6 +5,7 @@
#include "device/generic_sensor/platform_sensor_reader_win.h"
#include <Sensors.h>
+#include <objbase.h>
#include "base/callback.h"
#include "base/memory/ptr_util.h"
@@ -430,7 +431,8 @@ void PlatformSensorReaderWin::ListenSensorEvent() {
bool PlatformSensorReaderWin::SetReportingInterval(
const PlatformSensorConfiguration& configuration) {
base::win::ScopedComPtr<IPortableDeviceValues> props;
- if (SUCCEEDED(props.CreateInstance(CLSID_PortableDeviceValues))) {
+ if (SUCCEEDED(::CoCreateInstance(CLSID_PortableDeviceValues, nullptr,
+ CLSCTX_ALL, IID_PPV_ARGS(&props)))) {
unsigned interval =
(1 / configuration.frequency()) * base::Time::kMillisecondsPerSecond;
« no previous file with comments | « device/generic_sensor/platform_sensor_provider_win.cc ('k') | device/sensors/data_fetcher_shared_memory_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698