| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/renderer/history_serialization.h" | 5 #include "content/renderer/history_serialization.h" |
| 6 | 6 |
| 7 #include "content/common/page_state_serialization.h" | 7 #include "content/common/page_state_serialization.h" |
| 8 #include "content/public/common/page_state.h" | 8 #include "content/public/common/page_state.h" |
| 9 #include "content/renderer/history_entry.h" | 9 #include "content/renderer/history_entry.h" |
| 10 #include "third_party/WebKit/public/platform/WebFloatPoint.h" | 10 #include "third_party/WebKit/public/platform/WebFloatPoint.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 state->pinch_viewport_scroll_offset = item.pinchViewportScrollOffset(); | 92 state->pinch_viewport_scroll_offset = item.pinchViewportScrollOffset(); |
| 93 state->scroll_offset = item.scrollOffset(); | 93 state->scroll_offset = item.scrollOffset(); |
| 94 state->item_sequence_number = item.itemSequenceNumber(); | 94 state->item_sequence_number = item.itemSequenceNumber(); |
| 95 state->document_sequence_number = | 95 state->document_sequence_number = |
| 96 item.documentSequenceNumber(); | 96 item.documentSequenceNumber(); |
| 97 state->page_scale_factor = item.pageScaleFactor(); | 97 state->page_scale_factor = item.pageScaleFactor(); |
| 98 ToNullableString16Vector(item.documentState(), &state->document_state); | 98 ToNullableString16Vector(item.documentState(), &state->document_state); |
| 99 | 99 |
| 100 state->http_body.http_content_type = item.httpContentType(); | 100 state->http_body.http_content_type = item.httpContentType(); |
| 101 const WebHTTPBody& http_body = item.httpBody(); | 101 const WebHTTPBody& http_body = item.httpBody(); |
| 102 if (!(state->http_body.is_null = http_body.isNull())) { | 102 state->http_body.is_null = http_body.isNull(); |
| 103 if (!state->http_body.is_null) { |
| 103 state->http_body.identifier = http_body.identifier(); | 104 state->http_body.identifier = http_body.identifier(); |
| 104 state->http_body.elements.resize(http_body.elementCount()); | 105 state->http_body.elements.resize(http_body.elementCount()); |
| 105 for (size_t i = 0; i < http_body.elementCount(); ++i) { | 106 for (size_t i = 0; i < http_body.elementCount(); ++i) { |
| 106 WebHTTPBody::Element element; | 107 WebHTTPBody::Element element; |
| 107 http_body.elementAt(i, element); | 108 http_body.elementAt(i, element); |
| 108 ToExplodedHttpBodyElement(element, &state->http_body.elements[i]); | 109 ToExplodedHttpBodyElement(element, &state->http_body.elements[i]); |
| 109 } | 110 } |
| 110 state->http_body.contains_passwords = http_body.containsPasswordData(); | 111 state->http_body.contains_passwords = http_body.containsPasswordData(); |
| 111 } | 112 } |
| 112 } | 113 } |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 if (!DecodePageState(page_state.ToEncodedData(), &state)) | 195 if (!DecodePageState(page_state.ToEncodedData(), &state)) |
| 195 return scoped_ptr<HistoryEntry>(); | 196 return scoped_ptr<HistoryEntry>(); |
| 196 | 197 |
| 197 scoped_ptr<HistoryEntry> entry(new HistoryEntry()); | 198 scoped_ptr<HistoryEntry> entry(new HistoryEntry()); |
| 198 RecursivelyGenerateHistoryItem(state.top, entry->root_history_node()); | 199 RecursivelyGenerateHistoryItem(state.top, entry->root_history_node()); |
| 199 | 200 |
| 200 return entry.Pass(); | 201 return entry.Pass(); |
| 201 } | 202 } |
| 202 | 203 |
| 203 } // namespace content | 204 } // namespace content |
| OLD | NEW |