bug 1338755 - split up SetCOMProxy() r=yzen
authorTrevor Saunders <tbsaunde@tbsaunde.org>
Wed, 15 Feb 2017 14:17:59 -0500
changeset 372626 874b53206690f233f0086ce8d3e2f212e7858fd1
parent 372625 162b85cf472d3e43359fcfc660c00b2f80c79239
child 372627 7fcdfa7a42b7e758692423c146a080dfaf16cfcf
push id10863
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 23:02:23 +0000
treeherdermozilla-aurora@0931190cd725 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersyzen
bugs1338755
milestone54.0a1
bug 1338755 - split up SetCOMProxy() r=yzen
accessible/ipc/DocAccessibleParent.cpp
accessible/ipc/DocAccessibleParent.h
accessible/ipc/win/ProxyAccessible.h
dom/ipc/TabParent.cpp
--- a/accessible/ipc/DocAccessibleParent.cpp
+++ b/accessible/ipc/DocAccessibleParent.cpp
@@ -579,21 +579,18 @@ DocAccessibleParent::MaybeInitWindowEmul
   Unused << SendEmulatedWindow(reinterpret_cast<uintptr_t>(mEmulatedWindowHandle),
                                hWndAccHolder);
 }
 
 /**
  * @param aCOMProxy COM Proxy to the document in the content process.
  */
 void
-DocAccessibleParent::SetCOMProxy(const RefPtr<IAccessible>& aCOMProxy)
+DocAccessibleParent::SendParentCOMProxy()
 {
-  SetCOMInterface(aCOMProxy);
-  MaybeInitWindowEmulation();
-
   // Make sure that we're not racing with a tab shutdown
   auto tab = static_cast<dom::TabParent*>(Manager());
   MOZ_ASSERT(tab);
   if (tab->IsDestroyed()) {
     return;
   }
 
   Accessible* outerDoc = OuterDocOfRemoteBrowser();
@@ -602,17 +599,17 @@ DocAccessibleParent::SetCOMProxy(const R
   }
 
   IAccessible* rawNative = nullptr;
   outerDoc->GetNativeInterface((void**) &rawNative);
   MOZ_ASSERT(rawNative);
 
   IAccessibleHolder::COMPtrType ptr(rawNative);
   IAccessibleHolder holder(Move(ptr));
-  Unused << SendParentCOMProxy(holder);
+  Unused << PDocAccessibleParent::SendParentCOMProxy(holder);
 }
 
 void
 DocAccessibleParent::SetEmulatedWindowHandle(HWND aWindowHandle)
 {
   if (!aWindowHandle && mEmulatedWindowHandle && IsTopLevel()) {
     ::DestroyWindow(mEmulatedWindowHandle);
   }
--- a/accessible/ipc/DocAccessibleParent.h
+++ b/accessible/ipc/DocAccessibleParent.h
@@ -168,17 +168,17 @@ public:
   size_t ChildDocCount() const { return mChildDocs.Length(); }
   const DocAccessibleParent* ChildDocAt(size_t aIdx) const
   { return const_cast<DocAccessibleParent*>(this)->ChildDocAt(aIdx); }
   DocAccessibleParent* ChildDocAt(size_t aIdx)
     { return LiveDocs().Get(mChildDocs[aIdx]); }
 
 #if defined(XP_WIN)
   void MaybeInitWindowEmulation();
-  void SetCOMProxy(const RefPtr<IAccessible>& aCOMProxy);
+  void SendParentCOMProxy();
 
   virtual mozilla::ipc::IPCResult RecvGetWindowedPluginIAccessible(
       const WindowsHandle& aHwnd, IAccessibleHolder* aPluginCOMProxy) override;
 
   /**
    * Set emulated native window handle for a document.
    * @param aWindowHandle emulated native window handle
    */
--- a/accessible/ipc/win/ProxyAccessible.h
+++ b/accessible/ipc/win/ProxyAccessible.h
@@ -34,25 +34,24 @@ public:
   ~ProxyAccessible()
   {
     MOZ_COUNT_DTOR(ProxyAccessible);
   }
 
 #include "mozilla/a11y/ProxyAccessibleShared.h"
 
   bool GetCOMInterface(void** aOutAccessible) const;
+  void SetCOMInterface(const RefPtr<IAccessible>& aIAccessible)
+  { mCOMProxy = aIAccessible; }
 
 protected:
   explicit ProxyAccessible(DocAccessibleParent* aThisAsDoc)
     : ProxyAccessibleBase(aThisAsDoc)
   { MOZ_COUNT_CTOR(ProxyAccessible); }
 
-  void SetCOMInterface(const RefPtr<IAccessible>& aIAccessible)
-  { mCOMProxy = aIAccessible; }
-
 private:
   RefPtr<IAccessible> mCOMProxy;
 };
 
 }
 }
 
 #endif
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -960,17 +960,19 @@ TabParent::RecvPDocAccessibleConstructor
     }
 
     doc->SetTopLevel();
     a11y::DocManager::RemoteDocAdded(doc);
 #ifdef XP_WIN
     a11y::WrapperFor(doc)->SetID(aMsaaID);
     MOZ_ASSERT(!aDocCOMProxy.IsNull());
     RefPtr<IAccessible> proxy(aDocCOMProxy.Get());
-    doc->SetCOMProxy(proxy);
+    doc->SetCOMInterface(proxy);
+    doc->MaybeInitWindowEmulation();
+    doc->SendParentCOMProxy();
 #endif
   }
 #endif
   return IPC_OK();
 }
 
 a11y::DocAccessibleParent*
 TabParent::GetTopLevelDocAccessible() const