зеркало из https://github.com/mozilla/gecko-dev.git
Bug 779473 - Fix some nsresult abuses in the Bluetooth implementation
This commit is contained in:
Родитель
316d940e2b
Коммит
76628055e6
|
@ -558,7 +558,7 @@ BluetoothHfpManager::Connect(const nsAString& aDeviceObjectPath,
|
||||||
|
|
||||||
nsCOMPtr<nsIRILContentHelper> ril =
|
nsCOMPtr<nsIRILContentHelper> ril =
|
||||||
do_GetService("@mozilla.org/ril/content-helper;1");
|
do_GetService("@mozilla.org/ril/content-helper;1");
|
||||||
NS_ENSURE_TRUE(ril, NS_ERROR_UNEXPECTED);
|
NS_ENSURE_TRUE(ril, false);
|
||||||
ril->EnumerateCalls(mListener->GetCallback());
|
ril->EnumerateCalls(mListener->GetCallback());
|
||||||
|
|
||||||
nsRefPtr<BluetoothReplyRunnable> runnable = aRunnable;
|
nsRefPtr<BluetoothReplyRunnable> runnable = aRunnable;
|
||||||
|
|
|
@ -714,7 +714,7 @@ SetJsObject(JSContext* aContext,
|
||||||
JSString* JsData = JS_NewStringCopyN(aContext,
|
JSString* JsData = JS_NewStringCopyN(aContext,
|
||||||
NS_ConvertUTF16toUTF8(data).get(),
|
NS_ConvertUTF16toUTF8(data).get(),
|
||||||
data.Length());
|
data.Length());
|
||||||
NS_ENSURE_TRUE(JsData, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(JsData, false);
|
||||||
v = STRING_TO_JSVAL(JsData);
|
v = STRING_TO_JSVAL(JsData);
|
||||||
} else if (aData[i].value().type() == BluetoothValue::Tuint32_t) {
|
} else if (aData[i].value().type() == BluetoothValue::Tuint32_t) {
|
||||||
int data = aData[i].value().get_uint32_t();
|
int data = aData[i].value().get_uint32_t();
|
||||||
|
|
|
@ -117,7 +117,7 @@ mozilla::dom::bluetooth::SetJsObject(JSContext* aContext,
|
||||||
JSString* JsData = JS_NewStringCopyN(aContext,
|
JSString* JsData = JS_NewStringCopyN(aContext,
|
||||||
NS_ConvertUTF16toUTF8(data).get(),
|
NS_ConvertUTF16toUTF8(data).get(),
|
||||||
data.Length());
|
data.Length());
|
||||||
NS_ENSURE_TRUE(JsData, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(JsData, false);
|
||||||
v = STRING_TO_JSVAL(JsData);
|
v = STRING_TO_JSVAL(JsData);
|
||||||
} else if (aData[i].value().type() == BluetoothValue::Tuint32_t) {
|
} else if (aData[i].value().type() == BluetoothValue::Tuint32_t) {
|
||||||
int data = aData[i].value().get_uint32_t();
|
int data = aData[i].value().get_uint32_t();
|
||||||
|
|
|
@ -175,7 +175,7 @@ BluetoothServiceChildProcess::GetDevicePath(const nsAString& aAdapterPath,
|
||||||
|
|
||||||
aDevicePath = path;
|
aDevicePath = path;
|
||||||
|
|
||||||
return NS_OK;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
|
|
Загрузка…
Ссылка в новой задаче