Bug 780790: Check for NULL callbacks to getUserMedia; r=jesup

This commit is contained in:
Anant Narayanan 2012-10-18 11:52:39 -07:00
parent 97c337f44f
commit 94ce1cb2fa
2 changed files with 8 additions and 3 deletions

View File

@ -675,6 +675,8 @@ MediaManager::GetUserMedia(bool aPrivileged, nsPIDOMWindow* aWindow,
NS_ENSURE_TRUE(aParams, NS_ERROR_NULL_POINTER);
NS_ENSURE_TRUE(aWindow, NS_ERROR_NULL_POINTER);
NS_ENSURE_TRUE(aOnError, NS_ERROR_NULL_POINTER);
NS_ENSURE_TRUE(aOnSuccess, NS_ERROR_NULL_POINTER);
nsCOMPtr<nsIDOMGetUserMediaSuccessCallback> onSuccess(aOnSuccess);
nsCOMPtr<nsIDOMGetUserMediaErrorCallback> onError(aOnError);
@ -864,6 +866,9 @@ MediaManager::GetUserMediaDevices(nsPIDOMWindow* aWindow,
{
NS_ASSERTION(NS_IsMainThread(), "Only call on main thread");
NS_ENSURE_TRUE(aOnError, NS_ERROR_NULL_POINTER);
NS_ENSURE_TRUE(aOnSuccess, NS_ERROR_NULL_POINTER);
nsCOMPtr<nsIGetUserMediaDevicesSuccessCallback> onSuccess(aOnSuccess);
nsCOMPtr<nsIDOMGetUserMediaErrorCallback> onError(aOnError);

View File

@ -51,7 +51,7 @@ interface IPeerConnectionObserver : nsISupports
void foundIceCandidate(in string candidate);
};
[scriptable, uuid(cb3f0048-1009-11e2-b822-87ee49eface7)]
[scriptable, uuid(f6819246-f5af-40f2-ab82-e166d5da7ba0)]
interface IPeerConnection : nsISupports
{
const unsigned long kHintAudio = 0x00000001;
@ -73,8 +73,8 @@ interface IPeerConnection : nsISupports
[optional] in nsIThread thread);
/* JSEP calls */
void createOffer(in string hints);
void createAnswer(in string hints, in string offer);
void createOffer(in nsIPropertyBag2 constraints);
void createAnswer(in nsIPropertyBag2 constraints, in string offer);
void setLocalDescription(in long action, in string sdp);
void setRemoteDescription(in long action, in string sdp);