OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 void (*notifyHistoryItemChanged)(HistoryItem*) = defaultNotifyHistoryItemChanged
; | 53 void (*notifyHistoryItemChanged)(HistoryItem*) = defaultNotifyHistoryItemChanged
; |
54 | 54 |
55 HistoryItem::HistoryItem() | 55 HistoryItem::HistoryItem() |
56 : m_lastVisitedTime(0) | 56 : m_lastVisitedTime(0) |
57 , m_lastVisitWasHTTPNonGet(false) | 57 , m_lastVisitWasHTTPNonGet(false) |
58 , m_lastVisitWasFailure(false) | 58 , m_lastVisitWasFailure(false) |
59 , m_isTargetItem(false) | 59 , m_isTargetItem(false) |
60 , m_visitCount(0) | 60 , m_visitCount(0) |
61 , m_itemSequenceNumber(generateSequenceNumber()) | 61 , m_itemSequenceNumber(generateSequenceNumber()) |
62 , m_documentSequenceNumber(generateSequenceNumber()) | 62 , m_documentSequenceNumber(generateSequenceNumber()) |
| 63 , m_next(0) |
| 64 , m_prev(0) |
63 { | 65 { |
64 } | 66 } |
65 | 67 |
66 HistoryItem::HistoryItem(const String& urlString, const String& title, double ti
me) | 68 HistoryItem::HistoryItem(const String& urlString, const String& title, double ti
me) |
67 : m_urlString(urlString) | 69 : m_urlString(urlString) |
68 , m_originalURLString(urlString) | 70 , m_originalURLString(urlString) |
69 , m_title(title) | 71 , m_title(title) |
70 , m_lastVisitedTime(time) | 72 , m_lastVisitedTime(time) |
71 , m_lastVisitWasHTTPNonGet(false) | 73 , m_lastVisitWasHTTPNonGet(false) |
72 , m_lastVisitWasFailure(false) | 74 , m_lastVisitWasFailure(false) |
73 , m_isTargetItem(false) | 75 , m_isTargetItem(false) |
74 , m_visitCount(0) | 76 , m_visitCount(0) |
75 , m_itemSequenceNumber(generateSequenceNumber()) | 77 , m_itemSequenceNumber(generateSequenceNumber()) |
76 , m_documentSequenceNumber(generateSequenceNumber()) | 78 , m_documentSequenceNumber(generateSequenceNumber()) |
| 79 , m_next(0) |
| 80 , m_prev(0) |
77 { | 81 { |
78 iconDatabase()->retainIconForPageURL(m_urlString); | 82 iconDatabase()->retainIconForPageURL(m_urlString); |
79 } | 83 } |
80 | 84 |
81 HistoryItem::HistoryItem(const String& urlString, const String& title, const Str
ing& alternateTitle, double time) | 85 HistoryItem::HistoryItem(const String& urlString, const String& title, const Str
ing& alternateTitle, double time) |
82 : m_urlString(urlString) | 86 : m_urlString(urlString) |
83 , m_originalURLString(urlString) | 87 , m_originalURLString(urlString) |
84 , m_title(title) | 88 , m_title(title) |
85 , m_displayTitle(alternateTitle) | 89 , m_displayTitle(alternateTitle) |
86 , m_lastVisitedTime(time) | 90 , m_lastVisitedTime(time) |
87 , m_lastVisitWasHTTPNonGet(false) | 91 , m_lastVisitWasHTTPNonGet(false) |
88 , m_lastVisitWasFailure(false) | 92 , m_lastVisitWasFailure(false) |
89 , m_isTargetItem(false) | 93 , m_isTargetItem(false) |
90 , m_visitCount(0) | 94 , m_visitCount(0) |
91 , m_itemSequenceNumber(generateSequenceNumber()) | 95 , m_itemSequenceNumber(generateSequenceNumber()) |
92 , m_documentSequenceNumber(generateSequenceNumber()) | 96 , m_documentSequenceNumber(generateSequenceNumber()) |
| 97 , m_next(0) |
| 98 , m_prev(0) |
93 { | 99 { |
94 iconDatabase()->retainIconForPageURL(m_urlString); | 100 iconDatabase()->retainIconForPageURL(m_urlString); |
95 } | 101 } |
96 | 102 |
97 HistoryItem::HistoryItem(const KURL& url, const String& target, const String& pa
rent, const String& title) | 103 HistoryItem::HistoryItem(const KURL& url, const String& target, const String& pa
rent, const String& title) |
98 : m_urlString(url.string()) | 104 : m_urlString(url.string()) |
99 , m_originalURLString(url.string()) | 105 , m_originalURLString(url.string()) |
100 , m_target(target) | 106 , m_target(target) |
101 , m_parent(parent) | 107 , m_parent(parent) |
102 , m_title(title) | 108 , m_title(title) |
103 , m_lastVisitedTime(0) | 109 , m_lastVisitedTime(0) |
104 , m_lastVisitWasHTTPNonGet(false) | 110 , m_lastVisitWasHTTPNonGet(false) |
105 , m_lastVisitWasFailure(false) | 111 , m_lastVisitWasFailure(false) |
106 , m_isTargetItem(false) | 112 , m_isTargetItem(false) |
107 , m_visitCount(0) | 113 , m_visitCount(0) |
108 , m_itemSequenceNumber(generateSequenceNumber()) | 114 , m_itemSequenceNumber(generateSequenceNumber()) |
109 , m_documentSequenceNumber(generateSequenceNumber()) | 115 , m_documentSequenceNumber(generateSequenceNumber()) |
| 116 , m_next(0) |
| 117 , m_prev(0) |
110 { | 118 { |
111 iconDatabase()->retainIconForPageURL(m_urlString); | 119 iconDatabase()->retainIconForPageURL(m_urlString); |
112 } | 120 } |
113 | 121 |
114 HistoryItem::~HistoryItem() | 122 HistoryItem::~HistoryItem() |
115 { | 123 { |
116 ASSERT(!m_cachedPage); | 124 ASSERT(!m_cachedPage); |
117 iconDatabase()->releaseIconForPageURL(m_urlString); | 125 iconDatabase()->releaseIconForPageURL(m_urlString); |
118 #if PLATFORM(ANDROID) | 126 #if PLATFORM(ANDROID) |
119 if (m_bridge) | 127 if (m_bridge) |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 | 160 |
153 if (item.m_redirectURLs) | 161 if (item.m_redirectURLs) |
154 m_redirectURLs = adoptPtr(new Vector<String>(*item.m_redirectURLs)); | 162 m_redirectURLs = adoptPtr(new Vector<String>(*item.m_redirectURLs)); |
155 } | 163 } |
156 | 164 |
157 PassRefPtr<HistoryItem> HistoryItem::copy() const | 165 PassRefPtr<HistoryItem> HistoryItem::copy() const |
158 { | 166 { |
159 return adoptRef(new HistoryItem(*this)); | 167 return adoptRef(new HistoryItem(*this)); |
160 } | 168 } |
161 | 169 |
| 170 void HistoryItem::reset() |
| 171 { |
| 172 iconDatabase()->releaseIconForPageURL(m_urlString); |
| 173 |
| 174 m_urlString = String(); |
| 175 m_originalURLString = String(); |
| 176 m_referrer = String(); |
| 177 m_target = String(); |
| 178 m_parent = String(); |
| 179 m_title = String(); |
| 180 m_displayTitle = String(); |
| 181 |
| 182 m_lastVisitedTime = 0; |
| 183 m_lastVisitWasHTTPNonGet = false; |
| 184 |
| 185 m_lastVisitWasFailure = false; |
| 186 m_isTargetItem = false; |
| 187 m_visitCount = 0; |
| 188 m_dailyVisitCounts.clear(); |
| 189 m_weeklyVisitCounts.clear(); |
| 190 |
| 191 m_redirectURLs.clear(); |
| 192 |
| 193 m_itemSequenceNumber = generateSequenceNumber(); |
| 194 |
| 195 m_stateObject = 0; |
| 196 m_documentSequenceNumber = generateSequenceNumber(); |
| 197 |
| 198 m_formData = 0; |
| 199 m_formContentType = String(); |
| 200 } |
| 201 |
162 const String& HistoryItem::urlString() const | 202 const String& HistoryItem::urlString() const |
163 { | 203 { |
164 return m_urlString; | 204 return m_urlString; |
165 } | 205 } |
166 | 206 |
167 // The first URL we loaded to get to where this history item points. Includes b
oth client | 207 // The first URL we loaded to get to where this history item points. Includes b
oth client |
168 // and server redirects. | 208 // and server redirects. |
169 const String& HistoryItem::originalURLString() const | 209 const String& HistoryItem::originalURLString() const |
170 { | 210 { |
171 return m_originalURLString; | 211 return m_originalURLString; |
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
648 } // namespace WebCore | 688 } // namespace WebCore |
649 | 689 |
650 #ifndef NDEBUG | 690 #ifndef NDEBUG |
651 | 691 |
652 int showTree(const WebCore::HistoryItem* item) | 692 int showTree(const WebCore::HistoryItem* item) |
653 { | 693 { |
654 return item->showTree(); | 694 return item->showTree(); |
655 } | 695 } |
656 | 696 |
657 #endif | 697 #endif |
OLD | NEW |