| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2008, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2008, 2011 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2012 Research In Motion Limited. All rights reserved. | 3 * Copyright (C) 2012 Research In Motion Limited. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 25 */ | 25 */ |
| 26 | 26 |
| 27 #ifndef HistoryItem_h | 27 #ifndef HistoryItem_h |
| 28 #define HistoryItem_h | 28 #define HistoryItem_h |
| 29 | 29 |
| 30 #include "bindings/core/v8/SerializedScriptValue.h" | 30 #include "bindings/core/v8/SerializedScriptValue.h" |
| 31 #include "platform/geometry/FloatPoint.h" | 31 #include "platform/geometry/FloatPoint.h" |
| 32 #include "platform/geometry/IntPoint.h" | 32 #include "platform/geometry/IntPoint.h" |
| 33 #include "platform/heap/Handle.h" |
| 33 #include "platform/weborigin/Referrer.h" | 34 #include "platform/weborigin/Referrer.h" |
| 34 #include "wtf/RefCounted.h" | 35 #include "wtf/RefCounted.h" |
| 35 #include "wtf/text/WTFString.h" | 36 #include "wtf/text/WTFString.h" |
| 36 | 37 |
| 37 namespace blink { | 38 namespace blink { |
| 38 | 39 |
| 39 class Document; | 40 class Document; |
| 40 class DocumentState; | 41 class DocumentState; |
| 41 class FormData; | 42 class FormData; |
| 42 class HistoryItem; | |
| 43 class KURL; | 43 class KURL; |
| 44 class ResourceRequest; | 44 class ResourceRequest; |
| 45 | 45 |
| 46 typedef Vector<RefPtr<HistoryItem> > HistoryItemVector; | 46 class HistoryItem final : public RefCountedWillBeGarbageCollectedFinalized<Histo
ryItem> { |
| 47 | |
| 48 class HistoryItem : public RefCounted<HistoryItem> { | |
| 49 public: | 47 public: |
| 50 static PassRefPtr<HistoryItem> create() { return adoptRef(new HistoryItem);
} | 48 static PassRefPtrWillBeRawPtr<HistoryItem> create() |
| 49 { |
| 50 return adoptRefWillBeNoop(new HistoryItem); |
| 51 } |
| 51 ~HistoryItem(); | 52 ~HistoryItem(); |
| 52 | 53 |
| 53 // Used when the frame this item represents was navigated to a different | 54 // Used when the frame this item represents was navigated to a different |
| 54 // url but a new item wasn't created. | 55 // url but a new item wasn't created. |
| 55 void generateNewItemSequenceNumber(); | 56 void generateNewItemSequenceNumber(); |
| 56 void generateNewDocumentSequenceNumber(); | 57 void generateNewDocumentSequenceNumber(); |
| 57 | 58 |
| 58 const String& urlString() const; | 59 const String& urlString() const; |
| 59 KURL url() const; | 60 KURL url() const; |
| 60 | 61 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 | 96 |
| 96 void setFrameSequenceNumber(long long number) { m_frameSequenceNumber = numb
er; } | 97 void setFrameSequenceNumber(long long number) { m_frameSequenceNumber = numb
er; } |
| 97 long long frameSequenceNumber() const { return m_frameSequenceNumber; } | 98 long long frameSequenceNumber() const { return m_frameSequenceNumber; } |
| 98 | 99 |
| 99 void setFormInfoFromRequest(const ResourceRequest&); | 100 void setFormInfoFromRequest(const ResourceRequest&); |
| 100 void setFormData(PassRefPtr<FormData>); | 101 void setFormData(PassRefPtr<FormData>); |
| 101 void setFormContentType(const AtomicString&); | 102 void setFormContentType(const AtomicString&); |
| 102 | 103 |
| 103 bool isCurrentDocument(Document*) const; | 104 bool isCurrentDocument(Document*) const; |
| 104 | 105 |
| 106 void trace(Visitor*); |
| 107 |
| 105 private: | 108 private: |
| 106 HistoryItem(); | 109 HistoryItem(); |
| 107 | 110 |
| 108 String m_urlString; | 111 String m_urlString; |
| 109 Referrer m_referrer; | 112 Referrer m_referrer; |
| 110 String m_target; | 113 String m_target; |
| 111 | 114 |
| 112 FloatPoint m_pinchViewportScrollPoint; | 115 FloatPoint m_pinchViewportScrollPoint; |
| 113 IntPoint m_scrollPoint; | 116 IntPoint m_scrollPoint; |
| 114 float m_pageScaleFactor; | 117 float m_pageScaleFactor; |
| 115 Vector<String> m_documentStateVector; | 118 Vector<String> m_documentStateVector; |
| 116 RefPtrWillBePersistent<DocumentState> m_documentState; | 119 RefPtrWillBeMember<DocumentState> m_documentState; |
| 117 | 120 |
| 118 // If two HistoryItems have the same item sequence number, then they are | 121 // If two HistoryItems have the same item sequence number, then they are |
| 119 // clones of one another. Traversing history from one such HistoryItem to | 122 // clones of one another. Traversing history from one such HistoryItem to |
| 120 // another is a no-op. HistoryItem clones are created for parent and | 123 // another is a no-op. HistoryItem clones are created for parent and |
| 121 // sibling frames when only a subframe navigates. | 124 // sibling frames when only a subframe navigates. |
| 122 int64_t m_itemSequenceNumber; | 125 int64_t m_itemSequenceNumber; |
| 123 | 126 |
| 124 // If two HistoryItems have the same document sequence number, then they | 127 // If two HistoryItems have the same document sequence number, then they |
| 125 // refer to the same instance of a document. Traversing history from one | 128 // refer to the same instance of a document. Traversing history from one |
| 126 // such HistoryItem to another preserves the document. | 129 // such HistoryItem to another preserves the document. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 137 | 140 |
| 138 // info used to repost form data | 141 // info used to repost form data |
| 139 RefPtr<FormData> m_formData; | 142 RefPtr<FormData> m_formData; |
| 140 AtomicString m_formContentType; | 143 AtomicString m_formContentType; |
| 141 | 144 |
| 142 }; // class HistoryItem | 145 }; // class HistoryItem |
| 143 | 146 |
| 144 } // namespace blink | 147 } // namespace blink |
| 145 | 148 |
| 146 #endif // HISTORYITEM_H | 149 #endif // HISTORYITEM_H |
| OLD | NEW |