Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(298)

Unified Diff: android_webview/native/state_serializer.cc

Issue 1440573003: Remove ScopedVector from NavigationController. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: aw Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: android_webview/native/state_serializer.cc
diff --git a/android_webview/native/state_serializer.cc b/android_webview/native/state_serializer.cc
index e6577bd191c8879ae7d2819d05159c166325252e..dbe9b6c734ea0c5c5b208ef2408acc8bdf2d255e 100644
--- a/android_webview/native/state_serializer.cc
+++ b/android_webview/native/state_serializer.cc
@@ -6,7 +6,6 @@
#include <string>
-#include "base/memory/scoped_vector.h"
#include "base/pickle.h"
#include "base/time/time.h"
#include "content/public/browser/child_process_security_policy.h"
@@ -95,14 +94,13 @@ bool RestoreFromPickle(base::PickleIterator* iterator,
if (selected_entry >= entry_count)
return false;
- ScopedVector<content::NavigationEntry> restored_entries;
+ std::vector<scoped_ptr<content::NavigationEntry>> entries;
ncarter (slow) 2015/11/12 18:10:40 Might as well: entries.reserve(entry_count) ?
Avi (use Gerrit) 2015/11/12 19:13:04 Done.
for (int i = 0; i < entry_count; ++i) {
- restored_entries.push_back(content::NavigationEntry::Create());
- if (!internal::RestoreNavigationEntryFromPickle(iterator,
- restored_entries[i]))
+ entries.push_back(content::NavigationEntry::Create());
+ if (!internal::RestoreNavigationEntryFromPickle(iterator, entries[i].get()))
return false;
- restored_entries[i]->SetPageID(i);
+ entries[i]->SetPageID(i);
}
// |web_contents| takes ownership of these entries after this call.
@@ -110,8 +108,8 @@ bool RestoreFromPickle(base::PickleIterator* iterator,
controller.Restore(
selected_entry,
content::NavigationController::RESTORE_LAST_SESSION_EXITED_CLEANLY,
- &restored_entries);
- DCHECK_EQ(0u, restored_entries.size());
+ &entries);
+ DCHECK_EQ(0u, entries.size());
if (controller.GetLastCommittedEntry()) {
// Set up the file access rights for the selected navigation entry.

Powered by Google App Engine
This is Rietveld 408576698