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

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

Issue 2865263002: Move //device/generic_sensor to be part of the internal implementation of the Device Service. (Closed)
Patch Set: code rebase Created 3 years, 7 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 "modules/sensor/Sensor.h" 5 #include "modules/sensor/Sensor.h"
6 6
7 #include "core/dom/Document.h" 7 #include "core/dom/Document.h"
8 #include "core/dom/ExceptionCode.h" 8 #include "core/dom/ExceptionCode.h"
9 #include "core/dom/TaskRunnerHelper.h" 9 #include "core/dom/TaskRunnerHelper.h"
10 #include "core/inspector/ConsoleMessage.h" 10 #include "core/inspector/ConsoleMessage.h"
11 #include "core/timing/DOMWindowPerformance.h" 11 #include "core/timing/DOMWindowPerformance.h"
12 #include "core/timing/Performance.h" 12 #include "core/timing/Performance.h"
13 #include "device/generic_sensor/public/interfaces/sensor.mojom-blink.h"
14 #include "modules/sensor/SensorErrorEvent.h" 13 #include "modules/sensor/SensorErrorEvent.h"
15 #include "modules/sensor/SensorProviderProxy.h" 14 #include "modules/sensor/SensorProviderProxy.h"
15 #include "services/device/public/interfaces/sensor.mojom-blink.h"
16 16
17 using namespace device::mojom::blink; 17 using namespace device::mojom::blink;
18 18
19 namespace blink { 19 namespace blink {
20 20
21 namespace { 21 namespace {
22 22
23 constexpr double kMinWaitingInterval = 23 constexpr double kMinWaitingInterval =
24 1 / device::mojom::blink::SensorConfiguration::kMaxAllowedFrequency; 24 1 / device::mojom::blink::SensorConfiguration::kMaxAllowedFrequency;
25 25
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 } 313 }
314 314
315 bool Sensor::CanReturnReadings() const { 315 bool Sensor::CanReturnReadings() const {
316 if (!IsActivated()) 316 if (!IsActivated())
317 return false; 317 return false;
318 DCHECK(sensor_proxy_); 318 DCHECK(sensor_proxy_);
319 return sensor_proxy_->reading().timestamp != 0.0; 319 return sensor_proxy_->reading().timestamp != 0.0;
320 } 320 }
321 321
322 } // namespace blink 322 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/sensor/DEPS ('k') | third_party/WebKit/Source/modules/sensor/SensorProviderProxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698