Bug 843452 - Part 1-1: WEBIDL changes for MobileConnection IPDL. r=hsinyi,smaug
☠☠ backed out by de824c1ec349 ☠ ☠
authorEdgar Chen <echen@mozilla.com>
Wed, 26 Mar 2014 14:50:30 +0800
changeset 224028 9bd12641af031cd1693c52a0edc8aed9583aaf91
parent 224027 5fb042925c055f3fdb8002d34054fe71cb0a8ef6
child 224029 181337820a7cc992678276253c32a1691895fb88
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershsinyi, smaug
bugs843452
milestone34.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 843452 - Part 1-1: WEBIDL changes for MobileConnection IPDL. r=hsinyi,smaug
dom/mobileconnection/src/DOMMMIError.cpp
dom/mobileconnection/src/DOMMMIError.h
dom/mobileconnection/src/MobileNetworkInfo.cpp
dom/mobileconnection/src/MobileNetworkInfo.h
dom/webidl/DOMMMIError.webidl
dom/webidl/MozMobileConnection.webidl
dom/webidl/MozMobileNetworkInfo.webidl
--- a/dom/mobileconnection/src/DOMMMIError.cpp
+++ b/dom/mobileconnection/src/DOMMMIError.cpp
@@ -1,13 +1,13 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=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/. */
+ * 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 "DOMMMIError.h"
 #include "mozilla/dom/DOMMMIErrorBinding.h"
 
 using namespace mozilla::dom;
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(DOMMMIError)
 
