| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "WebHistoryItem.h" | 32 #include "WebHistoryItem.h" |
| 33 | 33 |
| 34 #include "FormData.h" | 34 #include "FormData.h" |
| 35 #include "HistoryItem.h" | 35 #include "HistoryItem.h" |
| 36 #include "KURL.h" | 36 #include "KURL.h" |
| 37 | 37 |
| 38 #include "WebHTTPBody.h" | 38 #include "WebHTTPBody.h" |
| 39 #include "WebHTTPHeaderVisitor.h" |
| 39 #include "WebPoint.h" | 40 #include "WebPoint.h" |
| 40 #include "WebString.h" | 41 #include "WebString.h" |
| 41 #include "WebVector.h" | 42 #include "WebVector.h" |
| 42 | 43 |
| 43 using namespace WebCore; | 44 using namespace WebCore; |
| 44 | 45 |
| 45 namespace WebKit { | 46 namespace WebKit { |
| 46 | 47 |
| 47 class WebHistoryItemPrivate : public HistoryItem { | 48 class WebHistoryItemPrivate : public HistoryItem { |
| 48 }; | 49 }; |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 ASSERT(!isNull()); | 235 ASSERT(!isNull()); |
| 235 return WebHTTPBody(m_private->formData()); | 236 return WebHTTPBody(m_private->formData()); |
| 236 } | 237 } |
| 237 | 238 |
| 238 void WebHistoryItem::setHTTPBody(const WebHTTPBody& httpBody) | 239 void WebHistoryItem::setHTTPBody(const WebHTTPBody& httpBody) |
| 239 { | 240 { |
| 240 ensureMutable(); | 241 ensureMutable(); |
| 241 m_private->setFormData(httpBody); | 242 m_private->setFormData(httpBody); |
| 242 } | 243 } |
| 243 | 244 |
| 245 void WebHistoryItem::setHTTPHeaderField(const WebString& name, |
| 246 const WebString& value) |
| 247 { |
| 248 m_private->setHTTPHeaderField(name, value); |
| 249 } |
| 250 |
| 251 void WebHistoryItem::visitHTTPHeaderFields(WebHTTPHeaderVisitor* visitor) const |
| 252 { |
| 253 ASSERT(visitor); |
| 254 const HTTPHeaderMap& headerMap = m_private->httpHeaderFields(); |
| 255 HTTPHeaderMap::const_iterator it = headerMap.begin(); |
| 256 for (; it != headerMap.end(); ++it) |
| 257 visitor->visitHeader(it->first, it->second); |
| 258 } |
| 259 |
| 244 WebVector<WebHistoryItem> WebHistoryItem::children() const | 260 WebVector<WebHistoryItem> WebHistoryItem::children() const |
| 245 { | 261 { |
| 246 ASSERT(!isNull()); | 262 ASSERT(!isNull()); |
| 247 return m_private->children(); | 263 return m_private->children(); |
| 248 } | 264 } |
| 249 | 265 |
| 250 void WebHistoryItem::setChildren(const WebVector<WebHistoryItem>& items) | 266 void WebHistoryItem::setChildren(const WebVector<WebHistoryItem>& items) |
| 251 { | 267 { |
| 252 ensureMutable(); | 268 ensureMutable(); |
| 253 m_private->clearChildren(); | 269 m_private->clearChildren(); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 } | 302 } |
| 287 | 303 |
| 288 void WebHistoryItem::ensureMutable() | 304 void WebHistoryItem::ensureMutable() |
| 289 { | 305 { |
| 290 ASSERT(!isNull()); | 306 ASSERT(!isNull()); |
| 291 if (!m_private->hasOneRef()) | 307 if (!m_private->hasOneRef()) |
| 292 assign(static_cast<WebHistoryItemPrivate*>(m_private->copy().releaseRef())); | 308 assign(static_cast<WebHistoryItemPrivate*>(m_private->copy().releaseRef())); |
| 293 } | 309 } |
| 294 | 310 |
| 295 } // namespace WebKit | 311 } // namespace WebKit |
| OLD | NEW |