OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // https://wicg.github.io/netinfo/#the-networkinformation-interface | 5 // https://wicg.github.io/netinfo/#the-networkinformation-interface |
6 | 6 |
7 enum ConnectionType { | 7 enum ConnectionType { |
8 "cellular", | 8 "cellular", |
9 "bluetooth", | 9 "bluetooth", |
10 "ethernet", | 10 "ethernet", |
11 "wifi", | 11 "wifi", |
12 "wimax", | 12 "wimax", |
13 "other", | 13 "other", |
14 "none", | 14 "none", |
15 "unknown" | 15 "unknown" |
16 }; | 16 }; |
17 | 17 |
18 typedef unrestricted double Megabit; | 18 typedef unrestricted double Megabit; |
19 | 19 |
20 [ | 20 [ |
21 ActiveScriptWrappable, | 21 ActiveScriptWrappable, |
22 DependentLifetime, | 22 DependentLifetime, |
23 Exposed=(Window,Worker), | 23 Exposed=(Window,Worker), |
24 RuntimeEnabled=NetworkInformation, | 24 RuntimeEnabled=NetworkInformation, |
25 ] interface NetworkInformation : EventTarget { | 25 ] interface NetworkInformation : EventTarget { |
26 [MeasureAs=NetInfoType] readonly attribute ConnectionType type; | 26 [MeasureAs=NetInfoType] readonly attribute ConnectionType type; |
27 [RuntimeEnabled=NetInfoDownlinkMax, MeasureAs=NetInfoDownlinkMax] readonly a
ttribute Megabit downlinkMax; | 27 [RuntimeEnabled=NetInfoDownlinkMax, MeasureAs=NetInfoDownlinkMax] readonly a
ttribute Megabit downlinkMax; |
28 [RuntimeEnabled=NetInfoDownlinkMax, MeasureAs=NetInfoOnChange] attribute Eve
ntHandler onchange; | 28 [RuntimeEnabled=NetInfoDownlinkMax, MeasureAs=NetInfoOnChange] attribute Eve
ntHandler onchange; |
29 [MeasureAs=NetInfoOnTypeChange] attribute EventHandler ontypechange; | 29 [MeasureAs=NetInfoOnTypeChange] attribute EventHandler ontypechange; |
| 30 [RuntimeEnabled=NetInfoRtt, MeasureAs=NetInfoRtt] readonly attribute unsign
ed long long rtt; |
| 31 [RuntimeEnabled=NetInfoDownlink, MeasureAs=NetInfoDownlink] readonly attribu
te Megabit downlink; |
30 }; | 32 }; |
OLD | NEW |