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

Unified Diff: net/extras/sqlite/sqlite_channel_id_store.cc

Issue 1476263004: Remove ScopedVector from IDStores (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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: net/extras/sqlite/sqlite_channel_id_store.cc
diff --git a/net/extras/sqlite/sqlite_channel_id_store.cc b/net/extras/sqlite/sqlite_channel_id_store.cc
index c6aa09a09e987bd861cb417cb6d7e73031a96e7d..240d7d6ae28c353a8c70ead4501090ada24546bc 100644
--- a/net/extras/sqlite/sqlite_channel_id_store.cc
+++ b/net/extras/sqlite/sqlite_channel_id_store.cc
@@ -13,7 +13,6 @@
#include "base/location.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
-#include "base/memory/scoped_vector.h"
#include "base/metrics/histogram_macros.h"
#include "base/sequenced_task_runner.h"
#include "base/strings/string_util.h"
@@ -82,7 +81,7 @@ class SQLiteChannelIDStore::Backend
}
void LoadInBackground(
- ScopedVector<DefaultChannelIDStore::ChannelID>* channel_ids);
+ std::vector<scoped_ptr<DefaultChannelIDStore::ChannelID>>* channel_ids);
mmenke 2015/11/30 20:33:16 include vector
// Database upgrade statements.
bool EnsureDatabaseVersion();
@@ -148,9 +147,10 @@ void SQLiteChannelIDStore::Backend::Load(
const LoadedCallback& loaded_callback) {
// This function should be called only once per instance.
DCHECK(!db_.get());
- scoped_ptr<ScopedVector<DefaultChannelIDStore::ChannelID> > channel_ids(
- new ScopedVector<DefaultChannelIDStore::ChannelID>());
- ScopedVector<DefaultChannelIDStore::ChannelID>* channel_ids_ptr =
+ scoped_ptr<std::vector<scoped_ptr<DefaultChannelIDStore::ChannelID>>>
+ channel_ids(
+ new std::vector<scoped_ptr<DefaultChannelIDStore::ChannelID>>());
+ std::vector<scoped_ptr<DefaultChannelIDStore::ChannelID>>* channel_ids_ptr =
channel_ids.get();
background_task_runner_->PostTaskAndReply(
@@ -160,7 +160,7 @@ void SQLiteChannelIDStore::Backend::Load(
}
void SQLiteChannelIDStore::Backend::LoadInBackground(
- ScopedVector<DefaultChannelIDStore::ChannelID>* channel_ids) {
+ std::vector<scoped_ptr<DefaultChannelIDStore::ChannelID>>* channel_ids) {
DCHECK(background_task_runner_->RunsTasksOnCurrentThread());
// This method should be called only once per instance.
@@ -230,7 +230,7 @@ void SQLiteChannelIDStore::Backend::LoadInBackground(
new DefaultChannelIDStore::ChannelID(
smt.ColumnString(0), // host
base::Time::FromInternalValue(smt.ColumnInt64(3)), key.Pass()));
- channel_ids->push_back(channel_id.release());
+ channel_ids->push_back(std::move(channel_id));
}
UMA_HISTOGRAM_COUNTS_10000(

Powered by Google App Engine
This is Rietveld 408576698