| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "content/common/page_state_serialization.h" | 9 #include "content/common/page_state_serialization.h" |
| 10 #include "content/public/common/page_state.h" | 10 #include "content/public/common/page_state.h" |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 &state.referenced_files); | 191 &state.referenced_files); |
| 192 GenerateFrameStateFromItem(item, &state.top); | 192 GenerateFrameStateFromItem(item, &state.top); |
| 193 | 193 |
| 194 std::string encoded_data; | 194 std::string encoded_data; |
| 195 if (!EncodePageState(state, &encoded_data)) | 195 if (!EncodePageState(state, &encoded_data)) |
| 196 return PageState(); | 196 return PageState(); |
| 197 | 197 |
| 198 return PageState::CreateFromEncodedData(encoded_data); | 198 return PageState::CreateFromEncodedData(encoded_data); |
| 199 } | 199 } |
| 200 | 200 |
| 201 scoped_ptr<HistoryEntry> PageStateToHistoryEntry(const PageState& page_state) { | 201 std::unique_ptr<HistoryEntry> PageStateToHistoryEntry( |
| 202 const PageState& page_state) { |
| 202 ExplodedPageState state; | 203 ExplodedPageState state; |
| 203 if (!DecodePageState(page_state.ToEncodedData(), &state)) | 204 if (!DecodePageState(page_state.ToEncodedData(), &state)) |
| 204 return scoped_ptr<HistoryEntry>(); | 205 return std::unique_ptr<HistoryEntry>(); |
| 205 | 206 |
| 206 scoped_ptr<HistoryEntry> entry(new HistoryEntry()); | 207 std::unique_ptr<HistoryEntry> entry(new HistoryEntry()); |
| 207 RecursivelyGenerateHistoryItem(state.top, entry->root_history_node()); | 208 RecursivelyGenerateHistoryItem(state.top, entry->root_history_node()); |
| 208 | 209 |
| 209 return entry; | 210 return entry; |
| 210 } | 211 } |
| 211 | 212 |
| 212 } // namespace content | 213 } // namespace content |
| OLD | NEW |