@@ -32,24 +32,8 @@ DOMMMIError::DOMMMIError(nsPIDOMWindow* 
 {
 }
 
 JSObject*
 DOMMMIError::WrapObject(JSContext* aCx)
 {
   return DOMMMIErrorBinding::Wrap(aCx, this);
 }
-
-// WebIDL interface
-
-/* static */ already_AddRefed<DOMMMIError>
-DOMMMIError::Constructor(const GlobalObject& aGlobal,
-                         const nsAString& aServiceCode,
-                         const nsAString& aName,
-                         const nsAString& aMessage,
-                         const Nullable<int16_t>& aInfo,
-                         ErrorResult& aRv) {
-  nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(aGlobal.GetAsSupports());
-  nsRefPtr<DOMMMIError> error = new DOMMMIError(window, aName, aMessage,
-                                                aServiceCode, aInfo);
-
-  return error.forget();
-}
--- a/dom/mobileconnection/src/DOMMMIError.h
+++ b/dom/mobileconnection/src/DOMMMIError.h
@@ -1,13 +1,13 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=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/. */
+ * 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/. */
 
 #ifndef mozilla_dom_MmiError_h
 #define mozilla_dom_MmiError_h
 
 #include "mozilla/dom/DOMError.h"
 
 namespace mozilla {
 namespace dom {
@@ -21,20 +21,16 @@ public:
   DOMMMIError(nsPIDOMWindow* aWindow, const nsAString& aName,
               const nsAString& aMessage, const nsAString& aServiceCode,
               const Nullable<int16_t>& aInfo);
 
   virtual JSObject*
   WrapObject(JSContext* aCx) MOZ_OVERRIDE;
 
   // WebIDL interface
-  static already_AddRefed<DOMMMIError>
-  Constructor(const GlobalObject& aGlobal, const nsAString& aServiceCode,
-              const nsAString& aName, const nsAString& aMessage,
-              const Nullable<int16_t>& aInfo, ErrorResult& aRv);
 
   void
   GetServiceCode(nsString& aServiceCode) const
   {
     aServiceCode = mServiceCode;
   }
 
   Nullable<int16_t>
--- a/dom/mobileconnection/src/MobileNetworkInfo.cpp
+++ b/dom/mobileconnection/src/MobileNetworkInfo.cpp
@@ -40,39 +40,16 @@ MobileNetworkInfo::Update(nsIMobileNetwo
 }
 
 JSObject*
 MobileNetworkInfo::WrapObject(JSContext* aCx)
 {
   return MozMobileNetworkInfoBinding::Wrap(aCx, this);
 }
 
-// WebIDL interface
-
-/* static */ already_AddRefed<MobileNetworkInfo>
-MobileNetworkInfo::Constructor(const GlobalObject& aGlobal,
-                               const nsAString& aShortName,
-                               const nsAString& aLongName,
-                               const nsAString& aMcc,
-                               const nsAString& aMnc,
-                               const nsAString& aState,
-                               ErrorResult& aRv)
-{
-  nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(aGlobal.GetAsSupports());
-  nsRefPtr<MobileNetworkInfo> info = new MobileNetworkInfo(window);
-
-  info->mShortName.Assign(aShortName);
-  info->mLongName.Assign(aLongName);
-  info->mMcc.Assign(aMcc);
-  info->mMnc.Assign(aMnc);
-  info->mState.Assign(aState);
-
-  return info.forget();
-}
-
 // nsIMobileNetworkInfo
 
 NS_IMETHODIMP
 MobileNetworkInfo::GetShortName(nsAString& aShortName)
 {
   aShortName = mShortName;
   return NS_OK;
 }
--- a/dom/mobileconnection/src/MobileNetworkInfo.h
+++ b/dom/mobileconnection/src/MobileNetworkInfo.h
@@ -35,22 +35,16 @@ public:
   {
     return mWindow;
   }
 
   virtual JSObject*
   WrapObject(JSContext* aCx) MOZ_OVERRIDE;
 
   // WebIDL interface
-  static already_AddRefed<MobileNetworkInfo>
-  Constructor(const GlobalObject& aGlobal, const nsAString& aShortName,
-              const nsAString& aLongName, const nsAString& aMcc,
-              const nsAString& aMnc, const nsAString& aState,
-              ErrorResult& aRv);
-
   Nullable<MobileNetworkState>
   GetState() const
   {
     uint32_t i = 0;
     for (const EnumEntry* entry = MobileNetworkStateValues::strings;
          entry->value;
          ++entry, ++i) {
       if (mState.EqualsASCII(entry->value)) {
--- a/dom/webidl/DOMMMIError.webidl
+++ b/dom/webidl/DOMMMIError.webidl
@@ -1,18 +1,14 @@
 /* -*- 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/.
  */
 
-[Pref="dom.mobileconnection.enabled",
- Constructor(DOMString serviceCode,
-             DOMString name,
-             optional DOMString message = "",
-             optional short? additionalInformation = null)]
+[Pref="dom.mobileconnection.enabled"]
 interface DOMMMIError : DOMError {
   [Constant]
   readonly attribute DOMString serviceCode;
 
   [Constant]
   readonly attribute short? additionalInformation;
 };
--- a/dom/webidl/MozMobileConnection.webidl
+++ b/dom/webidl/MozMobileConnection.webidl
@@ -660,31 +660,37 @@ dictionary MozCallBarringOptions
 
 dictionary MozMMIResult
 {
   /**
    * String key that identifies the service associated with the MMI code
    * request. The UI is supposed to handle the localization of the strings
    * associated with this string key.
    */
-  DOMString serviceCode;
+  DOMString serviceCode = "";
 
   /**
    * String key containing the status message of the associated MMI request.
    * The UI is supposed to handle the localization of the strings associated
    * with this string key.
    */
-  DOMString statusMessage;
+  DOMString statusMessage = "";
 
   /**
    * Some MMI requests like call forwarding or PIN/PIN2/PUK/PUK2 related
    * requests provide extra information along with the status message, this
-   * information can be a number, a string key or an array of string keys.
+   * information can be a number, an array of string keys or an array of
+   * MozCallForwardingOptions.
+   *
+   * And it should be
+   * (unsigned short or sequence<DOMString> or sequence<MozCallForwardingOptions>)
+   * But we cannot yet use sequences as union member types (please see bug 767924)
+   * ,so we use object here.
    */
-  any additionalInformation;
+  (unsigned short or object) additionalInformation;
 };
 
 dictionary MozClirStatus
 {
   /**
    * CLIR parameter 'n': parameter sets the adjustment for outgoing calls.
    *
    * It shall be one of the MozMobileConnection.CLIR_* values.
--- a/dom/webidl/MozMobileNetworkInfo.webidl
+++ b/dom/webidl/MozMobileNetworkInfo.webidl
@@ -1,17 +1,15 @@
 /* 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/. */
 
 enum MobileNetworkState {"available", "connected", "forbidden"};
 
-[Pref="dom.mobileconnection.enabled",
- ChromeConstructor(DOMString? shortName, DOMString? longName, DOMString? mcc,
-                   DOMString? mnc, DOMString? state)]
+[Pref="dom.mobileconnection.enabled"]
 interface MozMobileNetworkInfo
 {
   /**
    * Short name of the network operator.
    */
   readonly attribute DOMString? shortName;
 
   /**