Tue, 06 Jan 2015 21:39:09 +0100
Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* vim:expandtab:shiftwidth=2:tabstop=2: |
michael@0 | 3 | */ |
michael@0 | 4 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 5 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 6 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 7 | |
michael@0 | 8 | #ifndef _NS_ACCESSIBLE_RELATION_WRAP_H |
michael@0 | 9 | #define _NS_ACCESSIBLE_RELATION_WRAP_H |
michael@0 | 10 | |
michael@0 | 11 | #include "Accessible.h" |
michael@0 | 12 | #include "IUnknownImpl.h" |
michael@0 | 13 | #include "nsIAccessibleRelation.h" |
michael@0 | 14 | |
michael@0 | 15 | #include <utility> |
michael@0 | 16 | #include "nsTArray.h" |
michael@0 | 17 | |
michael@0 | 18 | #include "AccessibleRelation.h" |
michael@0 | 19 | |
michael@0 | 20 | namespace mozilla { |
michael@0 | 21 | namespace a11y { |
michael@0 | 22 | |
michael@0 | 23 | class ia2AccessibleRelation MOZ_FINAL : public IAccessibleRelation |
michael@0 | 24 | { |
michael@0 | 25 | public: |
michael@0 | 26 | ia2AccessibleRelation(RelationType aType, Relation* aRel); |
michael@0 | 27 | |
michael@0 | 28 | // IUnknown |
michael@0 | 29 | DECL_IUNKNOWN |
michael@0 | 30 | |
michael@0 | 31 | // IAccessibleRelation |
michael@0 | 32 | virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_relationType( |
michael@0 | 33 | /* [retval][out] */ BSTR *relationType); |
michael@0 | 34 | |
michael@0 | 35 | virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_localizedRelationType( |
michael@0 | 36 | /* [retval][out] */ BSTR *localizedRelationType); |
michael@0 | 37 | |
michael@0 | 38 | virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_nTargets( |
michael@0 | 39 | /* [retval][out] */ long *nTargets); |
michael@0 | 40 | |
michael@0 | 41 | virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_target( |
michael@0 | 42 | /* [in] */ long targetIndex, |
michael@0 | 43 | /* [retval][out] */ IUnknown **target); |
michael@0 | 44 | |
michael@0 | 45 | virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_targets( |
michael@0 | 46 | /* [in] */ long maxTargets, |
michael@0 | 47 | /* [length_is][size_is][out] */ IUnknown **target, |
michael@0 | 48 | /* [retval][out] */ long *nTargets); |
michael@0 | 49 | |
michael@0 | 50 | inline bool HasTargets() const |
michael@0 | 51 | { return mTargets.Length(); } |
michael@0 | 52 | |
michael@0 | 53 | private: |
michael@0 | 54 | ia2AccessibleRelation(); |
michael@0 | 55 | ia2AccessibleRelation(const ia2AccessibleRelation&); |
michael@0 | 56 | ia2AccessibleRelation& operator = (const ia2AccessibleRelation&); |
michael@0 | 57 | |
michael@0 | 58 | RelationType mType; |
michael@0 | 59 | nsTArray<nsRefPtr<Accessible> > mTargets; |
michael@0 | 60 | }; |
michael@0 | 61 | |
michael@0 | 62 | |
michael@0 | 63 | /** |
michael@0 | 64 | * Gecko to IAccessible2 relation types map. |
michael@0 | 65 | */ |
michael@0 | 66 | |
michael@0 | 67 | const WCHAR *const IA2_RELATION_NULL = L""; |
michael@0 | 68 | |
michael@0 | 69 | #define RELATIONTYPE(geckoType, name, atkType, msaaType, ia2Type) \ |
michael@0 | 70 | std::pair<RelationType, const WCHAR *const>(RelationType::geckoType, ia2Type), |
michael@0 | 71 | |
michael@0 | 72 | static const std::pair<RelationType, const WCHAR *const> sRelationTypePairs[] = { |
michael@0 | 73 | #include "RelationTypeMap.h" |
michael@0 | 74 | }; |
michael@0 | 75 | |
michael@0 | 76 | #undef RELATIONTYPE |
michael@0 | 77 | |
michael@0 | 78 | } // namespace a11y |
michael@0 | 79 | } // namespace mozilla |
michael@0 | 80 | |
michael@0 | 81 | #endif |
michael@0 | 82 |