bug 1196460 - create different proxy wrappers depending on the type of the proxy r=surkov
authorTrevor Saunders <tbsaunde@tbsaunde.org>
Fri, 07 Aug 2015 16:27:34 -0400
changeset 262410 d9be94b01f90dc573b008a58b1b3839cb2cc2904
parent 262409 680f1b8efbdf68508f8b510126546ae7d1cbc6d9
child 262411 2da419f8a7910fc95a6d51fb2fc377f18a96845d
push id15180
push userkwierso@gmail.com
push dateTue, 15 Sep 2015 00:28:33 +0000
treeherderfx-team@e543c88468c0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssurkov
bugs1196460
milestone43.0a1
bug 1196460 - create different proxy wrappers depending on the type of the proxy r=surkov
accessible/windows/msaa/Platform.cpp
--- a/accessible/windows/msaa/Platform.cpp
+++ b/accessible/windows/msaa/Platform.cpp
@@ -30,28 +30,36 @@ void
 a11y::PlatformShutdown()
 {
   ::DestroyCaret();
 
   nsWinUtils::ShutdownWindowEmulation();
 }
 
 void
-a11y::ProxyCreated(ProxyAccessible* aProxy, uint32_t)
+a11y::ProxyCreated(ProxyAccessible* aProxy, uint32_t aInterfaces)
 {
-  ProxyAccessibleWrap* wrapper = new ProxyAccessibleWrap(aProxy);
+  AccessibleWrap* wrapper = nullptr;
+  if (aInterfaces & Interfaces::DOCUMENT) {
+    wrapper = new DocProxyAccessibleWrap(aProxy);
+  } else if (aInterfaces & Interfaces::HYPERTEXT) {
+    wrapper = new HyperTextProxyAccessibleWrap(aProxy);
+  } else {
+    wrapper = new ProxyAccessibleWrap(aProxy);
+  }
+
   wrapper->AddRef();
   aProxy->SetWrapper(reinterpret_cast<uintptr_t>(wrapper));
 }
 
 void
 a11y::ProxyDestroyed(ProxyAccessible* aProxy)
 {
-  ProxyAccessibleWrap* wrapper =
-    reinterpret_cast<ProxyAccessibleWrap*>(aProxy->GetWrapper());
+  AccessibleWrap* wrapper =
+    reinterpret_cast<AccessibleWrap*>(aProxy->GetWrapper());
   MOZ_ASSERT(wrapper);
   if (!wrapper)
     return;
 
   wrapper->Shutdown();
   aProxy->SetWrapper(0);
   wrapper->Release();
 }