OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/browser/device_sensors/data_fetcher_shared_memory_base.h" | 5 #include "content/browser/device_sensors/data_fetcher_shared_memory_base.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <string.h> | 8 #include <string.h> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 } else { | 166 } else { |
167 if (!Stop(consumer_type)) | 167 if (!Stop(consumer_type)) |
168 return false; | 168 return false; |
169 } | 169 } |
170 | 170 |
171 started_consumers_ ^= consumer_type; | 171 started_consumers_ ^= consumer_type; |
172 | 172 |
173 return true; | 173 return true; |
174 } | 174 } |
175 | 175 |
176 void DataFetcherSharedMemoryBase::Shutdown() { | 176 void DataFetcherSharedMemoryBase::ShutDownOnUIThread() { |
177 StopFetchingDeviceData(CONSUMER_TYPE_MOTION); | 177 StopFetchingDeviceData(CONSUMER_TYPE_MOTION); |
178 StopFetchingDeviceData(CONSUMER_TYPE_ORIENTATION); | 178 StopFetchingDeviceData(CONSUMER_TYPE_ORIENTATION); |
179 StopFetchingDeviceData(CONSUMER_TYPE_ORIENTATION_ABSOLUTE); | 179 StopFetchingDeviceData(CONSUMER_TYPE_ORIENTATION_ABSOLUTE); |
180 StopFetchingDeviceData(CONSUMER_TYPE_LIGHT); | 180 StopFetchingDeviceData(CONSUMER_TYPE_LIGHT); |
181 } | 181 } |
182 | 182 |
183 mojo::ScopedSharedBufferHandle | 183 mojo::ScopedSharedBufferHandle |
184 DataFetcherSharedMemoryBase::GetSharedMemoryHandle(ConsumerType consumer_type) { | 184 DataFetcherSharedMemoryBase::GetSharedMemoryHandle(ConsumerType consumer_type) { |
185 auto it = shared_memory_map_.find(consumer_type); | 185 auto it = shared_memory_map_.find(consumer_type); |
186 DCHECK(it != shared_memory_map_.end()); | 186 DCHECK(it != shared_memory_map_.end()); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 | 237 |
238 base::MessageLoop* DataFetcherSharedMemoryBase::GetPollingMessageLoop() const { | 238 base::MessageLoop* DataFetcherSharedMemoryBase::GetPollingMessageLoop() const { |
239 return polling_thread_ ? polling_thread_->message_loop() : nullptr; | 239 return polling_thread_ ? polling_thread_->message_loop() : nullptr; |
240 } | 240 } |
241 | 241 |
242 bool DataFetcherSharedMemoryBase::IsPollingTimerRunningForTesting() const { | 242 bool DataFetcherSharedMemoryBase::IsPollingTimerRunningForTesting() const { |
243 return polling_thread_ ? polling_thread_->IsTimerRunning() : false; | 243 return polling_thread_ ? polling_thread_->IsTimerRunning() : false; |
244 } | 244 } |
245 | 245 |
246 } // namespace content | 246 } // namespace content |
OLD | NEW |