bug 1196460 - provide mapping from id to accessible in DocProxyAccessibleWrap
authorTrevor Saunders <tbsaunde@tbsaunde.org>
Tue, 11 Aug 2015 17:01:01 -0400
changeset 294996 c6212940fbce3439d5ad08e6e1fa3c4c36d81810
parent 294995 2b75e52881e93dbd465c4d362e789d91b45d4f00
child 294997 4ea6b5620ce4148d798c753611ab596962168e66
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1196460
milestone43.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 1196460 - provide mapping from id to accessible in DocProxyAccessibleWrap
accessible/windows/ProxyWrappers.h
--- a/accessible/windows/ProxyWrappers.h
+++ b/accessible/windows/ProxyWrappers.h
@@ -43,16 +43,28 @@ public:
 };
 
 class DocProxyAccessibleWrap : public HyperTextProxyAccessibleWrap
 {
 public:
   DocProxyAccessibleWrap(ProxyAccessible* aProxy) :
     HyperTextProxyAccessibleWrap(aProxy)
   { mGenericTypes |= eDocument; }
+
+  void AddID(uint32_t aID, AccessibleWrap* aAcc)
+    { mIDToAccessibleMap.Put(aID, aAcc); }
+  void RemoveID(uint32_t aID) { mIDToAccessibleMap.Remove(aID); }
+  AccessibleWrap* GetAccessibleByID(uint32_t aID) const
+    { return mIDToAccessibleMap.Get(aID); }
+
+private:
+  /*
+   * This provides a mapping from 32 bit id to accessible objects.
+   */
+  nsDataHashtable<nsUint32HashKey, AccessibleWrap*> mIDToAccessibleMap;
 };
 
 template<typename T>
 inline ProxyAccessible*
 HyperTextProxyFor(T* aWrapper)
 {
   static_assert(mozilla::IsBaseOf<IUnknown, T>::value, "only IAccessible* should be passed in");
   auto wrapper = static_cast<HyperTextProxyAccessibleWrap*>(aWrapper);