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 __NS_ACCESSIBLE_WRAP_H__ |
michael@0 | 8 | #define __NS_ACCESSIBLE_WRAP_H__ |
michael@0 | 9 | |
michael@0 | 10 | #include "nsCOMPtr.h" |
michael@0 | 11 | #include "Accessible.h" |
michael@0 | 12 | |
michael@0 | 13 | struct _AtkObject; |
michael@0 | 14 | typedef struct _AtkObject AtkObject; |
michael@0 | 15 | |
michael@0 | 16 | enum AtkProperty { |
michael@0 | 17 | PROP_0, // gobject convention |
michael@0 | 18 | PROP_NAME, |
michael@0 | 19 | PROP_DESCRIPTION, |
michael@0 | 20 | PROP_PARENT, // ancestry has changed |
michael@0 | 21 | PROP_ROLE, |
michael@0 | 22 | PROP_LAYER, |
michael@0 | 23 | PROP_MDI_ZORDER, |
michael@0 | 24 | PROP_TABLE_CAPTION, |
michael@0 | 25 | PROP_TABLE_COLUMN_DESCRIPTION, |
michael@0 | 26 | PROP_TABLE_COLUMN_HEADER, |
michael@0 | 27 | PROP_TABLE_ROW_DESCRIPTION, |
michael@0 | 28 | PROP_TABLE_ROW_HEADER, |
michael@0 | 29 | PROP_TABLE_SUMMARY, |
michael@0 | 30 | PROP_LAST // gobject convention |
michael@0 | 31 | }; |
michael@0 | 32 | |
michael@0 | 33 | struct AtkPropertyChange { |
michael@0 | 34 | int32_t type; // property type as listed above |
michael@0 | 35 | void *oldvalue; |
michael@0 | 36 | void *newvalue; |
michael@0 | 37 | }; |
michael@0 | 38 | |
michael@0 | 39 | namespace mozilla { |
michael@0 | 40 | namespace a11y { |
michael@0 | 41 | |
michael@0 | 42 | class MaiHyperlink; |
michael@0 | 43 | |
michael@0 | 44 | /** |
michael@0 | 45 | * AccessibleWrap, and its descendents in atk directory provide the |
michael@0 | 46 | * implementation of AtkObject. |
michael@0 | 47 | */ |
michael@0 | 48 | class AccessibleWrap : public Accessible |
michael@0 | 49 | { |
michael@0 | 50 | public: |
michael@0 | 51 | AccessibleWrap(nsIContent* aContent, DocAccessible* aDoc); |
michael@0 | 52 | virtual ~AccessibleWrap(); |
michael@0 | 53 | void ShutdownAtkObject(); |
michael@0 | 54 | |
michael@0 | 55 | virtual void Shutdown(); |
michael@0 | 56 | |
michael@0 | 57 | // return the atk object for this AccessibleWrap |
michael@0 | 58 | NS_IMETHOD GetNativeInterface(void **aOutAccessible); |
michael@0 | 59 | virtual nsresult HandleAccEvent(AccEvent* aEvent); |
michael@0 | 60 | |
michael@0 | 61 | AtkObject * GetAtkObject(void); |
michael@0 | 62 | static AtkObject * GetAtkObject(nsIAccessible * acc); |
michael@0 | 63 | |
michael@0 | 64 | bool IsValidObject(); |
michael@0 | 65 | |
michael@0 | 66 | // get/set the MaiHyperlink object for this AccessibleWrap |
michael@0 | 67 | MaiHyperlink* GetMaiHyperlink(bool aCreate = true); |
michael@0 | 68 | void SetMaiHyperlink(MaiHyperlink* aMaiHyperlink); |
michael@0 | 69 | |
michael@0 | 70 | static const char * ReturnString(nsAString &aString) { |
michael@0 | 71 | static nsCString returnedString; |
michael@0 | 72 | returnedString = NS_ConvertUTF16toUTF8(aString); |
michael@0 | 73 | return returnedString.get(); |
michael@0 | 74 | } |
michael@0 | 75 | |
michael@0 | 76 | protected: |
michael@0 | 77 | |
michael@0 | 78 | nsresult FireAtkStateChangeEvent(AccEvent* aEvent, AtkObject *aObject); |
michael@0 | 79 | nsresult FireAtkTextChangedEvent(AccEvent* aEvent, AtkObject *aObject); |
michael@0 | 80 | nsresult FireAtkShowHideEvent(AccEvent* aEvent, AtkObject *aObject, |
michael@0 | 81 | bool aIsAdded); |
michael@0 | 82 | |
michael@0 | 83 | AtkObject *mAtkObject; |
michael@0 | 84 | |
michael@0 | 85 | private: |
michael@0 | 86 | |
michael@0 | 87 | /* |
michael@0 | 88 | * do we have text-remove and text-insert signals if not we need to use |
michael@0 | 89 | * text-changed see AccessibleWrap::FireAtkTextChangedEvent() and |
michael@0 | 90 | * bug 619002 |
michael@0 | 91 | */ |
michael@0 | 92 | enum EAvailableAtkSignals { |
michael@0 | 93 | eUnknown, |
michael@0 | 94 | eHaveNewAtkTextSignals, |
michael@0 | 95 | eNoNewAtkSignals |
michael@0 | 96 | }; |
michael@0 | 97 | |
michael@0 | 98 | static EAvailableAtkSignals gAvailableAtkSignals; |
michael@0 | 99 | |
michael@0 | 100 | uint16_t CreateMaiInterfaces(void); |
michael@0 | 101 | }; |
michael@0 | 102 | |
michael@0 | 103 | } // namespace a11y |
michael@0 | 104 | } // namespace mozilla |
michael@0 | 105 | |
michael@0 | 106 | #endif /* __NS_ACCESSIBLE_WRAP_H__ */ |