Bug 857587 - Stop using JS::Value for nsIDOMTelephony.call; r=bent

This commit is contained in:
Ms2ger 2013-06-01 08:53:06 +02:00
parent 5e80cf21d7
commit e8673bc9ae
3 changed files with 12 additions and 25 deletions

View File

@ -1,5 +1,5 @@
/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
/* vim: set ts=2 et sw=2 tw=40: */
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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/. */
@ -312,24 +312,11 @@ Telephony::SetSpeakerEnabled(bool aSpeakerEnabled)
}
NS_IMETHODIMP
Telephony::GetActive(JS::Value* aActive)
Telephony::GetActive(nsIDOMTelephonyCall** aActive)
{
if (!mActiveCall) {
aActive->setNull();
return NS_OK;
}
nsresult rv;
nsIScriptContext* sc = GetContextForEventHandlers(&rv);
NS_ENSURE_SUCCESS(rv, rv);
if (!sc) {
return NS_OK;
}
AutoPushJSContext cx(sc->GetNativeContext());
JS::Rooted<JSObject*> global(cx, sc->GetNativeGlobal());
return nsContentUtils::WrapNative(cx, global, mActiveCall->ToISupports(),
aActive);
nsCOMPtr<nsIDOMTelephonyCall> activeCall = mActiveCall;
activeCall.forget(aActive);
return NS_OK;
}
NS_IMETHODIMP

View File

@ -1,5 +1,5 @@
/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
/* vim: set ts=2 et sw=2 tw=40: */
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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/. */

View File

@ -1,5 +1,5 @@
/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
/* vim: set ts=2 et sw=2 tw=40: */
/* -*- Mode: IDL; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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/. */
@ -9,7 +9,7 @@
interface nsIDOMEventListener;
interface nsIDOMTelephonyCall;
[scriptable, builtinclass, uuid(0e7bc85e-7e88-43fa-b349-6ea348bda2df)]
[scriptable, builtinclass, uuid(dd9f3957-b0fe-4d3d-b738-79782f76f05d)]
interface nsIDOMTelephony : nsIDOMEventTarget
{
nsIDOMTelephonyCall dial(in DOMString number);
@ -20,7 +20,7 @@ interface nsIDOMTelephony : nsIDOMEventTarget
// The call that is "active", i.e. receives microphone input and tones
// generated via startTone.
readonly attribute jsval active;
readonly attribute nsIDOMTelephonyCall active;
// Array of all calls that are currently connected.
readonly attribute jsval calls;