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

Side by Side Diff: device/generic_sensor/platform_sensor_reader_win.cc

Issue 2824773002: Rename ScopedComPtr::get() to ScopedComPtr::Get() (Closed)
Patch Set: Update to 5293966 Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "device/generic_sensor/platform_sensor_reader_win.h" 5 #include "device/generic_sensor/platform_sensor_reader_win.h"
6 6
7 #include <Sensors.h> 7 #include <Sensors.h>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 base::win::ScopedComPtr<IPortableDeviceValues> props; 432 base::win::ScopedComPtr<IPortableDeviceValues> props;
433 if (SUCCEEDED(props.CreateInstance(CLSID_PortableDeviceValues))) { 433 if (SUCCEEDED(props.CreateInstance(CLSID_PortableDeviceValues))) {
434 unsigned interval = 434 unsigned interval =
435 (1 / configuration.frequency()) * base::Time::kMillisecondsPerSecond; 435 (1 / configuration.frequency()) * base::Time::kMillisecondsPerSecond;
436 436
437 HRESULT hr = props->SetUnsignedIntegerValue( 437 HRESULT hr = props->SetUnsignedIntegerValue(
438 SENSOR_PROPERTY_CURRENT_REPORT_INTERVAL, interval); 438 SENSOR_PROPERTY_CURRENT_REPORT_INTERVAL, interval);
439 439
440 if (SUCCEEDED(hr)) { 440 if (SUCCEEDED(hr)) {
441 base::win::ScopedComPtr<IPortableDeviceValues> return_props; 441 base::win::ScopedComPtr<IPortableDeviceValues> return_props;
442 hr = sensor_->SetProperties(props.get(), return_props.Receive()); 442 hr = sensor_->SetProperties(props.Get(), return_props.Receive());
443 return SUCCEEDED(hr); 443 return SUCCEEDED(hr);
444 } 444 }
445 } 445 }
446 return false; 446 return false;
447 } 447 }
448 448
449 HRESULT PlatformSensorReaderWin::SensorReadingChanged( 449 HRESULT PlatformSensorReaderWin::SensorReadingChanged(
450 ISensorDataReport& report, 450 ISensorDataReport& report,
451 SensorReading& reading) const { 451 SensorReading& reading) const {
452 if (!client_) 452 if (!client_)
453 return E_FAIL; 453 return E_FAIL;
454 454
455 HRESULT hr = init_params_->reader_func.Run(report, reading); 455 HRESULT hr = init_params_->reader_func.Run(report, reading);
456 if (SUCCEEDED(hr)) 456 if (SUCCEEDED(hr))
457 client_->OnReadingUpdated(reading); 457 client_->OnReadingUpdated(reading);
458 return hr; 458 return hr;
459 } 459 }
460 460
461 void PlatformSensorReaderWin::SensorError() { 461 void PlatformSensorReaderWin::SensorError() {
462 if (client_) 462 if (client_)
463 client_->OnSensorError(); 463 client_->OnSensorError();
464 } 464 }
465 465
466 unsigned long PlatformSensorReaderWin::GetMinimalReportingIntervalMs() const { 466 unsigned long PlatformSensorReaderWin::GetMinimalReportingIntervalMs() const {
467 return init_params_->min_reporting_interval_ms; 467 return init_params_->min_reporting_interval_ms;
468 } 468 }
469 469
470 } // namespace device 470 } // namespace device
OLDNEW
« no previous file with comments | « device/generic_sensor/platform_sensor_and_provider_unittest_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