Bug 834551 - Insert BT_LOG at several important check points, r=gyeh

This commit is contained in:
Eric Chou 2013-01-29 18:37:51 +08:00
parent 5cefb04c1c
commit da5d0e42c1
5 changed files with 23 additions and 1 deletions

View File

@ -273,6 +273,8 @@ BluetoothAdapter::Notify(const BluetoothSignal& aData)
{
InfallibleTArray<BluetoothNamedValue> arr;
BT_LOG("[A] %s: %s", __FUNCTION__, NS_ConvertUTF16toUTF8(aData.name()).get());
BluetoothValue v = aData.value();
if (aData.name().EqualsLiteral("DeviceFound")) {
nsRefPtr<BluetoothDevice> device = BluetoothDevice::Create(GetOwner(), mPath, aData.value());

View File

@ -163,6 +163,8 @@ BluetoothDevice::Create(nsPIDOMWindow* aWindow,
void
BluetoothDevice::Notify(const BluetoothSignal& aData)
{
BT_LOG("[D] %s: %s", __FUNCTION__, NS_ConvertUTF16toUTF8(aData.name()).get());
BluetoothValue v = aData.value();
if (aData.name().EqualsLiteral("PropertyChanged")) {
NS_ASSERTION(v.type() == BluetoothValue::TArrayOfBluetoothNamedValue,

View File

@ -208,6 +208,8 @@ NS_NewBluetoothManager(nsPIDOMWindow* aWindow,
void
BluetoothManager::Notify(const BluetoothSignal& aData)
{
BT_LOG("[M] %s: %s", __FUNCTION__, NS_ConvertUTF16toUTF8(aData.name()).get());
if (aData.name().EqualsLiteral("AdapterAdded")) {
DispatchTrustedEvent(NS_LITERAL_STRING("adapteradded"));
} else {

View File

@ -324,6 +324,8 @@ BluetoothService::RegisterBluetoothSignalHandler(
MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(aHandler);
BT_LOG("[S] %s: %s", __FUNCTION__, NS_ConvertUTF16toUTF8(aNodeName).get());
BluetoothSignalObserverList* ol;
if (!mBluetoothSignalObserverTable.Get(aNodeName, &ol)) {
ol = new BluetoothSignalObserverList();
@ -342,6 +344,8 @@ BluetoothService::UnregisterBluetoothSignalHandler(
MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(aHandler);
BT_LOG("[S] %s: %s", __FUNCTION__, NS_ConvertUTF16toUTF8(aNodeName).get());
BluetoothSignalObserverList* ol;
if (mBluetoothSignalObserverTable.Get(aNodeName, &ol)) {
ol->RemoveObserver(aHandler);
@ -770,6 +774,8 @@ BluetoothService::Notify(const BluetoothSignal& aData)
return;
}
BT_LOG("[S] %s: %s", __FUNCTION__, NS_ConvertUTF16toUTF8(aData.name()).get());
if (aData.name().EqualsLiteral("RequestConfirmation")) {
NS_ASSERTION(aData.value().get_ArrayOfBluetoothNamedValue().Length() == 3,
"RequestConfirmation: Wrong length of parameters");

View File

@ -417,6 +417,10 @@ AgentEventFilter(DBusConnection *conn, DBusMessage *msg, void *data)
DBusError err;
dbus_error_init(&err);
BT_LOG("%s: %s, %s", __FUNCTION__,
dbus_message_get_path(msg),
dbus_message_get_member(msg));
nsString signalPath = NS_ConvertUTF8toUTF16(dbus_message_get_path(msg));
nsString signalName = NS_ConvertUTF8toUTF16(dbus_message_get_member(msg));
nsString errorStr;
@ -1312,9 +1316,15 @@ EventFilter(DBusConnection* aConn, DBusMessage* aMsg, void* aData)
}
DBusError err;
dbus_error_init(&err);
nsString signalPath;
nsString signalName;
dbus_error_init(&err);
BT_LOG("%s: %s, %s", __FUNCTION__,
dbus_message_get_path(aMsg),
dbus_message_get_member(aMsg));
signalPath = NS_ConvertUTF8toUTF16(dbus_message_get_path(aMsg));
signalName = NS_ConvertUTF8toUTF16(dbus_message_get_member(aMsg));
nsString errorStr;