| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include <string> | 6 #include <string> |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 | 9 |
| 10 MSVC_PUSH_WARNING_LEVEL(0); | 10 MSVC_PUSH_WARNING_LEVEL(0); |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 WriteString(item->originalURLString(), obj); | 237 WriteString(item->originalURLString(), obj); |
| 238 WriteString(item->target(), obj); | 238 WriteString(item->target(), obj); |
| 239 WriteString(item->parent(), obj); | 239 WriteString(item->parent(), obj); |
| 240 WriteString(item->title(), obj); | 240 WriteString(item->title(), obj); |
| 241 WriteString(item->alternateTitle(), obj); | 241 WriteString(item->alternateTitle(), obj); |
| 242 WriteReal(item->lastVisitedTime(), obj); | 242 WriteReal(item->lastVisitedTime(), obj); |
| 243 WriteInteger(item->scrollPoint().x(), obj); | 243 WriteInteger(item->scrollPoint().x(), obj); |
| 244 WriteInteger(item->scrollPoint().y(), obj); | 244 WriteInteger(item->scrollPoint().y(), obj); |
| 245 WriteBoolean(item->isTargetItem(), obj); | 245 WriteBoolean(item->isTargetItem(), obj); |
| 246 WriteInteger(item->visitCount(), obj); | 246 WriteInteger(item->visitCount(), obj); |
| 247 WriteString(item->rssFeedReferrer(), obj); | 247 WriteString(item->referrer(), obj); |
| 248 | 248 |
| 249 WriteStringVector(item->documentState(), obj); | 249 WriteStringVector(item->documentState(), obj); |
| 250 | 250 |
| 251 // No access to formData through a const HistoryItem = lame. | 251 // No access to formData through a const HistoryItem = lame. |
| 252 WriteFormData(const_cast<HistoryItem*>(item)->formData(), obj); | 252 WriteFormData(const_cast<HistoryItem*>(item)->formData(), obj); |
| 253 WriteString(item->formContentType(), obj); | 253 WriteString(item->formContentType(), obj); |
| 254 WriteString(item->formReferrer(), obj); | 254 WriteString(item->referrer(), obj); |
| 255 | 255 |
| 256 // Subitems | 256 // Subitems |
| 257 WriteInteger(static_cast<int>(item->children().size()), obj); | 257 WriteInteger(static_cast<int>(item->children().size()), obj); |
| 258 for (size_t i = 0, c = item->children().size(); i < c; ++i) | 258 for (size_t i = 0, c = item->children().size(); i < c; ++i) |
| 259 WriteHistoryItem(item->children().at(i).get(), obj); | 259 WriteHistoryItem(item->children().at(i).get(), obj); |
| 260 } | 260 } |
| 261 | 261 |
| 262 // Creates a new HistoryItem tree based on the serialized string. | 262 // Creates a new HistoryItem tree based on the serialized string. |
| 263 // Assumes the data is in the format returned by WriteHistoryItem. | 263 // Assumes the data is in the format returned by WriteHistoryItem. |
| 264 static PassRefPtr<HistoryItem> ReadHistoryItem(const SerializeObject* obj) { | 264 static PassRefPtr<HistoryItem> ReadHistoryItem(const SerializeObject* obj) { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 275 item->setTarget(ReadString(obj)); | 275 item->setTarget(ReadString(obj)); |
| 276 item->setParent(ReadString(obj)); | 276 item->setParent(ReadString(obj)); |
| 277 item->setTitle(ReadString(obj)); | 277 item->setTitle(ReadString(obj)); |
| 278 item->setAlternateTitle(ReadString(obj)); | 278 item->setAlternateTitle(ReadString(obj)); |
| 279 item->setLastVisitedTime(ReadReal(obj)); | 279 item->setLastVisitedTime(ReadReal(obj)); |
| 280 int x = ReadInteger(obj); | 280 int x = ReadInteger(obj); |
| 281 int y = ReadInteger(obj); | 281 int y = ReadInteger(obj); |
| 282 item->setScrollPoint(IntPoint(x, y)); | 282 item->setScrollPoint(IntPoint(x, y)); |
| 283 item->setIsTargetItem(ReadBoolean(obj)); | 283 item->setIsTargetItem(ReadBoolean(obj)); |
| 284 item->setVisitCount(ReadInteger(obj)); | 284 item->setVisitCount(ReadInteger(obj)); |
| 285 item->setRSSFeedReferrer(ReadString(obj)); | 285 item->setReferrer(ReadString(obj)); |
| 286 | 286 |
| 287 Vector<String> document_state; | 287 Vector<String> document_state; |
| 288 ReadStringVector(obj, &document_state); | 288 ReadStringVector(obj, &document_state); |
| 289 item->setDocumentState(document_state); | 289 item->setDocumentState(document_state); |
| 290 | 290 |
| 291 // Form data. If there is any form data, we assume POST, otherwise GET. | 291 // Form data. If there is any form data, we assume POST, otherwise GET. |
| 292 // ResourceRequest takes ownership of the new FormData, then gives it to | 292 // ResourceRequest takes ownership of the new FormData, then gives it to |
| 293 // HistoryItem. | 293 // HistoryItem. |
| 294 ResourceRequest dummy_request; // only way to initialize HistoryItem | 294 ResourceRequest dummy_request; // only way to initialize HistoryItem |
| 295 dummy_request.setHTTPBody(ReadFormData(obj)); | 295 dummy_request.setHTTPBody(ReadFormData(obj)); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 std::string CreateHistoryStateForURL(const GURL& url) { | 355 std::string CreateHistoryStateForURL(const GURL& url) { |
| 356 // TODO(eseide): We probably should be passing a list visit time other than 0 | 356 // TODO(eseide): We probably should be passing a list visit time other than 0 |
| 357 RefPtr<HistoryItem> item(HistoryItem::create(GURLToKURL(url), String(), 0)); | 357 RefPtr<HistoryItem> item(HistoryItem::create(GURLToKURL(url), String(), 0)); |
| 358 std::string data; | 358 std::string data; |
| 359 HistoryItemToString(item, &data); | 359 HistoryItemToString(item, &data); |
| 360 return data; | 360 return data; |
| 361 } | 361 } |
| 362 | 362 |
| 363 } // namespace webkit_glue | 363 } // namespace webkit_glue |
| 364 | 364 |
| OLD | NEW |