| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 InspectorHistory_h | 31 #ifndef InspectorHistory_h |
| 32 #define InspectorHistory_h | 32 #define InspectorHistory_h |
| 33 | 33 |
| 34 #include "platform/heap/Handle.h" |
| 34 #include "wtf/RefPtr.h" | 35 #include "wtf/RefPtr.h" |
| 35 #include "wtf/Vector.h" | 36 #include "wtf/Vector.h" |
| 36 #include "wtf/text/WTFString.h" | 37 #include "wtf/text/WTFString.h" |
| 37 | 38 |
| 38 namespace WebCore { | 39 namespace WebCore { |
| 39 | 40 |
| 40 class ExceptionState; | 41 class ExceptionState; |
| 41 | 42 |
| 42 class InspectorHistory FINAL { | 43 class InspectorHistory FINAL : public NoBaseWillBeGarbageCollected<InspectorHist
ory> { |
| 43 WTF_MAKE_NONCOPYABLE(InspectorHistory); WTF_MAKE_FAST_ALLOCATED; | 44 WTF_MAKE_NONCOPYABLE(InspectorHistory); |
| 45 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; |
| 44 public: | 46 public: |
| 45 class Action : public RefCounted<Action> { | 47 class Action : public RefCountedWillBeGarbageCollectedFinalized<Action> { |
| 46 WTF_MAKE_FAST_ALLOCATED; | 48 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; |
| 47 public: | 49 public: |
| 48 Action(const String& name); | 50 explicit Action(const String& name); |
| 49 virtual ~Action(); | 51 virtual ~Action(); |
| 52 virtual void trace(Visitor*); |
| 50 virtual String toString(); | 53 virtual String toString(); |
| 51 | 54 |
| 52 virtual String mergeId(); | 55 virtual String mergeId(); |
| 53 virtual void merge(PassRefPtr<Action>); | 56 virtual void merge(PassRefPtrWillBeRawPtr<Action>); |
| 54 | 57 |
| 55 virtual bool perform(ExceptionState&) = 0; | 58 virtual bool perform(ExceptionState&) = 0; |
| 56 | 59 |
| 57 virtual bool undo(ExceptionState&) = 0; | 60 virtual bool undo(ExceptionState&) = 0; |
| 58 virtual bool redo(ExceptionState&) = 0; | 61 virtual bool redo(ExceptionState&) = 0; |
| 59 | 62 |
| 60 virtual bool isUndoableStateMark(); | 63 virtual bool isUndoableStateMark(); |
| 61 private: | 64 private: |
| 62 String m_name; | 65 String m_name; |
| 63 }; | 66 }; |
| 64 | 67 |
| 65 InspectorHistory(); | 68 InspectorHistory(); |
| 69 void trace(Visitor*); |
| 66 | 70 |
| 67 bool perform(PassRefPtr<Action>, ExceptionState&); | 71 bool perform(PassRefPtrWillBeRawPtr<Action>, ExceptionState&); |
| 68 void markUndoableState(); | 72 void markUndoableState(); |
| 69 | 73 |
| 70 bool undo(ExceptionState&); | 74 bool undo(ExceptionState&); |
| 71 bool redo(ExceptionState&); | 75 bool redo(ExceptionState&); |
| 72 void reset(); | 76 void reset(); |
| 73 | 77 |
| 74 private: | 78 private: |
| 75 Vector<RefPtr<Action> > m_history; | 79 WillBeHeapVector<RefPtrWillBeMember<Action> > m_history; |
| 76 size_t m_afterLastActionIndex; | 80 size_t m_afterLastActionIndex; |
| 77 }; | 81 }; |
| 78 | 82 |
| 79 | 83 |
| 80 } // namespace WebCore | 84 } // namespace WebCore |
| 81 | 85 |
| 82 #endif // !defined(InspectorHistory_h) | 86 #endif // !defined(InspectorHistory_h) |
| OLD | NEW |