merge b2g-inbound to mozilla-central
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Fri, 11 Oct 2013 11:15:46 +0200
changeset 150438 6b101d4c6d241e3fa39b5ce71f122243fe2c118c
parent 150428 9f2f57672cc37dd0e6ecff324ac9b0bfb66227b8 (current diff)
parent 150437 0aaaf4fad98dc18ec19c8c41738888b88f74adff (diff)
child 150439 500765bd8dd9b772701c86c34e62948ec7f0eab5
child 150443 3f25e5821ed0ed7e8c35db2128af0850ca3c0294
child 150484 fe160ec1e0ad4de44050fffdb6f187f885da085c
child 150500 a91e7a44eb857d9c0635ff0974bd3804c1ec9878
child 155845 f7868ce088cd2dcb444c1d7bcf40e39bbe611d31
child 161457 c73deceb25c56667f0101a42bed6659435c27d1c
push id25440
push usercbook@mozilla.com
push dateFri, 11 Oct 2013 09:16:09 +0000
treeherdermozilla-central@6b101d4c6d24 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone27.0a1
first release with
nightly linux32
6b101d4c6d24 / 27.0a1 / 20131011030201 / files
nightly linux64
6b101d4c6d24 / 27.0a1 / 20131011030201 / files
nightly mac
6b101d4c6d24 / 27.0a1 / 20131011030201 / files
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
merge b2g-inbound to mozilla-central
dom/icc/interfaces/nsIDOMIccCardLockErrorEvent.idl
dom/webidl/IccCardLockErrorEvent.webidl
--- a/b2g/config/gaia.json
+++ b/b2g/config/gaia.json
@@ -1,4 +1,4 @@
 {
-    "revision": "34b6a207b754b02ee836ed9c8293a47b997f714c", 
+    "revision": "c7c750d66279bf2b7f9164d8b57d425a028e1fd9", 
     "repo_path": "/integration/gaia-central"
 }
