зеркало из https://github.com/mozilla/gecko-dev.git
Bug 878745 - BluetoothService cleanup, r=echou
This commit is contained in:
Родитель
4817823795
Коммит
c9e209a7b9
|
@ -820,3 +820,13 @@ BluetoothService::Notify(const BluetoothSignal& aData)
|
||||||
systemMessenger->BroadcastMessage(oldType, OBJECT_TO_JSVAL(obj));
|
systemMessenger->BroadcastMessage(oldType, OBJECT_TO_JSVAL(obj));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
BluetoothService::DispatchToCommandThread(nsRunnable* aRunnable)
|
||||||
|
{
|
||||||
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
|
MOZ_ASSERT(aRunnable);
|
||||||
|
MOZ_ASSERT(mBluetoothCommandThread);
|
||||||
|
|
||||||
|
mBluetoothCommandThread->Dispatch(aRunnable, NS_DISPATCH_NORMAL);
|
||||||
|
}
|
||||||
|
|
|
@ -158,16 +158,6 @@ public:
|
||||||
virtual nsresult
|
virtual nsresult
|
||||||
StartDiscoveryInternal(BluetoothReplyRunnable* aRunnable) = 0;
|
StartDiscoveryInternal(BluetoothReplyRunnable* aRunnable) = 0;
|
||||||
|
|
||||||
/**
|
|
||||||
* Fetches the propertes for the specified device
|
|
||||||
*
|
|
||||||
* @param aSignal BluetoothSignal to be distrubuted after retrieving device properties
|
|
||||||
*
|
|
||||||
* @return NS_OK on function run, NS_ERROR_FAILURE otherwise
|
|
||||||
*/
|
|
||||||
virtual nsresult
|
|
||||||
GetDevicePropertiesInternal(const BluetoothSignal& aSignal) = 0;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set a property for the specified object
|
* Set a property for the specified object
|
||||||
*
|
*
|
||||||
|
@ -246,9 +236,6 @@ public:
|
||||||
SetAuthorizationInternal(const nsAString& aDeviceAddress, bool aAllow,
|
SetAuthorizationInternal(const nsAString& aDeviceAddress, bool aAllow,
|
||||||
BluetoothReplyRunnable* aRunnable) = 0;
|
BluetoothReplyRunnable* aRunnable) = 0;
|
||||||
|
|
||||||
virtual nsresult
|
|
||||||
PrepareAdapterInternal() = 0;
|
|
||||||
|
|
||||||
virtual void
|
virtual void
|
||||||
Connect(const nsAString& aDeviceAddress,
|
Connect(const nsAString& aDeviceAddress,
|
||||||
uint16_t aProfileId,
|
uint16_t aProfileId,
|
||||||
|
@ -299,6 +286,9 @@ public:
|
||||||
void
|
void
|
||||||
RemoveObserverFromTable(const nsAString& key);
|
RemoveObserverFromTable(const nsAString& key);
|
||||||
|
|
||||||
|
void
|
||||||
|
DispatchToCommandThread(nsRunnable* aRunnable);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
BluetoothService()
|
BluetoothService()
|
||||||
: mEnabled(false)
|
: mEnabled(false)
|
||||||
|
|
|
@ -102,14 +102,6 @@ BluetoothServiceChildProcess::GetDefaultAdapterPathInternal(
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
|
||||||
BluetoothServiceChildProcess::GetDevicePropertiesInternal(
|
|
||||||
const BluetoothSignal& aSignal)
|
|
||||||
{
|
|
||||||
MOZ_NOT_REACHED("Should never be called from child");
|
|
||||||
return NS_ERROR_NOT_IMPLEMENTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
BluetoothServiceChildProcess::GetConnectedDevicePropertiesInternal(
|
BluetoothServiceChildProcess::GetConnectedDevicePropertiesInternal(
|
||||||
uint16_t aProfileId,
|
uint16_t aProfileId,
|
||||||
|
@ -277,13 +269,6 @@ BluetoothServiceChildProcess::SetAuthorizationInternal(
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
|
||||||
BluetoothServiceChildProcess::PrepareAdapterInternal()
|
|
||||||
{
|
|
||||||
MOZ_NOT_REACHED("Should never be called from child");
|
|
||||||
return NS_ERROR_NOT_IMPLEMENTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BluetoothServiceChildProcess::Connect(
|
BluetoothServiceChildProcess::Connect(
|
||||||
const nsAString& aDeviceAddress,
|
const nsAString& aDeviceAddress,
|
||||||
|
|
|
@ -185,14 +185,6 @@ private:
|
||||||
virtual bool
|
virtual bool
|
||||||
IsEnabledInternal() MOZ_OVERRIDE;
|
IsEnabledInternal() MOZ_OVERRIDE;
|
||||||
|
|
||||||
// Should never be called from the child
|
|
||||||
virtual nsresult
|
|
||||||
GetDevicePropertiesInternal(const BluetoothSignal& aSignal) MOZ_OVERRIDE;
|
|
||||||
|
|
||||||
// This method should never be called from the child.
|
|
||||||
virtual nsresult
|
|
||||||
PrepareAdapterInternal() MOZ_OVERRIDE;
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
IsSignalRegistered(const nsAString& aNodeName) {
|
IsSignalRegistered(const nsAString& aNodeName) {
|
||||||
return !!mBluetoothSignalObserverTable.Get(aNodeName);
|
return !!mBluetoothSignalObserverTable.Get(aNodeName);
|
||||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -47,9 +47,6 @@ public:
|
||||||
|
|
||||||
virtual nsresult StopDiscoveryInternal(BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
|
virtual nsresult StopDiscoveryInternal(BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
|
||||||
|
|
||||||
virtual nsresult
|
|
||||||
GetDevicePropertiesInternal(const BluetoothSignal& aSignal) MOZ_OVERRIDE;
|
|
||||||
|
|
||||||
virtual nsresult
|
virtual nsresult
|
||||||
SetProperty(BluetoothObjectType aType,
|
SetProperty(BluetoothObjectType aType,
|
||||||
const BluetoothNamedValue& aValue,
|
const BluetoothNamedValue& aValue,
|
||||||
|
@ -119,9 +116,6 @@ public:
|
||||||
SetAuthorizationInternal(const nsAString& aDeviceAddress, bool aAllow,
|
SetAuthorizationInternal(const nsAString& aDeviceAddress, bool aAllow,
|
||||||
BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
|
BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
|
||||||
|
|
||||||
virtual nsresult
|
|
||||||
PrepareAdapterInternal() MOZ_OVERRIDE;
|
|
||||||
|
|
||||||
virtual void
|
virtual void
|
||||||
Connect(const nsAString& aDeviceAddress,
|
Connect(const nsAString& aDeviceAddress,
|
||||||
const uint16_t aProfileId,
|
const uint16_t aProfileId,
|
||||||
|
|
Загрузка…
Ссылка в новой задаче