bug 1155829 - declare MaiAtkObject in nsMai.h r=yzen
authorTrevor Saunders <tbsaunde@tbsaunde.org>
Wed, 08 Apr 2015 11:32:40 -0400
changeset 259168 a7a57e6ee03623c37b4f926c12c3fbdda34a93a6
parent 259167 d8df74a22186fa016e22ed027ec83e76a5a594ee
child 259169 2cea659eaa02c8e39c9187c7835875860f3450a5
push id8007
push userraliiev@mozilla.com
push dateMon, 11 May 2015 19:23:16 +0000
treeherdermozilla-aurora@e2ce1aac996e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersyzen
bugs1155829
milestone40.0a1
bug 1155829 - declare MaiAtkObject in nsMai.h r=yzen Next we will start adding methods to it that are used outside AccessibleWrap.cpp.
accessible/atk/AccessibleWrap.cpp
accessible/atk/nsMai.h
--- a/accessible/atk/AccessibleWrap.cpp
+++ b/accessible/atk/AccessibleWrap.cpp
@@ -118,38 +118,22 @@ static const GInterfaceInfo atk_if_infos
     {(GInterfaceInitFunc)textInterfaceInitCB,
      (GInterfaceFinalizeFunc) nullptr, nullptr},
     {(GInterfaceInitFunc)documentInterfaceInitCB,
      (GInterfaceFinalizeFunc) nullptr, nullptr},
     {(GInterfaceInitFunc)imageInterfaceInitCB,
      (GInterfaceFinalizeFunc) nullptr, nullptr}
 };
 
-/**
- * This MaiAtkObject is a thin wrapper, in the MAI namespace, for AtkObject
- */
-struct MaiAtkObject
-{
-  AtkObject parent;
-  /*
-   * The AccessibleWrap whose properties and features are exported
-   * via this object instance.
-   */
-  uintptr_t accWrap;
-
-  /*
-   * Shutdown this AtkObject.
-   */
-  void Shutdown();
-};
-
 // This is or'd with the pointer in MaiAtkObject::accWrap if the wrap-ee is a
 // proxy.
 static const uintptr_t IS_PROXY = 1;
 
+static GQuark quark_mai_hyperlink = 0;
+
 void
 MaiAtkObject::Shutdown()
 {
   accWrap = 0;
   MaiHyperlink* maiHyperlink =
     (MaiHyperlink*)g_object_get_qdata(G_OBJECT(this), quark_mai_hyperlink);
   if (maiHyperlink) {
     delete maiHyperlink;
@@ -220,18 +204,16 @@ static AtkRelationSet*     refRelationSe
 */
 G_END_DECLS
 
 static GType GetMaiAtkType(uint16_t interfacesBits);
 static const char * GetUniqueMaiAtkTypeName(uint16_t interfacesBits);
 
 static gpointer parent_class = nullptr;
 
-static GQuark quark_mai_hyperlink = 0;
-
 GType
 mai_atk_object_get_type(void)
 {
     static GType type = 0;
 
     if (!type) {
         static const GTypeInfo tinfo = {
             sizeof(MaiAtkObjectClass),
@@ -265,17 +247,17 @@ AccessibleWrap::~AccessibleWrap()
 }
 
 void
 AccessibleWrap::ShutdownAtkObject()
 {
   if (!mAtkObject)
     return;
 
-  MOZ_ASSERT(IS_MAI_OBJECT(mAtkObject));
+  NS_ASSERTION(IS_MAI_OBJECT(mAtkObject), "wrong type of atk object");
   if (IS_MAI_OBJECT(mAtkObject))
     MAI_ATK_OBJECT(mAtkObject)->Shutdown();
 
   g_object_unref(mAtkObject);
   mAtkObject = nullptr;
 }
 
 void
--- a/accessible/atk/nsMai.h
+++ b/accessible/atk/nsMai.h
@@ -46,9 +46,27 @@ extern int atkMajorVersion, atkMinorVers
  */
 static inline bool
 IsAtkVersionAtLeast(int aMajor, int aMinor)
 {
   return aMajor < atkMajorVersion ||
          (aMajor == atkMajorVersion && aMinor <= atkMinorVersion);
 }
 
+/**
+ * This MaiAtkObject is a thin wrapper, in the MAI namespace, for AtkObject
+ */
+struct MaiAtkObject
+{
+  AtkObject parent;
+  /*
+   * The AccessibleWrap whose properties and features are exported
+   * via this object instance.
+   */
+  uintptr_t accWrap;
+
+  /*
+   * Shutdown this AtkObject.
+   */
+  void Shutdown();
+};
+
 #endif /* __NS_MAI_H__ */