diff --git a/dom/base/nsDOMClassInfo.cpp b/dom/base/nsDOMClassInfo.cpp index e1276e8e35e..5d6901a44ff 100644 --- a/dom/base/nsDOMClassInfo.cpp +++ b/dom/base/nsDOMClassInfo.cpp @@ -532,7 +532,6 @@ using mozilla::dom::indexedDB::IDBWrapperCache; #ifdef MOZ_B2G_BT #include "BluetoothAdapter.h" -#include "BluetoothDevice.h" #endif #include "DOMError.h" @@ -1640,8 +1639,6 @@ static nsDOMClassInfoData sClassInfoData[] = { #ifdef MOZ_B2G_BT NS_DEFINE_CLASSINFO_DATA(BluetoothAdapter, nsEventTargetSH, EVENTTARGET_SCRIPTABLE_FLAGS) - NS_DEFINE_CLASSINFO_DATA(BluetoothDevice, nsEventTargetSH, - EVENTTARGET_SCRIPTABLE_FLAGS) #endif NS_DEFINE_CLASSINFO_DATA(DOMError, nsDOMGenericSH, @@ -4417,10 +4414,6 @@ nsDOMClassInfo::Init() #ifdef MOZ_B2G_BT DOM_CLASSINFO_MAP_BEGIN(BluetoothAdapter, nsIDOMBluetoothAdapter) DOM_CLASSINFO_MAP_ENTRY(nsIDOMBluetoothAdapter) - DOM_CLASSINFO_MAP_END - - DOM_CLASSINFO_MAP_BEGIN(BluetoothDevice, nsIDOMBluetoothDevice) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMBluetoothDevice) DOM_CLASSINFO_MAP_END #endif diff --git a/dom/base/nsDOMClassInfoClasses.h b/dom/base/nsDOMClassInfoClasses.h index e2415471a49..a761ce8c259 100644 --- a/dom/base/nsDOMClassInfoClasses.h +++ b/dom/base/nsDOMClassInfoClasses.h @@ -547,7 +547,6 @@ DOMCI_CLASS(CallEvent) #ifdef MOZ_B2G_BT DOMCI_CLASS(BluetoothAdapter) -DOMCI_CLASS(BluetoothDevice) #endif DOMCI_CLASS(DOMError) diff --git a/dom/bluetooth/BluetoothDevice.cpp b/dom/bluetooth/BluetoothDevice.cpp deleted file mode 100644 index 8cd741e9408..00000000000 --- a/dom/bluetooth/BluetoothDevice.cpp +++ /dev/null @@ -1,154 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * 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/. */ - -#include "BluetoothDevice.h" -#include "nsDOMClassInfo.h" - -USING_BLUETOOTH_NAMESPACE - -DOMCI_DATA(BluetoothDevice, BluetoothDevice) - -NS_IMPL_CYCLE_COLLECTION_CLASS(BluetoothDevice) - -NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(BluetoothDevice, - nsDOMEventTargetHelper) - NS_CYCLE_COLLECTION_TRAVERSE_EVENT_HANDLER(propertychanged) - NS_CYCLE_COLLECTION_TRAVERSE_EVENT_HANDLER(disconnectrequested) -NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END - -NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(BluetoothDevice, - nsDOMEventTargetHelper) - NS_CYCLE_COLLECTION_UNLINK_EVENT_HANDLER(propertychanged) - NS_CYCLE_COLLECTION_UNLINK_EVENT_HANDLER(disconnectrequested) -NS_IMPL_CYCLE_COLLECTION_UNLINK_END - -NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(BluetoothDevice) - NS_INTERFACE_MAP_ENTRY(nsIDOMBluetoothDevice) - NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMBluetoothDevice) - NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(BluetoothDevice) -NS_INTERFACE_MAP_END_INHERITING(nsDOMEventTargetHelper) - -NS_IMPL_ADDREF_INHERITED(BluetoothDevice, nsDOMEventTargetHelper) -NS_IMPL_RELEASE_INHERITED(BluetoothDevice, nsDOMEventTargetHelper) - -BluetoothDevice::BluetoothDevice() -{ -} - -nsresult -BluetoothDevice::GetAdapter(nsAString& aAdapter) -{ - aAdapter = mAdapter; - return NS_OK; -} - -nsresult -BluetoothDevice::GetAddress(nsAString& aAddress) -{ - aAddress = mAddress; - return NS_OK; -} - -nsresult -BluetoothDevice::GetName(nsAString& aName) -{ - aName = mName; - return NS_OK; -} - -nsresult -BluetoothDevice::GetClass(PRUint32* aClass) -{ - *aClass = mClass; - return NS_OK; -} - -nsresult -BluetoothDevice::GetConnected(bool* aConnected) -{ - *aConnected = mConnected; - return NS_OK; -} - -nsresult -BluetoothDevice::GetPaired(bool* aPaired) -{ - *aPaired = mPaired; - return NS_OK; -} - -nsresult -BluetoothDevice::GetLegacyPairing(bool* aLegacyPairing) -{ - *aLegacyPairing = mLegacyPairing; - return NS_OK; -} - -nsresult -BluetoothDevice::GetTrusted(bool* aTrusted) -{ - *aTrusted = mTrusted; - return NS_OK; -} - -nsresult -BluetoothDevice::SetTrusted(bool aTrusted) -{ - mTrusted = aTrusted; - return NS_OK; -} - -nsresult -BluetoothDevice::GetAlias(nsAString& aAlias) -{ - aAlias = mAlias; - return NS_OK; -} - -nsresult -BluetoothDevice::SetAlias(const nsAString& aAlias) -{ - mAlias = aAlias; - return NS_OK; -} - -nsresult -BluetoothDevice::GetUuids(jsval* aUuids) -{ - //TODO: convert mUuids to jsval and assign to aUuids; - return NS_OK; -} - -nsresult -BluetoothDevice::Disconnect() -{ - return NS_OK; -} - -nsresult -BluetoothDevice::GetProperties(jsval* aProperties) -{ - return NS_OK; -} - -nsresult -BluetoothDevice::SetProperty(const nsAString& aName, const nsAString& aValue) -{ - return NS_OK; -} - -nsresult -BluetoothDevice::DiscoverServices(const nsAString& aPattern, jsval* aServices) -{ - return NS_OK; -} - -nsresult -BluetoothDevice::CancelDiscovery() -{ - return NS_OK; -} - -NS_IMPL_EVENT_HANDLER(BluetoothDevice, propertychanged) -NS_IMPL_EVENT_HANDLER(BluetoothDevice, disconnectrequested) diff --git a/dom/bluetooth/BluetoothDevice.h b/dom/bluetooth/BluetoothDevice.h deleted file mode 100644 index a7ae58db7bc..00000000000 --- a/dom/bluetooth/BluetoothDevice.h +++ /dev/null @@ -1,48 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * 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/. */ - -#ifndef mozilla_dom_bluetooth_bluetoothdevice_h__ -#define mozilla_dom_bluetooth_bluetoothdevice_h__ - -#include "BluetoothCommon.h" -#include "nsDOMEventTargetHelper.h" -#include "nsIDOMBluetoothDevice.h" -#include "nsString.h" - -BEGIN_BLUETOOTH_NAMESPACE - -class BluetoothDevice : public nsDOMEventTargetHelper - , public nsIDOMBluetoothDevice -{ -public: - NS_DECL_ISUPPORTS - NS_DECL_NSIDOMBLUETOOTHDEVICE - - NS_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper::) - - NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(BluetoothDevice, - nsDOMEventTargetHelper) - - BluetoothDevice(); - -protected: - nsString mAdapter; - nsString mAddress; - PRUint32 mClass; - bool mConnected; - bool mLegacyPairing; - nsString mName; - bool mPaired; - nsTArray mUuids; - - bool mTrusted; - nsString mAlias; - - NS_DECL_EVENT_HANDLER(propertychanged) - NS_DECL_EVENT_HANDLER(disconnectrequested) -}; - -END_BLUETOOTH_NAMESPACE - -#endif diff --git a/dom/bluetooth/Makefile.in b/dom/bluetooth/Makefile.in index 46860f2af56..7d782e5356c 100644 --- a/dom/bluetooth/Makefile.in +++ b/dom/bluetooth/Makefile.in @@ -19,13 +19,11 @@ include $(topsrcdir)/dom/dom-config.mk CPPSRCS = \ BluetoothAdapter.cpp \ - BluetoothDevice.cpp \ $(NULL) XPIDLSRCS = \ nsIDOMNavigatorBluetooth.idl \ nsIDOMBluetoothAdapter.idl \ - nsIDOMBluetoothDevice.idl \ $(NULL) include $(topsrcdir)/config/rules.mk diff --git a/dom/bluetooth/nsIDOMBluetoothDevice.idl b/dom/bluetooth/nsIDOMBluetoothDevice.idl deleted file mode 100644 index ae79dded421..00000000000 --- a/dom/bluetooth/nsIDOMBluetoothDevice.idl +++ /dev/null @@ -1,30 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * 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/. */ - -#include "nsIDOMEventTarget.idl" - -[scriptable, builtinclass, uuid(2da61f89-a7d2-4f7d-9f4c-fb8a99d9add2)] -interface nsIDOMBluetoothDevice : nsIDOMEventTarget -{ - readonly attribute DOMString adapter; - readonly attribute DOMString address; - readonly attribute unsigned long class; - readonly attribute boolean connected; - readonly attribute boolean legacyPairing; - readonly attribute DOMString name; - readonly attribute boolean paired; - readonly attribute jsval uuids; - - attribute boolean trusted; - attribute DOMString alias; - - attribute nsIDOMEventListener onpropertychanged; - attribute nsIDOMEventListener ondisconnectrequested; - - void disconnect(); - jsval getProperties(); - void setProperty(in DOMString name, in DOMString value); - jsval discoverServices(in DOMString pattern); - void cancelDiscovery(); -};