Bug 868232 - Paris binding for MozStkCommandEvent, r=peterv
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Tue, 07 May 2013 15:46:07 +0300
changeset 142067 f8e522d6991f53212b6a326d07dbc76ce0e00a6f
parent 142066 0f91553baf967bf5b1e074353511612b616cadab
child 142068 86cdfca59c81867641f90739127f9dfd2bf1b37d
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspeterv
bugs868232
milestone23.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 868232 - Paris binding for MozStkCommandEvent, r=peterv
dom/bindings/Bindings.conf
dom/bindings/Makefile.in
dom/icc/src/StkCommandEvent.h
dom/webidl/MozStkCommandEvent.webidl
dom/webidl/WebIDL.mk
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -615,16 +615,21 @@ DOMInterfaces = {
 {
     'nativeType': 'nsIChannel',
     'notflattened': True
 },
 {
     'workers': True,
 }],
 
+'MozStkCommandEvent' : {
+    'nativeType': 'mozilla::dom::icc::StkCommandEvent',
+    'headerFile': 'StkCommandEvent.h',
+},
+
 'MutationEvent': {
     'nativeType': 'nsDOMMutationEvent',
 },
 
 'MutationObserver': {
     'nativeType': 'nsDOMMutationObserver',
 },
 
--- a/dom/bindings/Makefile.in
+++ b/dom/bindings/Makefile.in
@@ -68,16 +68,22 @@ LOCAL_INCLUDES += -I$(topsrcdir)/js/xpco
   $(NULL)
 
 ifdef MOZ_AUDIO_CHANNEL_MANAGER
 LOCAL_INCLUDES += \
   -I$(topsrcdir)/dom/system/gonk \
   $(NULL)
 endif
 
+ifdef MOZ_B2G_RIL
+LOCAL_INCLUDES += \
+  -I$(topsrcdir)/dom/icc/src \
+  $(NULL)
+endif
+
 EXTRA_MDDEPEND_FILES := $(addsuffix .pp,$(binding_cpp_files) $(binding_header_files))
 
 EXPORTS_GENERATED_FILES := $(exported_binding_headers)
 EXPORTS_GENERATED_DEST := $(DIST)/include/$(binding_include_path)
 EXPORTS_GENERATED_TARGET := webidl-export
 INSTALL_TARGETS += EXPORTS_GENERATED
 
 ifdef GNU_CC
--- a/dom/icc/src/StkCommandEvent.h
+++ b/dom/icc/src/StkCommandEvent.h
@@ -2,16 +2,17 @@
  * 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_icc_stkcommandevent_h
 #define mozilla_dom_icc_stkcommandevent_h
 
 #include "nsDOMEvent.h"
 #include "SimToolKit.h"
+#include "mozilla/dom/MozStkCommandEventBinding.h"
 
 namespace mozilla {
 namespace dom {
 namespace icc {
 
 class StkCommandEvent : public nsDOMEvent,
                         public nsIDOMMozStkCommandEvent
 {
@@ -41,20 +42,35 @@ public:
 
     bool dummy;
     rv = aTarget->DispatchEvent(thisEvent, &dummy);
     NS_ENSURE_SUCCESS(rv, rv);
 
     return NS_OK;
   }
 
+  virtual JSObject* WrapObject(JSContext* aCx,
+                               JS::Handle<JSObject*> aScope) MOZ_OVERRIDE
+  {
+    return mozilla::dom::MozStkCommandEventBinding::Wrap(aCx, aScope, this);
+  }
+
+  JS::Value GetCommand(JSContext* aCx, mozilla::ErrorResult& aRv)
+  {
+    JS::Rooted<JS::Value> retVal(aCx);
+    aRv = GetCommand(aCx, retVal.address());
+    return retVal;
+  }
+
 private:
   StkCommandEvent(mozilla::dom::EventTarget* aOwner)
   : nsDOMEvent(aOwner, nullptr, nullptr)
-  { }
+  {
+    SetIsDOMBinding();
+  }
 
   ~StkCommandEvent()
   { }
 };
 
 }
 }
 }
new file mode 100644
--- /dev/null
+++ b/dom/webidl/MozStkCommandEvent.webidl
@@ -0,0 +1,11 @@
+/* -*- 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/.
+ */
+
+interface MozStkCommandEvent : Event
+{
+  [Throws]
+  readonly attribute any command;
+};
--- a/dom/webidl/WebIDL.mk
+++ b/dom/webidl/WebIDL.mk
@@ -359,16 +359,22 @@ webidl_files += \
 endif
 
 ifdef MOZ_GAMEPAD
 webidl_files += \
   Gamepad.webidl \
   $(NULL)
 endif
 
+ifdef MOZ_B2G_RIL
+webidl_files += \
+  MozStkCommandEvent.webidl \
+  $(NULL)
+endif
+
 ifdef ENABLE_TESTS
 test_webidl_files := \
   TestCodeGen.webidl \
   TestDictionary.webidl \
   TestExampleGen.webidl \
   TestJSImplGen.webidl \
   TestJSImplInheritanceGen.webidl \
   TestTypedef.webidl \