Chromium Code Reviews| 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 enum EffectiveConnectionType { | |
| 19 "slow-2g", | |
| 20 "2g", | |
| 21 "3g", | |
| 22 "4g" | |
| 23 }; | |
| 24 | |
| 18 typedef unrestricted double Megabit; | 25 typedef unrestricted double Megabit; |
| 19 typedef unsigned long long Milliseconds; | 26 typedef unsigned long long Milliseconds; |
| 20 | 27 |
| 21 [ | 28 [ |
| 22 ActiveScriptWrappable, | 29 ActiveScriptWrappable, |
| 23 DependentLifetime, | 30 DependentLifetime, |
| 24 Exposed=(Window,Worker), | 31 Exposed=(Window,Worker), |
| 25 RuntimeEnabled=NetworkInformation, | 32 RuntimeEnabled=NetworkInformation, |
| 26 ] interface NetworkInformation : EventTarget { | 33 ] interface NetworkInformation : EventTarget { |
| 27 [MeasureAs=NetInfoType] readonly attribute ConnectionType type; | 34 [MeasureAs=NetInfoType] readonly attribute ConnectionType type; |
| 28 [RuntimeEnabled=NetInfoDownlinkMax, MeasureAs=NetInfoDownlinkMax] readonly a ttribute Megabit downlinkMax; | 35 [RuntimeEnabled=NetInfoDownlinkMax, MeasureAs=NetInfoDownlinkMax] readonly a ttribute Megabit downlinkMax; |
| 29 [RuntimeEnabled=NetInfoDownlinkMax, MeasureAs=NetInfoOnChange] attribute Eve ntHandler onchange; | 36 [RuntimeEnabled=NetInfoDownlinkMax, MeasureAs=NetInfoOnChange] attribute Eve ntHandler onchange; |
| 30 [MeasureAs=NetInfoOnTypeChange] attribute EventHandler ontypechange; | 37 [MeasureAs=NetInfoOnTypeChange] attribute EventHandler ontypechange; |
| 38 [MeasureAs=NetInfoEffectiveType] readonly attribute EffectiveConnectionType effectiveType; | |
|
foolip
2017/05/29 11:39:40
Looks like RuntimeEnabled=NetInfoEffectiveType was
| |
| 31 [RuntimeEnabled=NetInfoRtt, MeasureAs=NetInfoRtt] readonly attribute Millise conds rtt; | 39 [RuntimeEnabled=NetInfoRtt, MeasureAs=NetInfoRtt] readonly attribute Millise conds rtt; |
| 32 [RuntimeEnabled=NetInfoDownlink, MeasureAs=NetInfoDownlink] readonly attribu te Megabit downlink; | 40 [RuntimeEnabled=NetInfoDownlink, MeasureAs=NetInfoDownlink] readonly attribu te Megabit downlink; |
| 33 }; | 41 }; |
| OLD | NEW |