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

Side by Side Diff: third_party/WebKit/Source/modules/sensor/SensorProxy.cpp

Issue 2534703002: [Sensors] Layouts test to check frequency hint (Closed)
Patch Set: Comments from Reilly Created 4 years 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
« no previous file with comments | « third_party/WebKit/Source/modules/sensor/MagnetometerReading.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "modules/sensor/SensorProxy.h" 5 #include "modules/sensor/SensorProxy.h"
6 6
7 #include "core/frame/LocalFrame.h" 7 #include "core/frame/LocalFrame.h"
8 #include "modules/sensor/SensorProviderProxy.h" 8 #include "modules/sensor/SensorProviderProxy.h"
9 #include "modules/sensor/SensorReading.h" 9 #include "modules/sensor/SensorReading.h"
10 #include "platform/mojo/MojoHelper.h" 10 #include "platform/mojo/MojoHelper.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 139
140 for (Observer* observer : m_observers) 140 for (Observer* observer : m_observers)
141 observer->onSensorReadingChanged(); 141 observer->onSensorReadingChanged();
142 } 142 }
143 143
144 void SensorProxy::RaiseError() { 144 void SensorProxy::RaiseError() {
145 handleSensorError(); 145 handleSensorError();
146 } 146 }
147 147
148 void SensorProxy::SensorReadingChanged() { 148 void SensorProxy::SensorReadingChanged() {
149 DCHECK_EQ(ReportingMode::ON_CHANGE, m_mode);
149 updateSensorReading(); 150 updateSensorReading();
150 } 151 }
151 152
152 void SensorProxy::pageVisibilityChanged() { 153 void SensorProxy::pageVisibilityChanged() {
153 if (!isInitialized()) 154 if (!isInitialized())
154 return; 155 return;
155 156
156 if (page()->visibilityState() != PageVisibilityStateVisible) { 157 if (page()->visibilityState() != PageVisibilityStateVisible) {
157 suspend(); 158 suspend();
158 } else { 159 } else {
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 updateSensorReading(); 294 updateSensorReading();
294 m_timer.startRepeating(repeatInterval, BLINK_FROM_HERE); 295 m_timer.startRepeating(repeatInterval, BLINK_FROM_HERE);
295 } 296 }
296 } 297 }
297 298
298 void SensorProxy::onTimerFired(TimerBase*) { 299 void SensorProxy::onTimerFired(TimerBase*) {
299 updateSensorReading(); 300 updateSensorReading();
300 } 301 }
301 302
302 } // namespace blink 303 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/sensor/MagnetometerReading.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698