summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sessions
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-27 07:05:20 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-27 07:05:20 +0000
commit742af6728743eb38a32e76a75944b493c925d370 (patch)
tree0aeb16f7bba2253233b69ab58765c798f61de146 /chrome/browser/sessions
parent1c2f1007002184c0ea9668352d4ac4748dde4586 (diff)
downloadchromium_src-742af6728743eb38a32e76a75944b493c925d370.zip
chromium_src-742af6728743eb38a32e76a75944b493c925d370.tar.gz
chromium_src-742af6728743eb38a32e76a75944b493c925d370.tar.bz2
Convert some STLDeleteContainerPointers usages to ScopedVector
BUG=none Review URL: https://chromiumcodereview.appspot.com/12843048 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@190843 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sessions')
-rw-r--r--chrome/browser/sessions/persistent_tab_restore_service.cc13
1 files changed, 4 insertions, 9 deletions
diff --git a/chrome/browser/sessions/persistent_tab_restore_service.cc b/chrome/browser/sessions/persistent_tab_restore_service.cc
index b8f704b..9e7e801 100644
--- a/chrome/browser/sessions/persistent_tab_restore_service.cc
+++ b/chrome/browser/sessions/persistent_tab_restore_service.cc
@@ -228,7 +228,7 @@ class PersistentTabRestoreService::Delegate
// Results from previously closed tabs/sessions is first added here. When the
// results from both us and the session restore service have finished loading
// LoadStateChanged is invoked, which adds these entries to entries_.
- std::vector<Entry*> staging_entries_;
+ ScopedVector<Entry> staging_entries_;
// Used when loading previous tabs/session and open tabs/session.
CancelableTaskTracker cancelable_task_tracker_;
@@ -245,9 +245,7 @@ PersistentTabRestoreService::Delegate::Delegate(Profile* profile)
load_state_(NOT_LOADED) {
}
-PersistentTabRestoreService::Delegate::~Delegate() {
- STLDeleteElements(&staging_entries_);
-}
+PersistentTabRestoreService::Delegate::~Delegate() {}
void PersistentTabRestoreService::Delegate::Save() {
const Entries& entries = tab_restore_service_helper_->entries();
@@ -817,7 +815,7 @@ void PersistentTabRestoreService::Delegate::LoadStateChanged() {
const Entries& entries = tab_restore_service_helper_->entries();
if (staging_entries_.empty() || entries.size() >= kMaxEntries) {
- STLDeleteElements(&staging_entries_);
+ staging_entries_.clear();
return;
}
@@ -828,9 +826,6 @@ void PersistentTabRestoreService::Delegate::LoadStateChanged() {
int surplus = kMaxEntries - entries.size();
CHECK_LE(0, surplus);
CHECK_GE(static_cast<int>(staging_entries_.size()), surplus);
- STLDeleteContainerPointers(
- staging_entries_.begin() + (kMaxEntries - entries.size()),
- staging_entries_.end());
staging_entries_.erase(
staging_entries_.begin() + (kMaxEntries - entries.size()),
staging_entries_.end());
@@ -844,7 +839,7 @@ void PersistentTabRestoreService::Delegate::LoadStateChanged() {
// AddEntry takes ownership of the entry, need to clear out entries so that
// it doesn't delete them.
- staging_entries_.clear();
+ staging_entries_.weak_clear();
// Make it so we rewrite all the tabs. We need to do this otherwise we won't
// correctly write out the entries when Save is invoked (Save starts from