OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2008 Apple 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 } | 81 } |
82 static PassRefPtr<HistoryItem> create(const KURL& url, const String& target,
const String& parent, const String& title) | 82 static PassRefPtr<HistoryItem> create(const KURL& url, const String& target,
const String& parent, const String& title) |
83 { | 83 { |
84 return adoptRef(new HistoryItem(url, target, parent, title)); | 84 return adoptRef(new HistoryItem(url, target, parent, title)); |
85 } | 85 } |
86 | 86 |
87 ~HistoryItem(); | 87 ~HistoryItem(); |
88 | 88 |
89 PassRefPtr<HistoryItem> copy() const; | 89 PassRefPtr<HistoryItem> copy() const; |
90 | 90 |
| 91 // Resets the HistoryItem to its initial state, as returned by create(). |
| 92 void reset(); |
| 93 |
91 const String& originalURLString() const; | 94 const String& originalURLString() const; |
92 const String& urlString() const; | 95 const String& urlString() const; |
93 const String& title() const; | 96 const String& title() const; |
94 | 97 |
95 bool isInPageCache() const { return m_cachedPage; } | 98 bool isInPageCache() const { return m_cachedPage; } |
96 | 99 |
97 double lastVisitedTime() const; | 100 double lastVisitedTime() const; |
98 | 101 |
99 void setAlternateTitle(const String& alternateTitle); | 102 void setAlternateTitle(const String& alternateTitle); |
100 const String& alternateTitle() const; | 103 const String& alternateTitle() const; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 void setIsTargetItem(bool); | 137 void setIsTargetItem(bool); |
135 | 138 |
136 void setStateObject(PassRefPtr<SerializedScriptValue> object); | 139 void setStateObject(PassRefPtr<SerializedScriptValue> object); |
137 SerializedScriptValue* stateObject() const { return m_stateObject.get(); } | 140 SerializedScriptValue* stateObject() const { return m_stateObject.get(); } |
138 | 141 |
139 void setItemSequenceNumber(long long number) { m_itemSequenceNumber = number
; } | 142 void setItemSequenceNumber(long long number) { m_itemSequenceNumber = number
; } |
140 long long itemSequenceNumber() const { return m_itemSequenceNumber; } | 143 long long itemSequenceNumber() const { return m_itemSequenceNumber; } |
141 | 144 |
142 void setDocumentSequenceNumber(long long number) { m_documentSequenceNumber
= number; } | 145 void setDocumentSequenceNumber(long long number) { m_documentSequenceNumber
= number; } |
143 long long documentSequenceNumber() const { return m_documentSequenceNumber;
} | 146 long long documentSequenceNumber() const { return m_documentSequenceNumber;
} |
144 | 147 |
145 void setFormInfoFromRequest(const ResourceRequest&); | 148 void setFormInfoFromRequest(const ResourceRequest&); |
146 void setFormData(PassRefPtr<FormData>); | 149 void setFormData(PassRefPtr<FormData>); |
147 void setFormContentType(const String&); | 150 void setFormContentType(const String&); |
148 | 151 |
149 void recordInitialVisit(); | 152 void recordInitialVisit(); |
150 | 153 |
151 void setVisitCount(int); | 154 void setVisitCount(int); |
152 void setLastVisitWasFailure(bool wasFailure) { m_lastVisitWasFailure = wasFa
ilure; } | 155 void setLastVisitWasFailure(bool wasFailure) { m_lastVisitWasFailure = wasFa
ilure; } |
153 void setLastVisitWasHTTPNonGet(bool wasNotGet) { m_lastVisitWasHTTPNonGet =
wasNotGet; } | 156 void setLastVisitWasHTTPNonGet(bool wasNotGet) { m_lastVisitWasHTTPNonGet =
wasNotGet; } |
154 | 157 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 HistoryItemVector m_children; | 247 HistoryItemVector m_children; |
245 | 248 |
246 bool m_lastVisitWasFailure; | 249 bool m_lastVisitWasFailure; |
247 bool m_isTargetItem; | 250 bool m_isTargetItem; |
248 int m_visitCount; | 251 int m_visitCount; |
249 Vector<int> m_dailyVisitCounts; | 252 Vector<int> m_dailyVisitCounts; |
250 Vector<int> m_weeklyVisitCounts; | 253 Vector<int> m_weeklyVisitCounts; |
251 | 254 |
252 OwnPtr<Vector<String> > m_redirectURLs; | 255 OwnPtr<Vector<String> > m_redirectURLs; |
253 | 256 |
| 257 // If two HistoryItems have the same item sequence number, then they are |
| 258 // clones of one another. Traversing history from one such HistoryItem to |
| 259 // another is a no-op. HistoryItem clones are created for parent and |
| 260 // sibling frames when only a subframe navigates. |
254 long long m_itemSequenceNumber; | 261 long long m_itemSequenceNumber; |
255 | 262 |
| 263 // If two HistoryItems have the same document sequence number, then they |
| 264 // refer to the same instance of a document. Traversing history from one |
| 265 // such HistoryItem to another preserves the document. |
| 266 long long m_documentSequenceNumber; |
| 267 |
256 // Support for HTML5 History | 268 // Support for HTML5 History |
257 RefPtr<SerializedScriptValue> m_stateObject; | 269 RefPtr<SerializedScriptValue> m_stateObject; |
258 long long m_documentSequenceNumber; | |
259 | 270 |
260 // info used to repost form data | 271 // info used to repost form data |
261 RefPtr<FormData> m_formData; | 272 RefPtr<FormData> m_formData; |
262 String m_formContentType; | 273 String m_formContentType; |
263 | 274 |
264 // PageCache controls these fields. | 275 // PageCache controls these fields. |
265 HistoryItem* m_next; | 276 HistoryItem* m_next; |
266 HistoryItem* m_prev; | 277 HistoryItem* m_prev; |
267 RefPtr<CachedPage> m_cachedPage; | 278 RefPtr<CachedPage> m_cachedPage; |
268 | 279 |
(...skipping 13 matching lines...) Expand all Loading... |
282 }; //class HistoryItem | 293 }; //class HistoryItem |
283 | 294 |
284 } //namespace WebCore | 295 } //namespace WebCore |
285 | 296 |
286 #ifndef NDEBUG | 297 #ifndef NDEBUG |
287 // Outside the WebCore namespace for ease of invocation from gdb. | 298 // Outside the WebCore namespace for ease of invocation from gdb. |
288 extern "C" int showTree(const WebCore::HistoryItem*); | 299 extern "C" int showTree(const WebCore::HistoryItem*); |
289 #endif | 300 #endif |
290 | 301 |
291 #endif // HISTORYITEM_H | 302 #endif // HISTORYITEM_H |
OLD | NEW |