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

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

Issue 1942663003: [sensors]: Introduce the Generic Sensor API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase + remove state from global interface listing Created 4 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
(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/Sensor.h"
6
7 #include "bindings/core/v8/ScriptPromise.h"
8 #include "bindings/core/v8/ScriptPromiseResolver.h"
9 #include "core/dom/DOMException.h"
timvolodine 2016/05/06 17:04:29 not used?
riju_ 2016/05/12 14:12:45 Acknowledged.
10 #include "core/dom/ExceptionCode.h"
11 #include "modules/sensor/SensorReading.h"
12
13 namespace blink {
14
15 Sensor::~Sensor()
16 {
17 }
18
19 Sensor::Sensor(ExecutionContext* executionContext, const SensorOptions& sensorOp tions)
timvolodine 2016/05/06 17:04:29 the class doesn't seem to do much at this stage..
riju_ 2016/05/12 14:12:45 Only thing i am adding is m_sensorState(SensorStat
20 : ActiveScriptWrappable(this)
21 , ActiveDOMObject(executionContext)
22 {
23 }
24
timvolodine 2016/05/06 17:04:29 no state() implementation as you have in the other
riju_ 2016/05/12 14:12:45 I was adding the "state" part in the next CL, but
25 // Getters
26 SensorReading& Sensor::reading()
27 {
28 return *m_sensorReading.get();
timvolodine 2016/05/06 17:04:29 I understand reading can be nullable, how is that
riju_ 2016/05/12 14:12:45 Acknowledged.
29 }
30
31 void Sensor::suspend()
32 {
timvolodine 2016/05/06 17:04:29 will these remain empty? otherwise add todo
riju_ 2016/05/12 14:12:45 As suggested by you (https://codereview.chromium.o
timvolodine 2016/05/17 17:44:39 so yes, maybe Sensor should inherit from PlatformE
riju_ 2016/05/20 11:20:11 Done.
33 }
34
35 void Sensor::resume()
36 {
37 }
38
39 void Sensor::stop()
40 {
41 }
42
43 bool Sensor::hasPendingActivity() const
44 {
45 return false;
timvolodine 2016/05/06 17:04:29 I assume this needs to be overriden in deriving cl
riju_ 2016/05/12 14:12:45 yes. removing it all together from here. In Active
46 }
47
48 DEFINE_TRACE(Sensor)
49 {
50 ActiveDOMObject::trace(visitor);
51 EventTargetWithInlineData::trace(visitor);
52 visitor->trace(m_sensorReading);
53 }
54
55 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698