Bug 843452 - Part 1-1: WEBIDL changes for MobileConnection IPDL. r=hsinyi,smaug
authorEdgar Chen <echen@mozilla.com>
Wed, 26 Mar 2014 14:50:30 +0800
changeset 203328 b5cecf9d27509bef08382e896cb5f1327116d758
parent 203327 5437c4229265d6b42e9032b3e3e0c28aba9bc845
child 203329 7e867b1da3c7383c36c767fbc767ef4666fd4d92
push id48665
push userryanvm@gmail.com
push dateWed, 03 Sep 2014 20:40:15 +0000
treeherdermozilla-inbound@0da762e6868a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershsinyi, smaug
bugs843452
milestone35.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/DOMMMIError.cpp
dom/mobileconnection/DOMMMIError.h
dom/mobileconnection/MobileNetworkInfo.cpp
dom/mobileconnection/MobileNetworkInfo.h
dom/webidl/DOMMMIError.webidl
dom/webidl/MozMobileConnection.webidl
dom/webidl/MozMobileNetworkInfo.webidl
--- a/dom/mobileconnection/DOMMMIError.cpp
+++ b/dom/mobileconnection/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/DOMMMIError.h
+++ b/dom/mobileconnection/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/MobileNetworkInfo.cpp
+++ b/dom/mobileconnection/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/MobileNetworkInfo.h
+++ b/dom/mobileconnection/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;
 
   /**