| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 | 79 |
| 80 PassRefPtr<HistoryItem> HistoryItem::copy() const | 80 PassRefPtr<HistoryItem> HistoryItem::copy() const |
| 81 { | 81 { |
| 82 return adoptRef(new HistoryItem(*this)); | 82 return adoptRef(new HistoryItem(*this)); |
| 83 } | 83 } |
| 84 | 84 |
| 85 void HistoryItem::reset() | 85 void HistoryItem::reset() |
| 86 { | 86 { |
| 87 m_urlString = String(); | 87 m_urlString = String(); |
| 88 m_originalURLString = String(); | 88 m_originalURLString = String(); |
| 89 m_referrer = String(); | 89 m_referrer = nullAtom; |
| 90 m_target = String(); | 90 m_target = String(); |
| 91 m_itemSequenceNumber = generateSequenceNumber(); | 91 m_itemSequenceNumber = generateSequenceNumber(); |
| 92 m_stateObject = 0; | 92 m_stateObject = 0; |
| 93 m_documentSequenceNumber = generateSequenceNumber(); | 93 m_documentSequenceNumber = generateSequenceNumber(); |
| 94 m_targetFrameID = 0; | 94 m_targetFrameID = 0; |
| 95 m_formData = 0; | 95 m_formData = 0; |
| 96 m_formContentType = String(); | 96 m_formContentType = nullAtom; |
| 97 clearChildren(); | 97 clearChildren(); |
| 98 } | 98 } |
| 99 | 99 |
| 100 const String& HistoryItem::urlString() const | 100 const String& HistoryItem::urlString() const |
| 101 { | 101 { |
| 102 return m_urlString; | 102 return m_urlString; |
| 103 } | 103 } |
| 104 | 104 |
| 105 // The first URL we loaded to get to where this history item points. Includes b
oth client | 105 // The first URL we loaded to get to where this history item points. Includes b
oth client |
| 106 // and server redirects. | 106 // and server redirects. |
| 107 const String& HistoryItem::originalURLString() const | 107 const String& HistoryItem::originalURLString() const |
| 108 { | 108 { |
| 109 return m_originalURLString; | 109 return m_originalURLString; |
| 110 } | 110 } |
| 111 | 111 |
| 112 KURL HistoryItem::url() const | 112 KURL HistoryItem::url() const |
| 113 { | 113 { |
| 114 return KURL(ParsedURLString, m_urlString); | 114 return KURL(ParsedURLString, m_urlString); |
| 115 } | 115 } |
| 116 | 116 |
| 117 KURL HistoryItem::originalURL() const | 117 KURL HistoryItem::originalURL() const |
| 118 { | 118 { |
| 119 return KURL(ParsedURLString, m_originalURLString); | 119 return KURL(ParsedURLString, m_originalURLString); |
| 120 } | 120 } |
| 121 | 121 |
| 122 const String& HistoryItem::referrer() const | 122 const AtomicString& HistoryItem::referrer() const |
| 123 { | 123 { |
| 124 return m_referrer; | 124 return m_referrer; |
| 125 } | 125 } |
| 126 | 126 |
| 127 const String& HistoryItem::target() const | 127 const String& HistoryItem::target() const |
| 128 { | 128 { |
| 129 return m_target; | 129 return m_target; |
| 130 } | 130 } |
| 131 | 131 |
| 132 void HistoryItem::setURLString(const String& urlString) | 132 void HistoryItem::setURLString(const String& urlString) |
| 133 { | 133 { |
| 134 if (m_urlString != urlString) | 134 if (m_urlString != urlString) |
| 135 m_urlString = urlString; | 135 m_urlString = urlString; |
| 136 } | 136 } |
| 137 | 137 |
| 138 void HistoryItem::setURL(const KURL& url) | 138 void HistoryItem::setURL(const KURL& url) |
| 139 { | 139 { |
| 140 setURLString(url.string()); | 140 setURLString(url.string()); |
| 141 clearDocumentState(); | 141 clearDocumentState(); |
| 142 } | 142 } |
| 143 | 143 |
| 144 void HistoryItem::setOriginalURLString(const String& urlString) | 144 void HistoryItem::setOriginalURLString(const String& urlString) |
| 145 { | 145 { |
| 146 m_originalURLString = urlString; | 146 m_originalURLString = urlString; |
| 147 } | 147 } |
| 148 | 148 |
| 149 void HistoryItem::setReferrer(const String& referrer) | 149 void HistoryItem::setReferrer(const AtomicString& referrer) |
| 150 { | 150 { |
| 151 m_referrer = referrer; | 151 m_referrer = referrer; |
| 152 } | 152 } |
| 153 | 153 |
| 154 void HistoryItem::setTarget(const String& target) | 154 void HistoryItem::setTarget(const String& target) |
| 155 { | 155 { |
| 156 m_target = target; | 156 m_target = target; |
| 157 } | 157 } |
| 158 | 158 |
| 159 const IntPoint& HistoryItem::scrollPoint() const | 159 const IntPoint& HistoryItem::scrollPoint() const |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 const HistoryItemVector& HistoryItem::children() const | 210 const HistoryItemVector& HistoryItem::children() const |
| 211 { | 211 { |
| 212 return m_children; | 212 return m_children; |
| 213 } | 213 } |
| 214 | 214 |
| 215 void HistoryItem::clearChildren() | 215 void HistoryItem::clearChildren() |
| 216 { | 216 { |
| 217 m_children.clear(); | 217 m_children.clear(); |
| 218 } | 218 } |
| 219 | 219 |
| 220 String HistoryItem::formContentType() const | 220 const AtomicString& HistoryItem::formContentType() const |
| 221 { | 221 { |
| 222 return m_formContentType; | 222 return m_formContentType; |
| 223 } | 223 } |
| 224 | 224 |
| 225 void HistoryItem::setFormInfoFromRequest(const ResourceRequest& request) | 225 void HistoryItem::setFormInfoFromRequest(const ResourceRequest& request) |
| 226 { | 226 { |
| 227 m_referrer = request.httpReferrer(); | 227 m_referrer = request.httpReferrer(); |
| 228 | 228 |
| 229 if (equalIgnoringCase(request.httpMethod(), "POST")) { | 229 if (equalIgnoringCase(request.httpMethod(), "POST")) { |
| 230 // FIXME: Eventually we have to make this smart enough to handle the cas
e where | 230 // FIXME: Eventually we have to make this smart enough to handle the cas
e where |
| 231 // we have a stream for the body to handle the "data interspersed with f
iles" feature. | 231 // we have a stream for the body to handle the "data interspersed with f
iles" feature. |
| 232 m_formData = request.httpBody(); | 232 m_formData = request.httpBody(); |
| 233 m_formContentType = request.httpContentType(); | 233 m_formContentType = request.httpContentType(); |
| 234 } else { | 234 } else { |
| 235 m_formData = 0; | 235 m_formData = 0; |
| 236 m_formContentType = String(); | 236 m_formContentType = nullAtom; |
| 237 } | 237 } |
| 238 } | 238 } |
| 239 | 239 |
| 240 void HistoryItem::setFormData(PassRefPtr<FormData> formData) | 240 void HistoryItem::setFormData(PassRefPtr<FormData> formData) |
| 241 { | 241 { |
| 242 m_formData = formData; | 242 m_formData = formData; |
| 243 } | 243 } |
| 244 | 244 |
| 245 void HistoryItem::setFormContentType(const String& formContentType) | 245 void HistoryItem::setFormContentType(const AtomicString& formContentType) |
| 246 { | 246 { |
| 247 m_formContentType = formContentType; | 247 m_formContentType = formContentType; |
| 248 } | 248 } |
| 249 | 249 |
| 250 FormData* HistoryItem::formData() | 250 FormData* HistoryItem::formData() |
| 251 { | 251 { |
| 252 return m_formData.get(); | 252 return m_formData.get(); |
| 253 } | 253 } |
| 254 | 254 |
| 255 bool HistoryItem::isCurrentDocument(Document* doc) const | 255 bool HistoryItem::isCurrentDocument(Document* doc) const |
| 256 { | 256 { |
| 257 // FIXME: We should find a better way to check if this is the current docume
nt. | 257 // FIXME: We should find a better way to check if this is the current docume
nt. |
| 258 return equalIgnoringFragmentIdentifier(url(), doc->url()); | 258 return equalIgnoringFragmentIdentifier(url(), doc->url()); |
| 259 } | 259 } |
| 260 | 260 |
| 261 } // namespace WebCore | 261 } // namespace WebCore |
| 262 | 262 |
| OLD | NEW |