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: set ts=2 et sw=2 tw=80: */ |
michael@0 | 3 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 4 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 5 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 6 | |
michael@0 | 7 | #ifndef mozilla_a11y_sdnAccessible_h_ |
michael@0 | 8 | #define mozilla_a11y_sdnAccessible_h_ |
michael@0 | 9 | |
michael@0 | 10 | #include "ISimpleDOMNode.h" |
michael@0 | 11 | #include "AccessibleWrap.h" |
michael@0 | 12 | #include "IUnknownImpl.h" |
michael@0 | 13 | |
michael@0 | 14 | #include "mozilla/Attributes.h" |
michael@0 | 15 | |
michael@0 | 16 | namespace mozilla { |
michael@0 | 17 | namespace a11y { |
michael@0 | 18 | |
michael@0 | 19 | class sdnAccessible MOZ_FINAL : public ISimpleDOMNode |
michael@0 | 20 | { |
michael@0 | 21 | public: |
michael@0 | 22 | sdnAccessible(nsINode* aNode) : |
michael@0 | 23 | mNode(aNode) |
michael@0 | 24 | { |
michael@0 | 25 | if (!mNode) |
michael@0 | 26 | MOZ_CRASH(); |
michael@0 | 27 | } |
michael@0 | 28 | ~sdnAccessible() { } |
michael@0 | 29 | |
michael@0 | 30 | /** |
michael@0 | 31 | * Retrun if the object is defunct. |
michael@0 | 32 | */ |
michael@0 | 33 | bool IsDefunct() const { return !GetDocument(); } |
michael@0 | 34 | |
michael@0 | 35 | /** |
michael@0 | 36 | * Return a document accessible it belongs to if any. |
michael@0 | 37 | */ |
michael@0 | 38 | DocAccessible* GetDocument() const; |
michael@0 | 39 | |
michael@0 | 40 | /* |
michael@0 | 41 | * Return associated accessible if any. |
michael@0 | 42 | */ |
michael@0 | 43 | Accessible* GetAccessible() const; |
michael@0 | 44 | |
michael@0 | 45 | //IUnknown |
michael@0 | 46 | DECL_IUNKNOWN |
michael@0 | 47 | |
michael@0 | 48 | virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_nodeInfo( |
michael@0 | 49 | /* [out] */ BSTR __RPC_FAR* aNodeName, |
michael@0 | 50 | /* [out] */ short __RPC_FAR* aNameSpaceID, |
michael@0 | 51 | /* [out] */ BSTR __RPC_FAR* aNodeValue, |
michael@0 | 52 | /* [out] */ unsigned int __RPC_FAR* aNumChildren, |
michael@0 | 53 | /* [out] */ unsigned int __RPC_FAR* aUniqueID, |
michael@0 | 54 | /* [out][retval] */ unsigned short __RPC_FAR* aNodeType); |
michael@0 | 55 | |
michael@0 | 56 | virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_attributes( |
michael@0 | 57 | /* [in] */ unsigned short aMaxAttribs, |
michael@0 | 58 | /* [length_is][size_is][out] */ BSTR __RPC_FAR* aAttribNames, |
michael@0 | 59 | /* [length_is][size_is][out] */ short __RPC_FAR* aNameSpaceIDs, |
michael@0 | 60 | /* [length_is][size_is][out] */ BSTR __RPC_FAR* aAttribValues, |
michael@0 | 61 | /* [out][retval] */ unsigned short __RPC_FAR* aNumAttribs); |
michael@0 | 62 | |
michael@0 | 63 | virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_attributesForNames( |
michael@0 | 64 | /* [in] */ unsigned short aMaxAttribs, |
michael@0 | 65 | /* [length_is][size_is][in] */ BSTR __RPC_FAR* aAttribNames, |
michael@0 | 66 | /* [length_is][size_is][in] */ short __RPC_FAR* aNameSpaceID, |
michael@0 | 67 | /* [length_is][size_is][retval] */ BSTR __RPC_FAR* aAttribValues); |
michael@0 | 68 | |
michael@0 | 69 | virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_computedStyle( |
michael@0 | 70 | /* [in] */ unsigned short aMaxStyleProperties, |
michael@0 | 71 | /* [in] */ boolean aUseAlternateView, |
michael@0 | 72 | /* [length_is][size_is][out] */ BSTR __RPC_FAR* aStyleProperties, |
michael@0 | 73 | /* [length_is][size_is][out] */ BSTR __RPC_FAR* aStyleValues, |
michael@0 | 74 | /* [out][retval] */ unsigned short __RPC_FAR* aNumStyleProperties); |
michael@0 | 75 | |
michael@0 | 76 | virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_computedStyleForProperties( |
michael@0 | 77 | /* [in] */ unsigned short aNumStyleProperties, |
michael@0 | 78 | /* [in] */ boolean aUseAlternateView, |
michael@0 | 79 | /* [length_is][size_is][in] */ BSTR __RPC_FAR* aStyleProperties, |
michael@0 | 80 | /* [length_is][size_is][out][retval] */ BSTR __RPC_FAR* aStyleValues); |
michael@0 | 81 | |
michael@0 | 82 | virtual HRESULT STDMETHODCALLTYPE scrollTo(/* [in] */ boolean aScrollTopLeft); |
michael@0 | 83 | |
michael@0 | 84 | virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_parentNode( |
michael@0 | 85 | /* [out][retval] */ ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode); |
michael@0 | 86 | |
michael@0 | 87 | virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_firstChild( |
michael@0 | 88 | /* [out][retval] */ ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode); |
michael@0 | 89 | |
michael@0 | 90 | virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_lastChild( |
michael@0 | 91 | /* [out][retval] */ ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode); |
michael@0 | 92 | |
michael@0 | 93 | virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_previousSibling( |
michael@0 | 94 | /* [out][retval] */ ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode); |
michael@0 | 95 | |
michael@0 | 96 | virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_nextSibling( |
michael@0 | 97 | /* [out][retval] */ ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode); |
michael@0 | 98 | |
michael@0 | 99 | virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_childAt( |
michael@0 | 100 | /* [in] */ unsigned aChildIndex, |
michael@0 | 101 | /* [out][retval] */ ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode); |
michael@0 | 102 | |
michael@0 | 103 | virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_innerHTML( |
michael@0 | 104 | /* [out][retval] */ BSTR __RPC_FAR* aInnerHTML); |
michael@0 | 105 | |
michael@0 | 106 | virtual /* [local][propget] */ HRESULT STDMETHODCALLTYPE get_localInterface( |
michael@0 | 107 | /* [retval][out] */ void __RPC_FAR *__RPC_FAR* aLocalInterface); |
michael@0 | 108 | |
michael@0 | 109 | virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_language( |
michael@0 | 110 | /* [out][retval] */ BSTR __RPC_FAR* aLanguage); |
michael@0 | 111 | |
michael@0 | 112 | private: |
michael@0 | 113 | nsCOMPtr<nsINode> mNode; |
michael@0 | 114 | }; |
michael@0 | 115 | |
michael@0 | 116 | } // namespace a11y |
michael@0 | 117 | } // namespace mozilla |
michael@0 | 118 | |
michael@0 | 119 | #endif // mozilla_a11y_sdnAccessible_h_ |