OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 22 matching lines...) Expand all Loading... |
33 | 33 |
34 #include "platform/heap/Handle.h" | 34 #include "platform/heap/Handle.h" |
35 #include "wtf/Deque.h" | 35 #include "wtf/Deque.h" |
36 #include "wtf/Forward.h" | 36 #include "wtf/Forward.h" |
37 | 37 |
38 namespace WebCore { | 38 namespace WebCore { |
39 | 39 |
40 class LocalFrame; | 40 class LocalFrame; |
41 class UndoStep; | 41 class UndoStep; |
42 | 42 |
43 class UndoStack { | 43 class UndoStack FINAL : public NoBaseWillBeGarbageCollected<UndoStack> { |
| 44 DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(UndoStack) |
44 public: | 45 public: |
45 static PassOwnPtr<UndoStack> create(); | 46 static PassOwnPtrWillBeRawPtr<UndoStack> create(); |
46 | |
47 ~UndoStack(); | |
48 | 47 |
49 void registerUndoStep(PassRefPtrWillBeRawPtr<UndoStep>); | 48 void registerUndoStep(PassRefPtrWillBeRawPtr<UndoStep>); |
50 void registerRedoStep(PassRefPtrWillBeRawPtr<UndoStep>); | 49 void registerRedoStep(PassRefPtrWillBeRawPtr<UndoStep>); |
51 void didUnloadFrame(const LocalFrame&); | 50 void didUnloadFrame(const LocalFrame&); |
52 bool canUndo() const; | 51 bool canUndo() const; |
53 bool canRedo() const; | 52 bool canRedo() const; |
54 void undo(); | 53 void undo(); |
55 void redo(); | 54 void redo(); |
56 | 55 |
| 56 void trace(Visitor*); |
| 57 |
57 private: | 58 private: |
58 UndoStack(); | 59 UndoStack(); |
59 | 60 |
60 typedef WillBeHeapDeque<RefPtrWillBeMember<UndoStep> > UndoStepStack; | 61 typedef WillBeHeapDeque<RefPtrWillBeMember<UndoStep> > UndoStepStack; |
61 typedef WillBePersistentHeapDeque<RefPtrWillBeMember<UndoStep> > WillBePersi
stentUndoStepStack; | |
62 | 62 |
63 void filterOutUndoSteps(WillBePersistentUndoStepStack&, const LocalFrame&); | 63 void filterOutUndoSteps(UndoStepStack&, const LocalFrame&); |
64 | 64 |
65 bool m_inRedo; | 65 bool m_inRedo; |
66 WillBePersistentUndoStepStack m_undoStack; | 66 UndoStepStack m_undoStack; |
67 WillBePersistentUndoStepStack m_redoStack; | 67 UndoStepStack m_redoStack; |
68 }; | 68 }; |
69 | 69 |
70 } // namespace WebCore | 70 } // namespace WebCore |
71 | 71 |
72 #endif | 72 #endif |
OLD | NEW |