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.
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 file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_a11y_EnumVariant_h__
8 #define mozilla_a11y_EnumVariant_h__
10 #include "AccessibleWrap.h"
11 #include "IUnknownImpl.h"
13 namespace mozilla {
14 namespace a11y {
16 /**
17 * Used to fetch accessible children.
18 */
19 class ChildrenEnumVariant MOZ_FINAL : public IEnumVARIANT
20 {
21 public:
22 ChildrenEnumVariant(AccessibleWrap* aAnchor) : mAnchorAcc(aAnchor),
23 mCurAcc(mAnchorAcc->GetChildAt(0)), mCurIndex(0) { }
25 // IUnknown
26 DECL_IUNKNOWN
28 // IEnumVariant
29 virtual /* [local] */ HRESULT STDMETHODCALLTYPE Next(
30 /* [in] */ ULONG aCount,
31 /* [length_is][size_is][out] */ VARIANT* aItems,
32 /* [out] */ ULONG* aCountFetched);
34 virtual HRESULT STDMETHODCALLTYPE Skip(
35 /* [in] */ ULONG aCount);
37 virtual HRESULT STDMETHODCALLTYPE Reset();
39 virtual HRESULT STDMETHODCALLTYPE Clone(
40 /* [out] */ IEnumVARIANT** aEnumVaraint);
42 private:
43 ChildrenEnumVariant() MOZ_DELETE;
44 ChildrenEnumVariant& operator =(const ChildrenEnumVariant&) MOZ_DELETE;
46 ChildrenEnumVariant(const ChildrenEnumVariant& aEnumVariant) :
47 mAnchorAcc(aEnumVariant.mAnchorAcc), mCurAcc(aEnumVariant.mCurAcc),
48 mCurIndex(aEnumVariant.mCurIndex) { }
49 virtual ~ChildrenEnumVariant() { }
51 protected:
52 nsRefPtr<AccessibleWrap> mAnchorAcc;
53 Accessible* mCurAcc;
54 uint32_t mCurIndex;
55 };
57 } // a11y namespace
58 } // mozilla namespace
60 #endif