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

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

Issue 2792383003: Rename ScopedComPtr::Release() to ScopedComPtr::Reset() (Closed)
Patch Set: Fix New Callers 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_provider_win.h" 5 #include "device/generic_sensor/platform_sensor_provider_win.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/memory/singleton.h" 8 #include "base/memory/singleton.h"
9 #include "base/task_runner_util.h" 9 #include "base/task_runner_util.h"
10 #include "base/threading/thread.h" 10 #include "base/threading/thread.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 sensor_thread_->init_com_with_mta(true); 64 sensor_thread_->init_com_with_mta(true);
65 } 65 }
66 66
67 if (!sensor_thread_->IsRunning()) 67 if (!sensor_thread_->IsRunning())
68 return sensor_thread_->Start(); 68 return sensor_thread_->Start();
69 return true; 69 return true;
70 } 70 }
71 71
72 void PlatformSensorProviderWin::StopSensorThread() { 72 void PlatformSensorProviderWin::StopSensorThread() {
73 if (sensor_thread_ && sensor_thread_->IsRunning()) { 73 if (sensor_thread_ && sensor_thread_->IsRunning()) {
74 sensor_manager_.Release(); 74 sensor_manager_.Reset();
75 sensor_thread_->Stop(); 75 sensor_thread_->Stop();
76 } 76 }
77 } 77 }
78 78
79 void PlatformSensorProviderWin::SensorReaderCreated( 79 void PlatformSensorProviderWin::SensorReaderCreated(
80 mojom::SensorType type, 80 mojom::SensorType type,
81 mojo::ScopedSharedBufferMapping mapping, 81 mojo::ScopedSharedBufferMapping mapping,
82 const CreateSensorCallback& callback, 82 const CreateSensorCallback& callback,
83 std::unique_ptr<PlatformSensorReaderWin> sensor_reader) { 83 std::unique_ptr<PlatformSensorReaderWin> sensor_reader) {
84 DCHECK(CalledOnValidThread()); 84 DCHECK(CalledOnValidThread());
(...skipping 12 matching lines...) Expand all
97 97
98 std::unique_ptr<PlatformSensorReaderWin> 98 std::unique_ptr<PlatformSensorReaderWin>
99 PlatformSensorProviderWin::CreateSensorReader(mojom::SensorType type) { 99 PlatformSensorProviderWin::CreateSensorReader(mojom::SensorType type) {
100 DCHECK(sensor_thread_->task_runner()->BelongsToCurrentThread()); 100 DCHECK(sensor_thread_->task_runner()->BelongsToCurrentThread());
101 if (!InitializeSensorManager()) 101 if (!InitializeSensorManager())
102 return nullptr; 102 return nullptr;
103 return PlatformSensorReaderWin::Create(type, sensor_manager_); 103 return PlatformSensorReaderWin::Create(type, sensor_manager_);
104 } 104 }
105 105
106 } // namespace device 106 } // 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