Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef nsTransactionStack_h__
7 #define nsTransactionStack_h__
9 #include <deque>
10 #include "nsAutoPtr.h"
12 class nsCycleCollectionTraversalCallback;
13 class nsTransactionItem;
15 class nsTransactionStack
16 {
17 public:
18 enum Type { FOR_UNDO, FOR_REDO };
20 explicit nsTransactionStack(Type aType);
21 ~nsTransactionStack();
23 void Push(nsTransactionItem *aTransactionItem);
24 already_AddRefed<nsTransactionItem> Pop();
25 already_AddRefed<nsTransactionItem> PopBottom();
26 already_AddRefed<nsTransactionItem> Peek();
27 already_AddRefed<nsTransactionItem> GetItem(int32_t aIndex);
28 void Clear();
29 int32_t GetSize() { return mDeque.size(); }
31 void DoUnlink() { Clear(); }
32 void DoTraverse(nsCycleCollectionTraversalCallback &cb);
34 private:
35 std::deque<nsRefPtr<nsTransactionItem> > mDeque;
36 const Type mType;
37 };
39 #endif // nsTransactionStack_h__