| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2005, 2006, 2008, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006, 2008, 2011 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 // Initialize to the current time to reduce the likelihood of generating | 43 // Initialize to the current time to reduce the likelihood of generating |
| 44 // identifiers that overlap with those from past/future browser sessions. | 44 // identifiers that overlap with those from past/future browser sessions. |
| 45 static long long next = static_cast<long long>(currentTime() * 1000000.0); | 45 static long long next = static_cast<long long>(currentTime() * 1000000.0); |
| 46 return ++next; | 46 return ++next; |
| 47 } | 47 } |
| 48 | 48 |
| 49 HistoryItem::HistoryItem() | 49 HistoryItem::HistoryItem() |
| 50 : m_pageScaleFactor(0) | 50 : m_pageScaleFactor(0) |
| 51 , m_itemSequenceNumber(generateSequenceNumber()) | 51 , m_itemSequenceNumber(generateSequenceNumber()) |
| 52 , m_documentSequenceNumber(generateSequenceNumber()) | 52 , m_documentSequenceNumber(generateSequenceNumber()) |
| 53 , m_targetFrameID(0) |
| 53 { | 54 { |
| 54 } | 55 } |
| 55 | 56 |
| 56 HistoryItem::~HistoryItem() | 57 HistoryItem::~HistoryItem() |
| 57 { | 58 { |
| 58 } | 59 } |
| 59 | 60 |
| 60 inline HistoryItem::HistoryItem(const HistoryItem& item) | 61 inline HistoryItem::HistoryItem(const HistoryItem& item) |
| 61 : RefCounted<HistoryItem>() | 62 : RefCounted<HistoryItem>() |
| 62 , m_urlString(item.m_urlString) | 63 , m_urlString(item.m_urlString) |
| 63 , m_originalURLString(item.m_originalURLString) | 64 , m_originalURLString(item.m_originalURLString) |
| 64 , m_referrer(item.m_referrer) | 65 , m_referrer(item.m_referrer) |
| 65 , m_target(item.m_target) | 66 , m_target(item.m_target) |
| 66 , m_scrollPoint(item.m_scrollPoint) | 67 , m_scrollPoint(item.m_scrollPoint) |
| 67 , m_pageScaleFactor(item.m_pageScaleFactor) | 68 , m_pageScaleFactor(item.m_pageScaleFactor) |
| 68 , m_itemSequenceNumber(item.m_itemSequenceNumber) | 69 , m_itemSequenceNumber(item.m_itemSequenceNumber) |
| 69 , m_documentSequenceNumber(item.m_documentSequenceNumber) | 70 , m_documentSequenceNumber(item.m_documentSequenceNumber) |
| 71 , m_targetFrameID(item.m_targetFrameID) |
| 72 , m_stateObject(item.m_stateObject) |
| 70 , m_formContentType(item.m_formContentType) | 73 , m_formContentType(item.m_formContentType) |
| 71 { | 74 { |
| 72 if (item.m_formData) | 75 if (item.m_formData) |
| 73 m_formData = item.m_formData->copy(); | 76 m_formData = item.m_formData->copy(); |
| 74 | 77 |
| 75 unsigned size = item.m_children.size(); | 78 unsigned size = item.m_children.size(); |
| 76 m_children.reserveInitialCapacity(size); | 79 m_children.reserveInitialCapacity(size); |
| 77 for (unsigned i = 0; i < size; ++i) | 80 for (unsigned i = 0; i < size; ++i) |
| 78 m_children.uncheckedAppend(item.m_children[i]->copy()); | 81 m_children.uncheckedAppend(item.m_children[i]->copy()); |
| 79 } | 82 } |
| 80 | 83 |
| 81 PassRefPtr<HistoryItem> HistoryItem::copy() const | 84 PassRefPtr<HistoryItem> HistoryItem::copy() const |
| 82 { | 85 { |
| 83 return adoptRef(new HistoryItem(*this)); | 86 return adoptRef(new HistoryItem(*this)); |
| 84 } | 87 } |
| 85 | 88 |
| 86 void HistoryItem::reset() | 89 void HistoryItem::reset() |
| 87 { | 90 { |
| 88 m_urlString = String(); | 91 m_urlString = String(); |
| 89 m_originalURLString = String(); | 92 m_originalURLString = String(); |
| 90 m_referrer = String(); | 93 m_referrer = String(); |
| 91 m_target = String(); | 94 m_target = String(); |
| 92 m_itemSequenceNumber = generateSequenceNumber(); | 95 m_itemSequenceNumber = generateSequenceNumber(); |
| 93 m_stateObject = 0; | 96 m_stateObject = 0; |
| 94 m_documentSequenceNumber = generateSequenceNumber(); | 97 m_documentSequenceNumber = generateSequenceNumber(); |
| 98 m_targetFrameID = 0; |
| 95 m_formData = 0; | 99 m_formData = 0; |
| 96 m_formContentType = String(); | 100 m_formContentType = String(); |
| 97 clearChildren(); | 101 clearChildren(); |
| 98 } | 102 } |
| 99 | 103 |
| 100 const String& HistoryItem::urlString() const | 104 const String& HistoryItem::urlString() const |
| 101 { | 105 { |
| 102 return m_urlString; | 106 return m_urlString; |
| 103 } | 107 } |
| 104 | 108 |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 } // namespace WebCore | 377 } // namespace WebCore |
| 374 | 378 |
| 375 #ifndef NDEBUG | 379 #ifndef NDEBUG |
| 376 | 380 |
| 377 int showTree(const WebCore::HistoryItem* item) | 381 int showTree(const WebCore::HistoryItem* item) |
| 378 { | 382 { |
| 379 return item->showTree(); | 383 return item->showTree(); |
| 380 } | 384 } |
| 381 | 385 |
| 382 #endif | 386 #endif |
| OLD | NEW |