Bug 1085307 - [Icc] Deprecate IccCardLockError.lockType. r=smaug,hsinyi

This commit is contained in:
Edgar Chen 2014-10-24 16:04:04 +08:00
parent e91fd8b26b
commit f8238c6d55
5 changed files with 6 additions and 20 deletions

View File

@ -12,7 +12,6 @@ NS_IMPL_ISUPPORTS_INHERITED0(IccCardLockError, DOMError)
/* static */ already_AddRefed<IccCardLockError>
IccCardLockError::Constructor(const GlobalObject& aGlobal,
const nsAString& aLockType,
const nsAString& aName,
int16_t aRetryCount,
ErrorResult& aRv)
@ -24,16 +23,14 @@ IccCardLockError::Constructor(const GlobalObject& aGlobal,
}
nsRefPtr<IccCardLockError> result =
new IccCardLockError(window, aName, aLockType, aRetryCount);
new IccCardLockError(window, aName, aRetryCount);
return result.forget();
}
IccCardLockError::IccCardLockError(nsPIDOMWindow* aWindow,
const nsAString& aName,
const nsAString& aLockType,
int16_t aRetryCount)
: DOMError(aWindow, aName)
, mLockType(aLockType)
, mRetryCount(aRetryCount)
{
}

View File

@ -16,24 +16,17 @@ public:
NS_DECL_ISUPPORTS_INHERITED
IccCardLockError(nsPIDOMWindow* aWindow, const nsAString& aName,
const nsAString& aLockType, int16_t aRetryCount);
int16_t aRetryCount);
static already_AddRefed<IccCardLockError>
Constructor(const GlobalObject& aGlobal, const nsAString& aLockType,
const nsAString& aName, int16_t aRetryCount,
ErrorResult& aRv);
Constructor(const GlobalObject& aGlobal, const nsAString& aName,
int16_t aRetryCount, ErrorResult& aRv);
virtual JSObject*
WrapObject(JSContext* aCx) MOZ_OVERRIDE;
// WebIDL interface
void
GetLockType(nsString& aLockType) const
{
aLockType = mLockType;
}
int16_t
RetryCount() const
{
@ -44,7 +37,6 @@ private:
~IccCardLockError() {}
private:
nsString mLockType;
int16_t mRetryCount;
};

View File

@ -17,7 +17,6 @@ taskHelper.push(function testPinChangeFailed() {
request.onerror = function onerror() {
is(request.error.name, "IncorrectPassword");
is(request.error.lockType, "pin");
// The default pin retries is 3, failed once becomes to 2
is(request.error.retryCount, 2);

View File

@ -683,8 +683,7 @@ RILContentHelper.prototype = {
} else {
if (data.rilMessageType == "iccSetCardLock" ||
data.rilMessageType == "iccUnlockCardLock") {
let cardLockError = new requestWindow.IccCardLockError(data.lockType,
data.errorMsg,
let cardLockError = new requestWindow.IccCardLockError(data.errorMsg,
data.retryCount);
this.fireRequestDetailedError(requestId, cardLockError);
} else {

View File

@ -3,9 +3,8 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
[Constructor(DOMString lockType, DOMString errorName, short retryCount),
[Constructor(DOMString errorName, short retryCount),
Pref="dom.icc.enabled"]
interface IccCardLockError : DOMError {
readonly attribute DOMString lockType;
readonly attribute short retryCount;
};