bug 1262233 - stop using a sync message to implement ProxyAccessible::EmbeddedChildCount() r=lsocks
authorTrevor Saunders <tbsaunde@tbsaunde.org>
Mon, 04 Apr 2016 18:07:58 -0400
changeset 331805 0efc1ab6080b7aa38f90050bc050790236e5c752
parent 331804 6987bce671f5b70b99b2b7a7e0aee89e02faad11
child 331806 546156845ae568136691c32f21d411190eacde6a
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslsocks
bugs1262233
milestone48.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 1262233 - stop using a sync message to implement ProxyAccessible::EmbeddedChildCount() r=lsocks
accessible/ipc/DocAccessibleChild.cpp
accessible/ipc/DocAccessibleChild.h
accessible/ipc/PDocAccessible.ipdl
accessible/ipc/ProxyAccessible.cpp
--- a/accessible/ipc/DocAccessibleChild.cpp
+++ b/accessible/ipc/DocAccessibleChild.cpp
@@ -1841,32 +1841,16 @@ DocAccessibleChild::RecvTakeFocus(const 
   if (acc) {
     acc->TakeFocus();
   }
 
   return true;
 }
 
 bool
-DocAccessibleChild::RecvEmbeddedChildCount(const uint64_t& aID,
-                                           uint32_t* aCount)
-{
-  *aCount = 0;
-
-  Accessible* acc = IdToAccessible(aID);
-  if (!acc) {
-    return true;
-  }
-
-  *aCount = acc->EmbeddedChildCount();
-
-  return true;
-}
-
-bool
 DocAccessibleChild::RecvIndexOfEmbeddedChild(const uint64_t& aID,
                                              const uint64_t& aChildID,
                                              uint32_t* aChildIdx)
 {
   *aChildIdx = 0;
 
   Accessible* parent = IdToAccessible(aID);
   Accessible* child = IdToAccessible(aChildID);
--- a/accessible/ipc/DocAccessibleChild.h
+++ b/accessible/ipc/DocAccessibleChild.h
@@ -449,19 +449,16 @@ public:
   virtual bool RecvMaxValue(const uint64_t& aID,
                             double* aValue) override;
 
   virtual bool RecvStep(const uint64_t& aID,
                         double* aStep) override;
 
   virtual bool RecvTakeFocus(const uint64_t& aID) override;
 
-  virtual bool RecvEmbeddedChildCount(const uint64_t& aID, uint32_t* aCount)
-    override final;
-
   virtual bool RecvIndexOfEmbeddedChild(const uint64_t& aID,
                                         const uint64_t& aChildID,
                                         uint32_t* aChildIdx) override final;
 
   virtual bool RecvEmbeddedChildAt(const uint64_t& aID, const uint32_t& aIdx,
                                    uint64_t* aChildID) override final;
 
   virtual bool RecvFocusedChild(const uint64_t& aID,
--- a/accessible/ipc/PDocAccessible.ipdl
+++ b/accessible/ipc/PDocAccessible.ipdl
@@ -232,17 +232,16 @@ child:
 
   prio(high) sync CurValue(uint64_t aID) returns(double aValue);
   prio(high) sync SetCurValue(uint64_t aID, double aValue) returns(bool aRetVal);
   prio(high) sync MinValue(uint64_t aID) returns(double aValue);
   prio(high) sync MaxValue(uint64_t aID) returns(double aValue);
   prio(high) sync Step(uint64_t aID) returns(double aStep);
 
   async TakeFocus(uint64_t aID);
-  prio(high) sync EmbeddedChildCount(uint64_t aID) returns(uint32_t aCount);
   prio(high) sync IndexOfEmbeddedChild(uint64_t aID, uint64_t aChildID)
     returns(uint32_t childIdx);
   prio(high) sync EmbeddedChildAt(uint64_t aID, uint32_t aChildIdx)
     returns(uint64_t aChild);
   prio(high) sync FocusedChild(uint64_t aID)
     returns(uint64_t aChild, bool aOk);
 
   prio(high) sync Language(uint64_t aID) returns(nsString aLocale);
--- a/accessible/ipc/ProxyAccessible.cpp
+++ b/accessible/ipc/ProxyAccessible.cpp
@@ -1030,18 +1030,23 @@ void
 ProxyAccessible::TakeFocus()
 {
   Unused << mDoc->SendTakeFocus(mID);
 }
 
 uint32_t
 ProxyAccessible::EmbeddedChildCount() const
 {
-  uint32_t count;
-  Unused << mDoc->SendEmbeddedChildCount(mID, &count);
+  size_t count = 0, kids = mChildren.Length();
+  for (size_t i = 0; i < kids; i++) {
+    if (mChildren[i]->IsEmbeddedObject()) {
+      count++;
+    }
+  }
+
   return count;
 }
 
 int32_t
 ProxyAccessible::IndexOfEmbeddedChild(const ProxyAccessible* aChild)
 {
   uint64_t childID = aChild->mID;
   uint32_t childIdx;