Bug 956240 - WebMobileConnection: Use webidl event generator for the event that is dispatched by mozMobileConnection. r=smaug
authorEdgar Chen <echen@mozilla.com>
Fri, 03 Jan 2014 13:55:27 +0800
changeset 162130 66ffd474bf5b55402893667b3d65c64332c19053
parent 162129 f5c75106526faa2a806ea795f9a87663c331b659
child 162131 7c0aa4d6c5254543cab079ff887cc83d543fef9b
push id25935
push useremorley@mozilla.com
push dateMon, 06 Jan 2014 12:51:13 +0000
treeherdermozilla-central@1e3f7c95293c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs956240
milestone29.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 956240 - WebMobileConnection: Use webidl event generator for the event that is dispatched by mozMobileConnection. r=smaug
dom/network/interfaces/moz.build
dom/network/interfaces/nsIDOMCFStateChangeEvent.idl
dom/network/interfaces/nsIDOMDataErrorEvent.idl
dom/network/interfaces/nsIDOMMozEmergencyCbModeEvent.idl
dom/network/interfaces/nsIDOMMozOtaStatusEvent.idl
dom/network/interfaces/nsIDOMUSSDReceivedEvent.idl
dom/network/src/MobileConnection.cpp
dom/webidl/CFStateChangeEvent.webidl
dom/webidl/DataErrorEvent.webidl
dom/webidl/MozEmergencyCbModeEvent.webidl
dom/webidl/MozOtaStatusEvent.webidl
dom/webidl/USSDReceivedEvent.webidl
dom/webidl/moz.build
js/xpconnect/src/event_impl_gen.conf.in
--- a/dom/network/interfaces/moz.build
+++ b/dom/network/interfaces/moz.build
@@ -13,22 +13,17 @@ XPIDL_SOURCES += [
     'nsITCPServerSocketParent.idl',
     'nsITCPSocketChild.idl',
     'nsITCPSocketParent.idl',
     'nsIUDPSocketChild.idl',
 ]
 
 if CONFIG['MOZ_B2G_RIL']:
     XPIDL_SOURCES += [
-        'nsIDOMCFStateChangeEvent.idl',
-        'nsIDOMDataErrorEvent.idl',
         'nsIDOMMobileConnection.idl',
-        'nsIDOMMozEmergencyCbModeEvent.idl',
-        'nsIDOMMozOtaStatusEvent.idl',
-        'nsIDOMUSSDReceivedEvent.idl',
         'nsIMobileConnectionProvider.idl',
     ]
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
     XPIDL_SOURCES += [
         'nsIDOMNetworkStats.idl',
         'nsIDOMNetworkStatsManager.idl',
         'nsINetworkStatsServiceProxy.idl',
deleted file mode 100644
--- a/dom/network/interfaces/nsIDOMCFStateChangeEvent.idl
+++ /dev/null
@@ -1,74 +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(905348f1-3d06-443c-8762-567e7e4b6696)]
-interface nsIDOMCFStateChangeEvent : nsIDOMEvent
-{
-  /**
-   * Indicates about errors while setting up the Call forwarding rule.
-   */
-  readonly attribute boolean success;
-
-  /**
-   * Indicates what to do with the rule.
-   *
-   * One of the CALL_FORWARD_ACTION_* constants. It will be either disable (0),
-   * enable (1), query status (2), registration (3), or erasure (4).
-   *
-   * @see 3GPP nsIDOMMozMobileCFInfo.CALL_FORWARD_ACTION_* values.
-   * @see 3GPP TS 27.007 7.11 "mode".
-   */
-  readonly attribute unsigned short action;
-
-  /**
-   * Indicates the reason the call is being forwarded.
-   *
-   * One of the CALL_FORWARD_REASON_* constants. It will be either
-   * unconditional (0), mobile busy (1), no reply (2), not reachable (3),
-   * all call forwarding (4), or all conditional call forwarding (5).
-   *
-   * @see 3GPP nsIDOMMozMobileCFInfo.CALL_FORWARD_REASON_* values.
-   * @see 3GPP TS 27.007 7.11 "reason".
-   */
-  readonly attribute unsigned short reason;
-
-  /**
-   * Phone number of forwarding address.
-   */
-  readonly attribute DOMString number;
-
-  /**
-   * When "no reply" is enabled or queried, this gives the time in
-   * seconds to wait before call is forwarded.
-   */
-  readonly attribute unsigned short timeSeconds;
-
-  /**
-   * Service for which the call forward is set up. It should be one of the
-   * nsIDOMMozMobileConnectionInfo.ICC_SERVICE_CLASS_* values.
-   */
-  readonly attribute unsigned short serviceClass;
-
-  [noscript] void initCFStateChangeEvent(in DOMString aType,
-                                         in boolean aCanBubble,
-                                         in boolean aCancelable,
-                                         in boolean aSuccess,
-                                         in unsigned short aAction,
-                                         in unsigned short aReason,
-                                         in DOMString aNumber,
-                                         in unsigned short aTimeSeconds,
-                                         in unsigned short aServiceClass);
-};
-
-dictionary CFStateChangeEventInit : EventInit
-{
-  boolean success;
-  unsigned short action;
-  unsigned short reason;
-  DOMString number;
-  unsigned short timeSeconds;
-  unsigned short serviceClass;
-};
deleted file mode 100644
--- a/dom/network/interfaces/nsIDOMDataErrorEvent.idl
+++ /dev/null
@@ -1,21 +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(8b4ed443-a6b0-4445-aab0-9aa9fd5f6c1e)]
-interface nsIDOMDataErrorEvent : nsIDOMEvent
-{
-  readonly attribute DOMString message;
-
-  [noscript] void initDataErrorEvent(in DOMString aType,
-                                     in boolean aCanBubble,
-                                     in boolean aCancelable,
-                                     in DOMString aMessage);
-};
-
-dictionary DataErrorEventInit : EventInit
-{
-  DOMString message;
-};
deleted file mode 100644
--- a/dom/network/interfaces/nsIDOMMozEmergencyCbModeEvent.idl
+++ /dev/null
@@ -1,31 +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(15cc1010-f051-11e2-945c-60a44c237d2b)]
-interface nsIDOMMozEmergencyCbModeEvent : nsIDOMEvent
-{
-  /**
-   * Whether the mode is activated.
-   */
-  readonly attribute boolean active;
-
-  /**
-   * Automatically exit the mode after the timeoutMs ms.
-   */
-  readonly attribute unsigned long timeoutMs;
-
-  [noscript] void initMozEmergencyCbModeEvent(in DOMString aType,
-                                              in boolean aCanBubble,
-                                              in boolean aCancelable,
-                                              in boolean aActive,
-                                              in unsigned long aTimeoutMs);
-};
-
-dictionary MozEmergencyCbModeEventInit : EventInit
-{
-  boolean active;
-  unsigned long timeoutMs;
-};
deleted file mode 100644
--- a/dom/network/interfaces/nsIDOMMozOtaStatusEvent.idl
+++ /dev/null
@@ -1,21 +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(d3592cdc-c5cf-4c24-a27c-6f789ac94959)]
-interface nsIDOMMozOtaStatusEvent : nsIDOMEvent
-{
-  readonly attribute DOMString status;
-
-  [noscript] void initMozOtaStatusEvent(in DOMString aType,
-                                        in boolean aCanBubble,
-                                        in boolean aCancelable,
-                                        in DOMString aStatus);
-};
-
-dictionary MozOtaStatusEventInit : EventInit
-{
-  DOMString status;
-};
deleted file mode 100644
--- a/dom/network/interfaces/nsIDOMUSSDReceivedEvent.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(d26880c8-0468-4abb-94a6-9143defb5545)]
-interface nsIDOMUSSDReceivedEvent : nsIDOMEvent
-{
-  readonly attribute DOMString message;
-  [infallible] readonly attribute boolean sessionEnded;
-
-  [noscript] void initUSSDReceivedEvent(in DOMString aType,
-                                        in boolean aCanBubble,
-                                        in boolean aCancelable,
-                                        in DOMString aMessage,
-                                        in boolean aSessionEnded);
-};
-
-dictionary USSDReceivedEventInit : EventInit
-{
-  DOMString? message;
-  boolean sessionEnded;
-};
--- a/dom/network/src/MobileConnection.cpp
+++ b/dom/network/src/MobileConnection.cpp
@@ -1,24 +1,24 @@
 /* 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/dom/network/MobileConnection.h"
 
 #include "GeneratedEvents.h"
+#include "mozilla/dom/CFStateChangeEvent.h"
+#include "mozilla/dom/DataErrorEvent.h"
+#include "mozilla/dom/MozEmergencyCbModeEvent.h"
+#include "mozilla/dom/MozOtaStatusEvent.h"
+#include "mozilla/dom/USSDReceivedEvent.h"
 #include "mozilla/Preferences.h"
 #include "nsDOMEvent.h"
-#include "nsIDOMCFStateChangeEvent.h"
 #include "nsIDOMClassInfo.h"
 #include "nsIDOMDOMRequest.h"
-#include "nsIDOMDataErrorEvent.h"
-#include "nsIDOMMozEmergencyCbModeEvent.h"
-#include "nsIDOMMozOtaStatusEvent.h"
-#include "nsIDOMUSSDReceivedEvent.h"
 #include "nsIPermissionManager.h"
 
 #include "nsJSUtils.h"
 #include "nsJSON.h"
 #include "mozilla/Services.h"
 
 #define NS_RILCONTENTHELPER_CONTRACTID "@mozilla.org/ril/content-helper;1"
 
@@ -605,110 +605,110 @@ MobileConnection::NotifyDataChanged()
 NS_IMETHODIMP
 MobileConnection::NotifyUssdReceived(const nsAString& aMessage,
                                      bool aSessionEnded)
 {
   if (!CheckPermission("mobileconnection")) {
     return NS_OK;
   }
 
-  nsCOMPtr<nsIDOMEvent> event;
-  NS_NewDOMUSSDReceivedEvent(getter_AddRefs(event), this, nullptr, nullptr);
+  USSDReceivedEventInit init;
+  init.mBubbles = false;
+  init.mCancelable = false;
+  init.mMessage = aMessage;
+  init.mSessionEnded = aSessionEnded;
 
-  nsCOMPtr<nsIDOMUSSDReceivedEvent> ce = do_QueryInterface(event);
-  nsresult rv = ce->InitUSSDReceivedEvent(NS_LITERAL_STRING("ussdreceived"),
-                                          false, false,
-                                          aMessage, aSessionEnded);
-  NS_ENSURE_SUCCESS(rv, rv);
+  nsRefPtr<USSDReceivedEvent> event =
+    USSDReceivedEvent::Constructor(this, NS_LITERAL_STRING("ussdreceived"), init);
 
-  return DispatchTrustedEvent(ce);
+  return DispatchTrustedEvent(event);
 }
 
 NS_IMETHODIMP
 MobileConnection::NotifyDataError(const nsAString& aMessage)
 {
   if (!CheckPermission("mobileconnection")) {
     return NS_OK;
   }
 
-  nsCOMPtr<nsIDOMEvent> event;
-  NS_NewDOMDataErrorEvent(getter_AddRefs(event), this, nullptr, nullptr);
+  DataErrorEventInit init;
+  init.mBubbles = false;
+  init.mCancelable = false;
+  init.mMessage = aMessage;
 
-  nsCOMPtr<nsIDOMDataErrorEvent> ce = do_QueryInterface(event);
-  nsresult rv = ce->InitDataErrorEvent(NS_LITERAL_STRING("dataerror"),
-                                       false, false, aMessage);
-  NS_ENSURE_SUCCESS(rv, rv);
+  nsRefPtr<DataErrorEvent> event =
+    DataErrorEvent::Constructor(this, NS_LITERAL_STRING("dataerror"), init);
 
-  return DispatchTrustedEvent(ce);
+  return DispatchTrustedEvent(event);
 }
 
 NS_IMETHODIMP
 MobileConnection::NotifyCFStateChange(bool aSuccess,
                                       unsigned short aAction,
                                       unsigned short aReason,
                                       const nsAString& aNumber,
                                       unsigned short aSeconds,
                                       unsigned short aServiceClass)
 {
   if (!CheckPermission("mobileconnection")) {
     return NS_OK;
   }
 
-  nsCOMPtr<nsIDOMEvent> event;
-  NS_NewDOMCFStateChangeEvent(getter_AddRefs(event), this, nullptr, nullptr);
+  CFStateChangeEventInit init;
+  init.mBubbles = false;
+  init.mCancelable = false;
+  init.mSuccess = aSuccess;
+  init.mAction = aAction;
+  init.mReason = aReason;
+  init.mNumber = aNumber;
+  init.mTimeSeconds = aSeconds;
+  init.mServiceClass = aServiceClass;
 
-  nsCOMPtr<nsIDOMCFStateChangeEvent> ce = do_QueryInterface(event);
-  nsresult rv = ce->InitCFStateChangeEvent(NS_LITERAL_STRING("cfstatechange"),
-                                           false, false,
-                                           aSuccess, aAction, aReason, aNumber,
-                                           aSeconds, aServiceClass);
-  NS_ENSURE_SUCCESS(rv, rv);
+  nsRefPtr<CFStateChangeEvent> event =
+    CFStateChangeEvent::Constructor(this, NS_LITERAL_STRING("cfstatechange"), init);
 
-  return DispatchTrustedEvent(ce);
+  return DispatchTrustedEvent(event);
 }
 
 NS_IMETHODIMP
 MobileConnection::NotifyEmergencyCbModeChanged(bool aActive,
                                                uint32_t aTimeoutMs)
 {
   if (!CheckPermission("mobileconnection")) {
     return NS_OK;
   }
 
-  nsCOMPtr<nsIDOMEvent> event;
-  NS_NewDOMMozEmergencyCbModeEvent(getter_AddRefs(event), this, nullptr,
-                                   nullptr);
-  MOZ_ASSERT(event);
+  MozEmergencyCbModeEventInit init;
+  init.mBubbles = false;
+  init.mCancelable = false;
+  init.mActive = aActive;
+  init.mTimeoutMs = aTimeoutMs;
 
-  nsCOMPtr<nsIDOMMozEmergencyCbModeEvent> ce = do_QueryInterface(event);
-  nsresult rv = ce->InitMozEmergencyCbModeEvent(
-      NS_LITERAL_STRING("emergencycbmodechange"), false, false,
-      aActive, aTimeoutMs);
-  NS_ENSURE_SUCCESS(rv, rv);
+  nsRefPtr<MozEmergencyCbModeEvent> event =
+    MozEmergencyCbModeEvent::Constructor(this, NS_LITERAL_STRING("emergencycbmodechange"), init);
 
-  return DispatchTrustedEvent(ce);
+  return DispatchTrustedEvent(event);
 }
 
 NS_IMETHODIMP
 MobileConnection::NotifyOtaStatusChanged(const nsAString& aStatus)
 {
   if (!CheckPermission("mobileconnection")) {
     return NS_OK;
   }
 
-  nsCOMPtr<nsIDOMEvent> event;
-  NS_NewDOMMozOtaStatusEvent(getter_AddRefs(event), this, nullptr, nullptr);
-  MOZ_ASSERT(event);
+  MozOtaStatusEventInit init;
+  init.mBubbles = false;
+  init.mCancelable = false;
+  init.mStatus = aStatus;
 
-  nsCOMPtr<nsIDOMMozOtaStatusEvent> ce = do_QueryInterface(event);
-  nsresult rv = ce->InitMozOtaStatusEvent(NS_LITERAL_STRING("otastatuschange"),
-                                          false, false, aStatus);
-  NS_ENSURE_SUCCESS(rv, rv);
+  nsRefPtr<MozOtaStatusEvent> event =
+    MozOtaStatusEvent::Constructor(this, NS_LITERAL_STRING("otastatuschange"), init);
 
-  return DispatchTrustedEvent(ce);
+  return DispatchTrustedEvent(event);
 }
 
 NS_IMETHODIMP
 MobileConnection::NotifyIccChanged()
 {
   if (!CheckPermission("mobileconnection")) {
     return NS_OK;
   }
--- a/dom/webidl/CFStateChangeEvent.webidl
+++ b/dom/webidl/CFStateChangeEvent.webidl
@@ -1,22 +1,61 @@
 /* -*- 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 CFStateChangeEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
+[Pref="dom.mobileconnection.enabled",
+ Constructor(DOMString type, optional CFStateChangeEventInit eventInitDict)]
 interface CFStateChangeEvent : Event
 {
+  /**
+   * Indicates about errors while setting up the Call forwarding rule.
+   */
   readonly attribute boolean success;
