| 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 13 matching lines...) Expand all Loading... |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef UndoStack_h | 31 #ifndef UndoStack_h |
| 32 #define UndoStack_h | 32 #define UndoStack_h |
| 33 | 33 |
| 34 #include "platform/heap/Handle.h" |
| 34 #include "wtf/Deque.h" | 35 #include "wtf/Deque.h" |
| 35 #include "wtf/Forward.h" | 36 #include "wtf/Forward.h" |
| 36 | 37 |
| 37 namespace WebCore { | 38 namespace WebCore { |
| 38 | 39 |
| 39 class LocalFrame; | 40 class LocalFrame; |
| 40 class UndoStep; | 41 class UndoStep; |
| 41 | 42 |
| 42 class UndoStack { | 43 class UndoStack { |
| 43 public: | 44 public: |
| 44 static PassOwnPtr<UndoStack> create(); | 45 static PassOwnPtr<UndoStack> create(); |
| 45 | 46 |
| 46 ~UndoStack(); | 47 ~UndoStack(); |
| 47 | 48 |
| 48 void registerUndoStep(PassRefPtr<UndoStep>); | 49 void registerUndoStep(PassRefPtrWillBeRawPtr<UndoStep>); |
| 49 void registerRedoStep(PassRefPtr<UndoStep>); | 50 void registerRedoStep(PassRefPtrWillBeRawPtr<UndoStep>); |
| 50 void didUnloadFrame(const LocalFrame&); | 51 void didUnloadFrame(const LocalFrame&); |
| 51 bool canUndo() const; | 52 bool canUndo() const; |
| 52 bool canRedo() const; | 53 bool canRedo() const; |
| 53 void undo(); | 54 void undo(); |
| 54 void redo(); | 55 void redo(); |
| 55 | 56 |
| 56 private: | 57 private: |
| 57 UndoStack(); | 58 UndoStack(); |
| 58 | 59 |
| 60 typedef WillBeHeapDeque<RefPtrWillBeMember<UndoStep> > UndoStepStack; |
| 61 typedef WillBePersistentHeapDeque<RefPtrWillBeMember<UndoStep> > WillBePersi
stentUndoStepStack; |
| 62 |
| 63 void filterOutUndoSteps(WillBePersistentUndoStepStack&, const LocalFrame&); |
| 64 |
| 59 bool m_inRedo; | 65 bool m_inRedo; |
| 60 | 66 WillBePersistentUndoStepStack m_undoStack; |
| 61 typedef Deque<RefPtr<UndoStep> > UndoStepStack; | 67 WillBePersistentUndoStepStack m_redoStack; |
| 62 void filterOutUndoSteps(UndoStepStack&, const LocalFrame&); | |
| 63 UndoStepStack m_undoStack; | |
| 64 UndoStepStack m_redoStack; | |
| 65 }; | 68 }; |
| 66 | 69 |
| 67 } // namespace WebCore | 70 } // namespace WebCore |
| 68 | 71 |
| 69 #endif | 72 #endif |
| OLD | NEW |