Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "android_webview/native/state_serializer.h" | 5 #include "android_webview/native/state_serializer.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
| 10 #include "base/pickle.h" | 10 #include "base/pickle.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 91 return false; | 91 return false; |
| 92 if (selected_entry >= entry_count) | 92 if (selected_entry >= entry_count) |
| 93 return false; | 93 return false; |
| 94 | 94 |
| 95 ScopedVector<content::NavigationEntry> restored_entries; | 95 ScopedVector<content::NavigationEntry> restored_entries; |
| 96 for (int i = 0; i < entry_count; ++i) { | 96 for (int i = 0; i < entry_count; ++i) { |
| 97 restored_entries.push_back(content::NavigationEntry::Create()); | 97 restored_entries.push_back(content::NavigationEntry::Create()); |
| 98 if (!internal::RestoreNavigationEntryFromPickle(iterator, | 98 if (!internal::RestoreNavigationEntryFromPickle(iterator, |
| 99 restored_entries[i])) | 99 restored_entries[i])) |
| 100 return false; | 100 return false; |
| 101 | |
| 102 restored_entries[i]->SetPageID(i); | |
|
joth
2012/11/29 05:56:14
should we be storing GetPageID in saveState and r
boliu
2012/11/29 06:14:03
PageID is incrementing counter in NavigationContro
| |
| 101 } | 103 } |
| 102 | 104 |
| 103 // |web_contents| takes ownership of these entries after this call. | 105 // |web_contents| takes ownership of these entries after this call. |
| 104 web_contents->GetController().Restore( | 106 web_contents->GetController().Restore( |
| 105 selected_entry, | 107 selected_entry, |
| 106 content::NavigationController::RESTORE_LAST_SESSION_EXITED_CLEANLY, | 108 content::NavigationController::RESTORE_LAST_SESSION_EXITED_CLEANLY, |
| 107 &restored_entries.get()); | 109 &restored_entries.get()); |
| 108 DCHECK_EQ(0u, restored_entries.size()); | 110 DCHECK_EQ(0u, restored_entries.size()); |
| 109 | 111 |
| 110 return true; | 112 return true; |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 246 return false; | 248 return false; |
| 247 entry->SetTimestamp(base::Time::FromInternalValue(timestamp)); | 249 entry->SetTimestamp(base::Time::FromInternalValue(timestamp)); |
| 248 } | 250 } |
| 249 | 251 |
| 250 return true; | 252 return true; |
| 251 } | 253 } |
| 252 | 254 |
| 253 } // namespace internal | 255 } // namespace internal |
| 254 | 256 |
| 255 } // namespace android_webview | 257 } // namespace android_webview |
| OLD | NEW |