"Fossies" - the Fresh Open Source Software Archive

Member "UXP-2019.06.08/accessible/windows/msaa/MsaaIdGenerator.h" (8 Jun 2019, 1791 Bytes) of package /linux/www/UXP-2019.06.08.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
    2 /* vim: set ts=2 et sw=2 tw=80: */
    3 /* This Source Code Form is subject to the terms of the Mozilla Public
    4  * License, v. 2.0. If a copy of the MPL was not distributed with this
    5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
    6 
    7 #ifndef mozilla_a11y_MsaaIdGenerator_h
    8 #define mozilla_a11y_MsaaIdGenerator_h
    9 
   10 #include "mozilla/a11y/IDSet.h"
   11 
   12 #include "mozilla/dom/ipc/IdType.h"
   13 
   14 namespace mozilla {
   15 namespace a11y {
   16 
   17 class AccessibleWrap;
   18 
   19 /**
   20  * This class is responsible for generating child IDs used by our MSAA
   21  * implementation. Since e10s requires us to differentiate IDs based on the
   22  * originating process of the accessible, a portion of the ID's bits are
   23  * allocated to storing that information. The remaining bits represent the
   24  * unique ID of the accessible, within that content process.
   25  *
   26  * The constants kNumContentProcessIDBits and kNumUniqueIDBits in the
   27  * implementation are responsible for determining the proportion of bits that
   28  * are allocated for each purpose.
   29  */
   30 class MsaaIdGenerator
   31 {
   32 public:
   33   MsaaIdGenerator();
   34 
   35   uint32_t GetID();
   36   void ReleaseID(AccessibleWrap* aAccWrap);
   37   bool IsChromeID(uint32_t aID);
   38   bool IsIDForThisContentProcess(uint32_t aID);
   39   bool IsIDForContentProcess(uint32_t aID,
   40                              dom::ContentParentId aIPCContentProcessId);
   41   bool IsSameContentProcessFor(uint32_t aFirstID, uint32_t aSecondID);
   42 
   43   uint32_t GetContentProcessIDFor(dom::ContentParentId aIPCContentProcessID);
   44   void ReleaseContentProcessIDFor(dom::ContentParentId aIPCContentProcessID);
   45 
   46 private:
   47   uint32_t ResolveContentProcessID();
   48 
   49 private:
   50   IDSet     mIDSet;
   51 };
   52 
   53 } // namespace a11y
   54 } // namespace mozilla
   55 
   56 #endif // mozilla_a11y_MsaaIdGenerator_h