+
+  /**
+   * Indicates what to do with the rule.
+   *
+   * One of the CALL_FORWARD_ACTION_* constants. It will be either disable (0),
+   * enable (1), query status (2), registration (3), or erasure (4).
+   *
+   * @see 3GPP nsIDOMMozMobileCFInfo.CALL_FORWARD_ACTION_* values.
+   * @see 3GPP TS 27.007 7.11 "mode".
+   */
   readonly attribute unsigned short action;
+
+  /**
+   * Indicates the reason the call is being forwarded.
+   *
+   * One of the CALL_FORWARD_REASON_* constants. It will be either
+   * unconditional (0), mobile busy (1), no reply (2), not reachable (3),
+   * all call forwarding (4), or all conditional call forwarding (5).
+   *
+   * @see 3GPP nsIDOMMozMobileCFInfo.CALL_FORWARD_REASON_* values.
+   * @see 3GPP TS 27.007 7.11 "reason".
+   */
   readonly attribute unsigned short reason;
+
+  /**
+   * Phone number of forwarding address.
+   */
   readonly attribute DOMString? number;
+
+  /**
+   * When "no reply" is enabled or queried, this gives the time in
+   * seconds to wait before call is forwarded.
+   */
   readonly attribute unsigned short timeSeconds;
+
+  /**
+   * Service for which the call forward is set up. It should be one of the
+   * nsIDOMMozMobileConnectionInfo.ICC_SERVICE_CLASS_* values.
+   */
   readonly attribute unsigned short serviceClass;
 };
 
 dictionary CFStateChangeEventInit : EventInit
 {
   boolean success = false;
   unsigned short action = 0;
   unsigned short reason = 0;
--- a/dom/webidl/DataErrorEvent.webidl
+++ b/dom/webidl/DataErrorEvent.webidl
@@ -1,15 +1,16 @@
 /* -*- 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 DataErrorEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
+[Pref="dom.mobileconnection.enabled",
+ Constructor(DOMString type, optional DataErrorEventInit eventInitDict)]
 interface DataErrorEvent : Event
 {
   readonly attribute DOMString? message;
 };
 
 dictionary DataErrorEventInit : EventInit
 {
   DOMString message = "";
--- a/dom/webidl/MozEmergencyCbModeEvent.webidl
+++ b/dom/webidl/MozEmergencyCbModeEvent.webidl
@@ -1,20 +1,26 @@
 /* -*- 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 MozEmergencyCbModeEventInit eventInitDict),
- HeaderFile="GeneratedEventClasses.h"]
+[Pref="dom.mobileconnection.enabled",
+ Constructor(DOMString type, optional MozEmergencyCbModeEventInit eventInitDict)]
 interface MozEmergencyCbModeEvent : Event
 {
-  readonly attribute boolean        active;
-  readonly attribute unsigned long  timeoutMs;
+  /**
+   * Whether the mode is activated.
+   */
+  readonly attribute boolean active;
+
+  /**
+   * Automatically exit the mode after the timeoutMs ms.
+   */
+  readonly attribute unsigned long timeoutMs;
 };
 
 dictionary MozEmergencyCbModeEventInit : EventInit
 {
   boolean active = false;
   unsigned long timeoutMs = 0;
 };
