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_sdnTextAccessible_h_ |
michael@0 | 8 | #define mozilla_a11y_sdnTextAccessible_h_ |
michael@0 | 9 | |
michael@0 | 10 | #include "ISimpleDOMText.h" |
michael@0 | 11 | #include "IUnknownImpl.h" |
michael@0 | 12 | |
michael@0 | 13 | #include "AccessibleWrap.h" |
michael@0 | 14 | |
michael@0 | 15 | class nsIFrame; |
michael@0 | 16 | class nsPoint; |
michael@0 | 17 | |
michael@0 | 18 | namespace mozilla { |
michael@0 | 19 | namespace a11y { |
michael@0 | 20 | |
michael@0 | 21 | class sdnTextAccessible MOZ_FINAL : public ISimpleDOMText |
michael@0 | 22 | { |
michael@0 | 23 | public: |
michael@0 | 24 | sdnTextAccessible(AccessibleWrap* aAccessible) : mAccessible(aAccessible) {}; |
michael@0 | 25 | ~sdnTextAccessible() {} |
michael@0 | 26 | |
michael@0 | 27 | DECL_IUNKNOWN |
michael@0 | 28 | |
michael@0 | 29 | // ISimpleDOMText |
michael@0 | 30 | |
michael@0 | 31 | virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_domText( |
michael@0 | 32 | /* [retval][out] */ BSTR __RPC_FAR *aText); |
michael@0 | 33 | |
michael@0 | 34 | virtual HRESULT STDMETHODCALLTYPE get_clippedSubstringBounds( |
michael@0 | 35 | /* [in] */ unsigned int startIndex, |
michael@0 | 36 | /* [in] */ unsigned int endIndex, |
michael@0 | 37 | /* [out] */ int __RPC_FAR* aX, |
michael@0 | 38 | /* [out] */ int __RPC_FAR* aY, |
michael@0 | 39 | /* [out] */ int __RPC_FAR* aWidth, |
michael@0 | 40 | /* [out] */ int __RPC_FAR* aHeight); |
michael@0 | 41 | |
michael@0 | 42 | virtual HRESULT STDMETHODCALLTYPE get_unclippedSubstringBounds( |
michael@0 | 43 | /* [in] */ unsigned int aStartIndex, |
michael@0 | 44 | /* [in] */ unsigned int aEndIndex, |
michael@0 | 45 | /* [out] */ int __RPC_FAR* aX, |
michael@0 | 46 | /* [out] */ int __RPC_FAR* aY, |
michael@0 | 47 | /* [out] */ int __RPC_FAR* aWidth, |
michael@0 | 48 | /* [out] */ int __RPC_FAR* aHeight); |
michael@0 | 49 | |
michael@0 | 50 | virtual HRESULT STDMETHODCALLTYPE scrollToSubstring( |
michael@0 | 51 | /* [in] */ unsigned int aStartIndex, |
michael@0 | 52 | /* [in] */ unsigned int aEndIndex); |
michael@0 | 53 | |
michael@0 | 54 | virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_fontFamily( |
michael@0 | 55 | /* [retval][out] */ BSTR __RPC_FAR* aFontFamily); |
michael@0 | 56 | |
michael@0 | 57 | private: |
michael@0 | 58 | /** |
michael@0 | 59 | * Return child frame containing offset on success. |
michael@0 | 60 | */ |
michael@0 | 61 | nsIFrame* GetPointFromOffset(nsIFrame* aContainingFrame, |
michael@0 | 62 | int32_t aOffset, bool aPreferNext, |
michael@0 | 63 | nsPoint& aOutPoint); |
michael@0 | 64 | |
michael@0 | 65 | nsRefPtr<AccessibleWrap> mAccessible; |
michael@0 | 66 | }; |
michael@0 | 67 | |
michael@0 | 68 | } // namespace a11y |
michael@0 | 69 | } // namespace mozilla |
michael@0 | 70 | |
michael@0 | 71 | #endif |