--- a/content/base/src/nsGkAtomList.h
+++ b/content/base/src/nsGkAtomList.h
@@ -715,17 +715,16 @@ GK_ATOM(onfrequencychange, "onfrequencyc
 GK_ATOM(onget, "onget")
 GK_ATOM(ongroupchange, "ongroupchange")
 GK_ATOM(onhashchange, "onhashchange")
 GK_ATOM(onheadphoneschange, "onheadphoneschange")
 GK_ATOM(onheld, "onheld")
 GK_ATOM(onhfpstatuschanged, "onhfpstatuschanged")
 GK_ATOM(onholding, "onholding")
 GK_ATOM(oniccinfochange, "oniccinfochange")
-GK_ATOM(onicccardlockerror, "onicccardlockerror")
 GK_ATOM(onincoming, "onincoming")
 GK_ATOM(oninput, "oninput")
 GK_ATOM(oninvalid, "oninvalid")
 GK_ATOM(onkeydown, "onkeydown")
 GK_ATOM(onkeypress, "onkeypress")
 GK_ATOM(onkeyup, "onkeyup")
 GK_ATOM(onlevelchange, "onlevelchange")
 GK_ATOM(onLoad, "onLoad")
--- a/content/events/test/test_all_synthetic_events.html
+++ b/content/events/test/test_all_synthetic_events.html
@@ -162,20 +162,16 @@ const kEventConstructors = {
   GamepadButtonEvent:                        { create: function (aName, aProps) {
                                                          return new GamepadButtonEvent(aName, aProps);
                                                        },
                                              },
   HashChangeEvent:                           { create: function (aName, aProps) {
                                                          return new HashChangeEvent(aName, aProps);
                                                        },
                                              },
-  IccCardLockErrorEvent:                     { create: function (aName, aProps) {
-                                                          return new IccCardLockErrorEvent(aName, aProps);
-                                                       },
-                                             },
   IDBVersionChangeEvent:                     { create: function (aName, aProps) {
                                                          return new IDBVersionChangeEvent(aName, aProps);
                                                        },
                                              },
   KeyEvent:                                  { create: function (aName, aProps) {
                                                          var e = document.createEvent("keyboardevent");
                                                          e.initKeyEvent(aName, aProps.bubbles, aProps.cancelable,
                                                                         aProps.view,
--- a/dom/apps/src/OperatorApps.jsm
+++ b/dom/apps/src/OperatorApps.jsm
@@ -54,18 +54,16 @@ function isFirstRunWithSIM() {
 }
 
 #ifdef MOZ_B2G_RIL
 let iccListener = {
   notifyStkCommand: function() {},
 
   notifyStkSessionEnd: function() {},
 
-  notifyIccCardLockError: function() {},
-
   notifyCardStateChanged: function() {},
 
   notifyIccInfoChanged: function() {
     let iccInfo = iccProvider.iccInfo;
     if (iccInfo && iccInfo.mcc && iccInfo.mnc) {
       debug("******* iccListener cardIccInfo MCC-MNC: " + iccInfo.mcc +
             "-" + iccInfo.mnc);
       iccProvider.unregisterIccMsg(this);
--- a/dom/bluetooth/BluetoothRilListener.cpp
+++ b/dom/bluetooth/BluetoothRilListener.cpp
@@ -49,23 +49,16 @@ IccListener::NotifyStkCommand(const nsAS
 
 NS_IMETHODIMP
 IccListener::NotifyStkSessionEnd()
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
-IccListener::NotifyIccCardLockError(const nsAString & lockType,
-                                    uint32_t retryCount)
-{
-  return NS_OK;
-}
-
-NS_IMETHODIMP
 IccListener::NotifyCardStateChanged()
 {
   return NS_OK;
 }
 
 /**
  *  MobileConnectionListener
  */
--- a/dom/icc/interfaces/moz.build
+++ b/dom/icc/interfaces/moz.build
@@ -1,15 +1,14 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # 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/.
 
 XPIDL_SOURCES += [
     'SimToolKit.idl',
-    'nsIDOMIccCardLockErrorEvent.idl',
     'nsIDOMIccInfo.idl',
     'nsIDOMIccManager.idl',
     'nsIIccProvider.idl',
 ]
 
 XPIDL_MODULE = 'dom_icc'
deleted file mode 100644
--- a/dom/icc/interfaces/nsIDOMIccCardLockErrorEvent.idl
+++ /dev/null
@@ -1,24 +0,0 @@
-/* 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/. */
-
-#include "nsIDOMEvent.idl"
-
-[scriptable, builtinclass, uuid(47d4db10-a258-11e2-9e96-0800200c9a66)]
-interface nsIDOMIccCardLockErrorEvent : nsIDOMEvent
-{
-  readonly attribute DOMString lockType;
-  readonly attribute long retryCount;
-
-  [noscript] void initIccCardLockErrorEvent(in DOMString aType,
-                                            in boolean aCanBubble,
-                                            in boolean aCancelable,
-                                            in DOMString aLockType,
-                                            in int32_t aRetryCount);
-};
-
-dictionary IccCardLockErrorEventInit : EventInit
-{
-  DOMString  lockType;
-  long       retryCount;
-};
--- a/dom/icc/interfaces/nsIDOMIccManager.idl
+++ b/dom/icc/interfaces/nsIDOMIccManager.idl
@@ -5,17 +5,17 @@
 #include "nsIDOMEventTarget.idl"
 #include "SimToolKit.idl"
 
 interface nsIDOMContact;
 interface nsIDOMDOMRequest;
 interface nsIDOMEventListener;
 interface nsIDOMMozIccInfo;
 
-[scriptable, builtinclass, uuid(904b92cb-dad3-416f-88cf-0291012cf448)]
+[scriptable, builtinclass, uuid(6b5875dc-de44-4681-84a1-9ea12d60fbe2)]
 interface nsIDOMMozIccManager : nsIDOMEventTarget
 {
   /**
    * STK Menu Presentation types.
    */
   const unsigned short STK_MENU_TYPE_NOT_SPECIFIED      = 0x00;
   const unsigned short STK_MENU_TYPE_DATA_VALUES        = 0x01;
   const unsigned short STK_MENU_TYPE_NAVIGATION_OPTIONS = 0x03;
@@ -454,26 +454,16 @@ interface nsIDOMMozIccManager : nsIDOMEv
    *     {
    *       lockType: "pin",
    *       success: true
    *     }
    */
   nsIDOMDOMRequest setCardLock(in jsval info);
 
   /**
-   * The 'icccardlockerror' event is notified whenever 'unlockCardLock' or
-   * 'setCardLock' fails.
-   *
-   * The result will be an object containing information
-   * about the specified lock's status,
-   * e.g. {lockType: "pin", retryCount: 2}.
-   */
-  [implicit_jscontext] attribute jsval onicccardlockerror;
-
-  /**
    * Retrieve the number of remaining tries for unlocking the card.
    *
    * @param lockType
    *        Identifies the lock type, e.g. "pin" for the PIN lock, "puk" for
    *        the PUK lock.
    *
    * @return a DOM Request.
    *         If the lock type is "pin", or "puk", the request's result will be
--- a/dom/icc/interfaces/nsIIccProvider.idl
+++ b/dom/icc/interfaces/nsIIccProvider.idl
@@ -4,23 +4,21 @@
 
 #include "nsISupports.idl"
 
 interface nsIDOMContact;
 interface nsIDOMDOMRequest;
 interface nsIDOMMozIccInfo;
 interface nsIDOMWindow;
 
-[scriptable, uuid(82d25440-c913-11e2-8b8b-0800200c9a66)]
+[scriptable, uuid(87e9ad03-e8e2-40d1-bf28-a6d287c31b93)]
 interface nsIIccListener : nsISupports
 {
   void notifyStkCommand(in DOMString aMessage);
   void notifyStkSessionEnd();
-  void notifyIccCardLockError(in DOMString lockType,
-                              in unsigned long retryCount);
   void notifyCardStateChanged();
   void notifyIccInfoChanged();
 };
 
 /**
  * XPCOM component (in the content process) that provides the ICC information.
  */
 [scriptable, uuid(52fa6780-c913-11e2-8b8b-0800200c9a66)]
--- a/dom/icc/src/IccManager.cpp
+++ b/dom/icc/src/IccManager.cpp
@@ -1,15 +1,14 @@
 /* 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/. */
 
 #include "mozilla/Services.h"
 #include "nsIDOMClassInfo.h"
-#include "nsIDOMIccCardLockErrorEvent.h"
 #include "nsIDOMIccInfo.h"
 #include "GeneratedEvents.h"
 #include "IccManager.h"
 #include "SimToolKit.h"
 #include "StkCommandEvent.h"
 
 #define NS_RILCONTENTHELPER_CONTRACTID "@mozilla.org/ril/content-helper;1"
 
@@ -243,17 +242,16 @@ IccManager::UpdateContact(const nsAStrin
     return NS_ERROR_FAILURE;
   }
 
   return mProvider->UpdateContact(GetOwner(), aContactType, aContact, aPin2, aRequest);
 }
 
 NS_IMPL_EVENT_HANDLER(IccManager, stkcommand)
 NS_IMPL_EVENT_HANDLER(IccManager, stksessionend)
-NS_IMPL_EVENT_HANDLER(IccManager, icccardlockerror)
 NS_IMPL_EVENT_HANDLER(IccManager, cardstatechange)
 NS_IMPL_EVENT_HANDLER(IccManager, iccinfochange)
 
 // nsIIccListener
 
 NS_IMETHODIMP
 IccManager::NotifyStkCommand(const nsAString& aMessage)
 {
@@ -265,31 +263,16 @@ IccManager::NotifyStkCommand(const nsASt
 
 NS_IMETHODIMP
 IccManager::NotifyStkSessionEnd()
 {
   return DispatchTrustedEvent(NS_LITERAL_STRING("stksessionend"));
 }
 
 NS_IMETHODIMP
-IccManager::NotifyIccCardLockError(const nsAString& aLockType, uint32_t aRetryCount)
-{
-  nsCOMPtr<nsIDOMEvent> event;
-  NS_NewDOMIccCardLockErrorEvent(getter_AddRefs(event), this, nullptr, nullptr);
-
-  nsCOMPtr<nsIDOMIccCardLockErrorEvent> ce = do_QueryInterface(event);
-  nsresult rv =
-    ce->InitIccCardLockErrorEvent(NS_LITERAL_STRING("icccardlockerror"),
-                                  false, false, aLockType, aRetryCount);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  return DispatchTrustedEvent(ce);
-}
-
-NS_IMETHODIMP
 IccManager::NotifyCardStateChanged()
 {
   return DispatchTrustedEvent(NS_LITERAL_STRING("cardstatechange"));
 }
 
 NS_IMETHODIMP
 IccManager::NotifyIccInfoChanged()
 {
--- a/dom/icc/tests/marionette/test_icc_card_lock.js
+++ b/dom/icc/tests/marionette/test_icc_card_lock.js
@@ -33,43 +33,24 @@ function testPinChangeFailed() {
      pin: "1111",
      newPin: "0000"});
 
   ok(request instanceof DOMRequest,
      "request instanceof " + request.constructor);
 
   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);
 
     resetPinRetries("0000", runNextTest);
   };
 }
 
-/* Test PIN code changes fail notification */
-function testPinChangeFailedNotification() {
-  icc.addEventListener("icccardlockerror", function onicccardlockerror(result) {
-    icc.removeEventListener("icccardlockerror", onicccardlockerror);
-
-    is(result.lockType, "pin");
-    // The default pin retries is 3, failed once becomes to 2
-    is(result.retryCount, 2);
-
-    resetPinRetries("0000", runNextTest);
-  });
-
-  // The default pin is '0000' in emulator
-  let request = icc.setCardLock(
-    {lockType: "pin",
-     pin: "1111",
-     newPin: "0000"});
-
-  ok(request instanceof DOMRequest,
-     "request instanceof " + request.constructor);
-}
-
 /* Test PIN code changes success */
 function testPinChangeSuccess() {
   // The default pin is '0000' in emulator
   let request = icc.setCardLock(
     {lockType: "pin",
      pin: "0000",
      newPin: "0000"});
 
@@ -154,17 +135,16 @@ function testInvalidCardLockRetryCount()
     is(request.error.name, 'GenericFailure',
         'error name is ' + request.error.name);
     runNextTest();
   };
 }
 
 let tests = [
   testPinChangeFailed,
-  testPinChangeFailedNotification,
   testPinChangeSuccess,
   testPinCardLockRetryCount,
   testPukCardLockRetryCount,
   testInvalidCardLockRetryCount
 ];
 
 function runNextTest() {
   let test = tests.shift();
--- a/dom/system/gonk/RILContentHelper.js
+++ b/dom/system/gonk/RILContentHelper.js
@@ -60,16 +60,18 @@ const VOICEMAILSTATUS_CID=
 const MOBILECFINFO_CID=
   Components.ID("{a4756f16-e728-4d9f-8baa-8464f894888a}");
 const CELLBROADCASTMESSAGE_CID =
   Components.ID("{29474c96-3099-486f-bb4a-3c9a1da834e4}");
 const CELLBROADCASTETWSINFO_CID =
   Components.ID("{59f176ee-9dcd-4005-9d47-f6be0cd08e17}");
 const DOMMMIERROR_CID =
   Components.ID("{6b204c42-7928-4e71-89ad-f90cd82aff96}");
+const ICCCARDLOCKERROR_CID =
+  Components.ID("{08a71987-408c-44ff-93fd-177c0a85c3dd}");
 
 const RIL_IPC_MSG_NAMES = [
   "RIL:CardStateChanged",
   "RIL:IccInfoChanged",
   "RIL:VoiceInfoChanged",
   "RIL:DataInfoChanged",
   "RIL:GetAvailableNetworks",
   "RIL:NetworkSelectionModeChanged",
@@ -427,16 +429,30 @@ DOMMMIError.prototype = {
                    message,
                    additionalInformation) {
     this.__DOM_IMPL__.init(name, message);
     this.serviceCode = serviceCode;
     this.additionalInformation = additionalInformation;
   },
 };
 
+function IccCardLockError() {
+}
+IccCardLockError.prototype = {
+  classDescription: "IccCardLockError",
+  classID:          ICCCARDLOCKERROR_CID,
+  contractID:       "@mozilla.org/dom/icccardlock-error;1",
+  QueryInterface:   XPCOMUtils.generateQI([Ci.nsISupports]),
+  __init: function(lockType, errorMsg, retryCount) {
+    this.__DOM_IMPL__.init(errorMsg);
+    this.lockType = lockType;
+    this.retryCount = retryCount;
+  },
+};
+
 function RILContentHelper() {
   this.rilContext = {
     cardState:            RIL.GECKO_CARDSTATE_UNKNOWN,
     networkSelectionMode: RIL.GECKO_NETWORK_SELECTION_UNKNOWN,
     iccInfo:              null,
     voiceConnectionInfo:  new MobileConnectionInfo(),
     dataConnectionInfo:   new MobileConnectionInfo()
   };
@@ -769,16 +785,18 @@ RILContentHelper.prototype = {
 
   getCardLockState: function getCardLockState(window, lockType) {
     if (window == null) {
       throw Components.Exception("Can't get window object",
                                   Cr.NS_ERROR_UNEXPECTED);
     }
     let request = Services.DOMRequest.createRequest(window);
     let requestId = this.getRequestId(request);
+    this._windowsMap[requestId] = window;
+
     cpmm.sendAsyncMessage("RIL:GetCardLockState", {
       clientId: 0,
       data: {
         lockType: lockType,
         requestId: requestId
       }
     });
     return request;
@@ -786,30 +804,34 @@ RILContentHelper.prototype = {
 
   unlockCardLock: function unlockCardLock(window, info) {
     if (window == null) {
       throw Components.Exception("Can't get window object",
                                   Cr.NS_ERROR_UNEXPECTED);
     }
     let request = Services.DOMRequest.createRequest(window);
     info.requestId = this.getRequestId(request);
+    this._windowsMap[info.requestId] = window;
+
     cpmm.sendAsyncMessage("RIL:UnlockCardLock", {
       clientId: 0,
       data: info
     });
     return request;
   },
 
   setCardLock: function setCardLock(window, info) {
     if (window == null) {
       throw Components.Exception("Can't get window object",
                                   Cr.NS_ERROR_UNEXPECTED);
     }
     let request = Services.DOMRequest.createRequest(window);
     info.requestId = this.getRequestId(request);
+    this._windowsMap[info.requestId] = window;
+
     cpmm.sendAsyncMessage("RIL:SetCardLock", {
       clientId: 0,
       data: info
     });
     return request;
   },
 
   getCardLockRetryCount: function getCardLockRetryCount(window, lockType) {
@@ -1433,16 +1455,29 @@ RILContentHelper.prototype = {
 
   dispatchFireRequestError: function dispatchFireRequestError(requestId, error) {
     let currentThread = Services.tm.currentThread;
 
     currentThread.dispatch(this.fireRequestError.bind(this, requestId, error),
                            Ci.nsIThread.DISPATCH_NORMAL);
   },
 
+  fireRequestDetailedError: function fireRequestDetailedError(requestId, detailedError) {
+    let request = this.takeRequest(requestId);
+    if (!request) {
+      if (DEBUG) {
+        debug("not firing detailed error for id: " + requestId +
+              ", detailedError: " + JSON.stringify(detailedError));
+      }
+      return;
+    }
+
+    Services.DOMRequest.fireDetailedError(request, detailedError);
+  },
+
   receiveMessage: function receiveMessage(msg) {
     let request;
     debug("Received message '" + msg.name + "': " + JSON.stringify(msg.json));
 
     let data = msg.json.data;
     switch (msg.name) {
       case "RIL:CardStateChanged":
         if (this.rilContext.cardState != data.cardState) {
@@ -1490,30 +1525,37 @@ RILContentHelper.prototype = {
                                  RIL.GECKO_NETWORK_SELECTION_AUTOMATIC);
         break;
       case "RIL:VoicemailNotification":
         this.handleVoicemailNotification(data);
         break;
       case "RIL:VoicemailInfoChanged":
         this.updateInfo(data, this.voicemailInfo);
         break;
-      case "RIL:CardLockResult":
+      case "RIL:CardLockResult": {
+        let requestId = data.requestId;
+        let requestWindow = this._windowsMap[requestId];
+        delete this._windowsMap[requestId];
+
         if (data.success) {
           let result = new MobileIccCardLockResult(data);
-          this.fireRequestSuccess(data.requestId, result);
+          this.fireRequestSuccess(requestId, result);
         } else {
           if (data.rilMessageType == "iccSetCardLock" ||
               data.rilMessageType == "iccUnlockCardLock") {
-            this._deliverEvent("_iccListeners",
-                               "notifyIccCardLockError",
-                               [data.lockType, data.retryCount]);
+            let cardLockError = new requestWindow.IccCardLockError(data.lockType,
+                                                                   data.errorMsg,
+                                                                   data.retryCount);
+            this.fireRequestDetailedError(requestId, cardLockError);
+          } else {
+            this.fireRequestError(requestId, data.errorMsg);
           }
-          this.fireRequestError(data.requestId, data.errorMsg);
         }
         break;
+      }
       case "RIL:CardLockRetryCount":
         if (data.success) {
           let result = new MobileIccCardLockRetryCount(data);
           this.fireRequestSuccess(data.requestId, result);
         } else {
           this.fireRequestError(data.requestId, data.errorMsg);
         }
         break;
@@ -1921,10 +1963,11 @@ RILContentHelper.prototype = {
       return false;
     }
 
     return true;
   }
 };
 
 this.NSGetFactory = XPCOMUtils.generateNSGetFactory([RILContentHelper,
-                                                     DOMMMIError]);
+                                                     DOMMMIError,
+                                                     IccCardLockError]);
 
--- a/dom/system/gonk/RadioInterfaceLayer.manifest
+++ b/dom/system/gonk/RadioInterfaceLayer.manifest
@@ -15,11 +15,13 @@
 # RadioInterfaceLayer.js
 component {2d831c8d-6017-435b-a80c-e5d422810cea} RadioInterfaceLayer.js
 contract @mozilla.org/ril;1 {2d831c8d-6017-435b-a80c-e5d422810cea}
 category profile-after-change RadioInterfaceLayer @mozilla.org/ril;1
 
 # RILContentHelper.js
 component {472816e1-1fd6-4405-996c-806f9ea68174} RILContentHelper.js
 component {6b204c42-7928-4e71-89ad-f90cd82aff96} RILContentHelper.js
+component {08a71987-408c-44ff-93fd-177c0a85c3dd} RILContentHelper.js
 contract @mozilla.org/ril/content-helper;1 {472816e1-1fd6-4405-996c-806f9ea68174}
 contract @mozilla.org/dom/mmi-error;1 {6b204c42-7928-4e71-89ad-f90cd82aff96}
+contract @mozilla.org/dom/icccardlock-error;1 {08a71987-408c-44ff-93fd-177c0a85c3dd}
 category profile-after-change RILContentHelper @mozilla.org/ril/content-helper;1
--- a/dom/tests/mochitest/general/test_interfaces.html
+++ b/dom/tests/mochitest/general/test_interfaces.html
@@ -275,17 +275,17 @@ var interfaceNamesInGlobalScope =
     "HTMLTableSectionElement",
     "HTMLTemplateElement",
     "HTMLTextAreaElement",
     "HTMLTimeElement",
     "HTMLTitleElement",
     "HTMLUListElement",
     "HTMLUnknownElement",
     "HTMLVideoElement",
-    {name: "IccCardLockErrorEvent", b2g: true},
+    {name: "IccCardLockError", b2g: true},
     "IDBCursor",
     "IDBCursorWithValue",
     "IDBDatabase",
     "IDBFactory",
     "IDBFileHandle",
     "IDBIndex",
     "IDBKeyRange",
     "IDBObjectStore",
new file mode 100644
--- /dev/null
+++ b/dom/webidl/IccCardLockError.webidl
@@ -0,0 +1,12 @@
+/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* 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/.
+*/
+
+[JSImplementation="@mozilla.org/dom/icccardlock-error;1",
+ Constructor(DOMString lockType, DOMString errorName, short retryCount)]
+interface IccCardLockError : DOMError {
+  readonly attribute DOMString lockType;
+  readonly attribute short retryCount;
+};
deleted file mode 100644
--- a/dom/webidl/IccCardLockErrorEvent.webidl
+++ /dev/null
@@ -1,18 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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/.
- */
-
-[Constructor(DOMString type, optional IccCardLockErrorEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
-interface IccCardLockErrorEvent : Event
-{
-  readonly attribute DOMString? lockType;
-  readonly attribute long retryCount;
-};
-
-dictionary IccCardLockErrorEventInit : EventInit
-{
-  DOMString lockType = "";
-  long retryCount = 0;
-};
--- a/dom/webidl/moz.build
+++ b/dom/webidl/moz.build
@@ -499,17 +499,17 @@ if CONFIG['MOZ_B2G_BT']:
         'BluetoothManager.webidl',
         'BluetoothStatusChangedEvent.webidl',
     ]
 
 if CONFIG['MOZ_B2G_RIL']:
     WEBIDL_FILES += [
         'CFStateChangeEvent.webidl',
         'DataErrorEvent.webidl',
-        'IccCardLockErrorEvent.webidl',
+        'IccCardLockError.webidl',
         'MozCellBroadcast.webidl',
         'MozCellBroadcastEvent.webidl',
         'MozEmergencyCbModeEvent.webidl',
         'MozOtaStatusEvent.webidl',
         'MozVoicemailEvent.webidl',
         'MozWifiConnectionInfoEvent.webidl',
         'MozWifiStatusChangeEvent.webidl',
         'USSDReceivedEvent.webidl',
--- a/js/xpconnect/src/event_impl_gen.conf.in
+++ b/js/xpconnect/src/event_impl_gen.conf.in
@@ -26,17 +26,16 @@ simple_events = [
     'StyleSheetApplicableStateChangeEvent',
 #ifdef MOZ_B2G_BT
     'BluetoothDeviceEvent',
     'BluetoothStatusChangedEvent',
 #endif
 #ifdef MOZ_B2G_RIL
     'CFStateChangeEvent',
     'DataErrorEvent',
-    'IccCardLockErrorEvent',
     'MozEmergencyCbModeEvent',
     'MozOtaStatusEvent',
     'MozWifiStatusChangeEvent',
     'MozWifiConnectionInfoEvent',
     'MozCellBroadcastEvent',
     'MozVoicemailEvent',
     'USSDReceivedEvent',
 #endif