--- a/dom/webidl/MozOtaStatusEvent.webidl
+++ b/dom/webidl/MozOtaStatusEvent.webidl
@@ -1,16 +1,16 @@
 /* -*- 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 MozOtaStatusEventInit eventInitDict),
- HeaderFile="GeneratedEventClasses.h"]
+[Pref="dom.mobileconnection.enabled",
+ Constructor(DOMString type, optional MozOtaStatusEventInit eventInitDict)]
 interface MozOtaStatusEvent : Event
 {
   /**
    * One of the following values:
    *
    * spl_unlocked
    * spc_retries_exceeded
    * a_key_exchanged
--- a/dom/webidl/USSDReceivedEvent.webidl
+++ b/dom/webidl/USSDReceivedEvent.webidl
@@ -1,15 +1,16 @@
 /* -*- 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 USSDReceivedEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h", Pref="dom.icc.enabled"]
+[Pref="dom.mobileconnection.enabled",
+ Constructor(DOMString type, optional USSDReceivedEventInit eventInitDict)]
 interface USSDReceivedEvent : Event
 {
   readonly attribute DOMString? message;
   readonly attribute boolean sessionEnded;
 };
 
 dictionary USSDReceivedEventInit : EventInit
 {
--- a/dom/webidl/moz.build
+++ b/dom/webidl/moz.build
@@ -510,28 +510,23 @@ if CONFIG['MOZ_B2G_BT']:
         'BluetoothDevice.webidl',
         'BluetoothDeviceEvent.webidl',
         'BluetoothManager.webidl',
         'BluetoothStatusChangedEvent.webidl',
     ]
 
 if CONFIG['MOZ_B2G_RIL']:
     WEBIDL_FILES += [
-        'CFStateChangeEvent.webidl',
-        'DataErrorEvent.webidl',
         'IccCardLockError.webidl',
         'MozCellBroadcast.webidl',
         'MozCellBroadcastEvent.webidl',
-        'MozEmergencyCbModeEvent.webidl',
         'MozIcc.webidl',
         'MozMobileConnectionArray.webidl',
-        'MozOtaStatusEvent.webidl',
         'MozVoicemail.webidl',
         'MozVoicemailEvent.webidl',
-        'USSDReceivedEvent.webidl',
     ]
 
 if CONFIG['MOZ_NFC']:
     WEBIDL_FILES += [
          'MozNdefRecord.webidl',
          'MozNfc.webidl',
          'MozNFCPeer.webidl',
          'MozNFCTag.webidl',
@@ -553,30 +548,35 @@ if CONFIG['MOZ_WEBSPEECH']:
 if CONFIG['MOZ_B2G_FM']:
     WEBIDL_FILES += [
         'FMRadio.webidl',
     ]
 
 GENERATED_EVENTS_WEBIDL_FILES = [
     'BlobEvent.webidl',
     'CallGroupErrorEvent.webidl',
+    'CFStateChangeEvent.webidl',
+    'DataErrorEvent.webidl',
     'DataStoreChangeEvent.webidl',
     'DeviceLightEvent.webidl',
     'DeviceProximityEvent.webidl',
     'DownloadEvent.webidl',
     'ErrorEvent.webidl',
     'IccChangeEvent.webidl',
     'MediaStreamEvent.webidl',
     'MozContactChangeEvent.webidl',
+    'MozEmergencyCbModeEvent.webidl',
     'MozInterAppMessageEvent.webidl',
+    'MozOtaStatusEvent.webidl',
     'MozStkCommandEvent.webidl',
     'RTCDataChannelEvent.webidl',
     'RTCPeerConnectionIceEvent.webidl',
     'TrackEvent.webidl',
     'UserProximityEvent.webidl',
+    'USSDReceivedEvent.webidl',
 ]
 
 if CONFIG['MOZ_GAMEPAD']:
     GENERATED_EVENTS_WEBIDL_FILES += [
         'GamepadAxisMoveEvent.webidl',
         'GamepadButtonEvent.webidl',
         'GamepadEvent.webidl',
     ]
--- a/js/xpconnect/src/event_impl_gen.conf.in
+++ b/js/xpconnect/src/event_impl_gen.conf.in
@@ -27,23 +27,18 @@ simple_events = [
     'MozWifiStatusChangeEvent',
     'MozWifiConnectionInfoEvent',
 #endif
 #ifdef MOZ_B2G_BT
     'BluetoothDeviceEvent',
     'BluetoothStatusChangedEvent',
 #endif
 #ifdef MOZ_B2G_RIL
-    'CFStateChangeEvent',
-    'DataErrorEvent',
-    'MozEmergencyCbModeEvent',
-    'MozOtaStatusEvent',
     'MozCellBroadcastEvent',
     'MozVoicemailEvent',
-    'USSDReceivedEvent',
 #endif
     'ElementReplaceEvent',
     'MozSmsEvent',
     'MozMmsEvent',
 #ifdef MOZ_WEBSPEECH
     'SpeechSynthesisEvent',
 #endif
     'DeviceStorageChangeEvent',