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 "data_fetcher_shared_memory.h" | 5 #include "data_fetcher_shared_memory.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "third_party/sudden_motion_sensor/sudden_motion_sensor_mac.h" | 9 #include "third_party/sudden_motion_sensor/sudden_motion_sensor_mac.h" |
10 | 10 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 } | 88 } |
89 | 89 |
90 } // namespace | 90 } // namespace |
91 | 91 |
92 namespace content { | 92 namespace content { |
93 | 93 |
94 DataFetcherSharedMemory::DataFetcherSharedMemory() { | 94 DataFetcherSharedMemory::DataFetcherSharedMemory() { |
95 } | 95 } |
96 | 96 |
97 DataFetcherSharedMemory::~DataFetcherSharedMemory() { | 97 DataFetcherSharedMemory::~DataFetcherSharedMemory() { |
| 98 StopFetchingAllDeviceData(); |
98 } | 99 } |
99 | 100 |
100 void DataFetcherSharedMemory::Fetch(unsigned consumer_bitmask) { | 101 void DataFetcherSharedMemory::Fetch(unsigned consumer_bitmask) { |
101 DCHECK(base::MessageLoop::current() == GetPollingMessageLoop()); | 102 DCHECK(base::MessageLoop::current() == GetPollingMessageLoop()); |
102 DCHECK(sudden_motion_sensor_); | 103 DCHECK(sudden_motion_sensor_); |
103 DCHECK(consumer_bitmask & CONSUMER_TYPE_ORIENTATION || | 104 DCHECK(consumer_bitmask & CONSUMER_TYPE_ORIENTATION || |
104 consumer_bitmask & CONSUMER_TYPE_MOTION); | 105 consumer_bitmask & CONSUMER_TYPE_MOTION); |
105 | 106 |
106 if (consumer_bitmask & CONSUMER_TYPE_ORIENTATION) | 107 if (consumer_bitmask & CONSUMER_TYPE_ORIENTATION) |
107 FetchOrientation(sudden_motion_sensor_.get(), orientation_buffer_); | 108 FetchOrientation(sudden_motion_sensor_.get(), orientation_buffer_); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 orientation_buffer_ = NULL; | 178 orientation_buffer_ = NULL; |
178 } | 179 } |
179 return true; | 180 return true; |
180 default: | 181 default: |
181 NOTREACHED(); | 182 NOTREACHED(); |
182 } | 183 } |
183 return false; | 184 return false; |
184 } | 185 } |
185 | 186 |
186 } // namespace content | 187 } // namespace content |
OLD | NEW |