Bug 942104 - Avoid exposing Bluetooth interface to all web pages, r=bz

Current Bluetooth related webidl implementation would make interfaces
such as BluetoothAdapter exposed to all web pages, and obviously we
don't want to see that.
This commit is contained in:
Eric Chou 2014-05-22 14:09:33 +08:00
parent 0ae89c1c34
commit 2d2ffcb064
7 changed files with 11 additions and 5 deletions

View File

@ -159,17 +159,14 @@ DOMInterfaces = {
'BluetoothAdapter': {
'nativeType': 'mozilla::dom::bluetooth::BluetoothAdapter',
'headerFile': 'BluetoothAdapter.h'
},
'BluetoothDevice': {
'nativeType': 'mozilla::dom::bluetooth::BluetoothDevice',
'headerFile': 'BluetoothDevice.h'
},
'BluetoothManager': {
'nativeType': 'mozilla::dom::bluetooth::BluetoothManager',
'headerFile': 'BluetoothManager.h'
},
'CameraCapabilities': {

View File

@ -91,7 +91,10 @@ EXPORTS.mozilla.dom.bluetooth.ipc += [
]
EXPORTS.mozilla.dom.bluetooth += [
'BluetoothAdapter.h',
'BluetoothCommon.h',
'BluetoothDevice.h',
'BluetoothManager.h',
]
IPDL_SOURCES += [

View File

@ -32,6 +32,7 @@ dictionary MediaPlayStatus
DOMString playStatus = "";
};
[Func="Navigator::HasBluetoothSupport"]
interface BluetoothAdapter : EventTarget {
readonly attribute DOMString address;
readonly attribute unsigned long class;

View File

@ -4,6 +4,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
[Func="Navigator::HasBluetoothSupport"]
interface BluetoothDevice : EventTarget {
readonly attribute DOMString address;
readonly attribute DOMString name;

View File

@ -4,7 +4,8 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
[Constructor(DOMString type, optional BluetoothDeviceEventInit eventInitDict)]
[Constructor(DOMString type, optional BluetoothDeviceEventInit eventInitDict),
Func="Navigator::HasBluetoothSupport"]
interface BluetoothDeviceEvent : Event
{
readonly attribute BluetoothDevice? device;

View File

@ -3,6 +3,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
[Func="Navigator::HasBluetoothSupport"]
interface BluetoothManager : EventTarget {
[Throws]
readonly attribute boolean enabled;

View File

@ -4,7 +4,9 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
[Constructor(DOMString type, optional BluetoothStatusChangedEventInit eventInitDict)]
[Constructor(DOMString type,
optional BluetoothStatusChangedEventInit eventInitDict),
Func="Navigator::HasBluetoothSupport"]
interface BluetoothStatusChangedEvent : Event
{
readonly attribute DOMString address;