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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 , m_lastVisitWasFailure(item.m_lastVisitWasFailure) | 118 , m_lastVisitWasFailure(item.m_lastVisitWasFailure) |
119 , m_isInPageCache(item.m_isInPageCache) | 119 , m_isInPageCache(item.m_isInPageCache) |
120 , m_isTargetItem(item.m_isTargetItem) | 120 , m_isTargetItem(item.m_isTargetItem) |
121 , m_visitCount(item.m_visitCount) | 121 , m_visitCount(item.m_visitCount) |
122 , m_formContentType(item.m_formContentType) | 122 , m_formContentType(item.m_formContentType) |
123 { | 123 { |
124 if (item.m_formData) | 124 if (item.m_formData) |
125 m_formData = item.m_formData->copy(); | 125 m_formData = item.m_formData->copy(); |
126 | 126 |
127 unsigned size = item.m_subItems.size(); | 127 unsigned size = item.m_subItems.size(); |
128 m_subItems.reserveCapacity(size); | 128 m_subItems.reserveInitialCapacity(size); |
129 for (unsigned i = 0; i < size; ++i) | 129 for (unsigned i = 0; i < size; ++i) |
130 m_subItems.append(item.m_subItems[i]->copy()); | 130 m_subItems.append(item.m_subItems[i]->copy()); |
131 | 131 |
132 if (item.m_redirectURLs) | 132 if (item.m_redirectURLs) |
133 m_redirectURLs.set(new Vector<String>(*item.m_redirectURLs)); | 133 m_redirectURLs.set(new Vector<String>(*item.m_redirectURLs)); |
134 } | 134 } |
135 | 135 |
136 PassRefPtr<HistoryItem> HistoryItem::copy() const | 136 PassRefPtr<HistoryItem> HistoryItem::copy() const |
137 { | 137 { |
138 return adoptRef(new HistoryItem(*this)); | 138 return adoptRef(new HistoryItem(*this)); |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 ASSERT(otherItem); | 401 ASSERT(otherItem); |
402 if (otherItem != this) | 402 if (otherItem != this) |
403 m_visitCount += otherItem->m_visitCount; | 403 m_visitCount += otherItem->m_visitCount; |
404 } | 404 } |
405 | 405 |
406 void HistoryItem::addRedirectURL(const String& url) | 406 void HistoryItem::addRedirectURL(const String& url) |
407 { | 407 { |
408 if (!m_redirectURLs) | 408 if (!m_redirectURLs) |
409 m_redirectURLs.set(new Vector<String>); | 409 m_redirectURLs.set(new Vector<String>); |
410 | 410 |
411 m_redirectURLs->append(url); | 411 // Our API allows us to store all the URLs in the redirect chain, but for |
| 412 // now we only have a use for the final URL. |
| 413 (*m_redirectURLs).resize(1); |
| 414 (*m_redirectURLs)[0] = url; |
412 } | 415 } |
413 | 416 |
414 Vector<String>* HistoryItem::redirectURLs() const | 417 Vector<String>* HistoryItem::redirectURLs() const |
415 { | 418 { |
416 return m_redirectURLs.get(); | 419 return m_redirectURLs.get(); |
417 } | 420 } |
418 | 421 |
419 void HistoryItem::setRedirectURLs(std::auto_ptr<Vector<String> > redirectURLs) | 422 void HistoryItem::setRedirectURLs(std::auto_ptr<Vector<String> > redirectURLs) |
420 { | 423 { |
421 m_redirectURLs.adopt(redirectURLs); | 424 m_redirectURLs.adopt(redirectURLs); |
(...skipping 27 matching lines...) Expand all Loading... |
449 | 452 |
450 #ifndef NDEBUG | 453 #ifndef NDEBUG |
451 | 454 |
452 int showTree(const WebCore::HistoryItem* item) | 455 int showTree(const WebCore::HistoryItem* item) |
453 { | 456 { |
454 return item->showTree(); | 457 return item->showTree(); |
455 } | 458 } |
456 | 459 |
457 #endif | 460 #endif |
458 | 461 |
OLD | NEW |