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

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

Issue 2668173003: [Sensors] Remove SensorReading interfaces (Closed)
Patch Set: updated global-interface-listing.html Created 3 years, 10 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "modules/sensor/SensorReading.h"
6
7 #include "core/dom/ExecutionContext.h"
8 #include "core/frame/LocalDOMWindow.h"
9 #include "core/timing/DOMWindowPerformance.h"
10 #include "core/timing/Performance.h"
11
12 namespace blink {
13
14 SensorReading::SensorReading(const device::SensorReading& data)
15 : m_data(data) {}
16
17 SensorReading::~SensorReading() = default;
18
19 DOMHighResTimeStamp SensorReading::timeStamp(ScriptState* scriptState) const {
20 LocalDOMWindow* window = scriptState->domWindow();
21 if (!window)
22 return 0.0;
23
24 Performance* performance = DOMWindowPerformance::performance(*window);
25 DCHECK(performance);
26
27 return performance->monotonicTimeToDOMHighResTimeStamp(data().timestamp);
28 }
29
30 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/sensor/SensorReading.h ('k') | third_party/WebKit/Source/modules/sensor/SensorReading.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698