W3C home > Mailing lists > Public > public-device-apis-log@w3.org > December 2016

Re: [sensors] Don't allocate response objects to avoid triggering GC

From: Tobie Langel via GitHub <sysbot+gh@w3.org>
Date: Sun, 18 Dec 2016 11:32:53 +0000
To: public-device-apis-log@w3.org
Message-ID: <issue_comment.created-267816287-1482060772-sysbot+gh@w3.org>
Taking the above comments in consideration, here's a new take at the 
WebIDL for this:

```webidl
[SecureContext]
interface Sensor : EventTarget {
  readonly attribute SensorState state;
  readonly attribute DOMHighResTimeStamp lastUpdatedAt; // better 
name?
  readonly attribute DOMHighResTimeStamp timeOrigin;
  void start();
  void stop();
  attribute EventHandler onchange; // onupdate? onread? onreading? 
onpoll?
  attribute EventHandler onactivate;
  attribute EventHandler onerror;
};

dictionary SensorOptions {
  double? frequency;
};

// E.g. for Gyroscope

[Constructor(SensorOptions options)]
interface Gyroscope : Sensor {
  readonly attribute unrestricted double? x;
  readonly attribute unrestricted double? y;
  readonly attribute unrestricted double? z;
};
```

-- 
GitHub Notification of comment by tobie
Please view or discuss this issue at 
https://github.com/w3c/sensors/issues/153#issuecomment-267816287 using
 your GitHub account
Received on Sunday, 18 December 2016 11:32:59 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 12:18:52 UTC