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

Unified Diff: components/sync/engine_impl/cycle/data_type_tracker.cc

Issue 2656303006: Remove Scopevector in //components/sync/ (Closed)
Patch Set: Created 3 years, 11 months 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: components/sync/engine_impl/cycle/data_type_tracker.cc
diff --git a/components/sync/engine_impl/cycle/data_type_tracker.cc b/components/sync/engine_impl/cycle/data_type_tracker.cc
index 78b6e8e3541fc47622aba5b6ab463e31f852c869..247b3eb7e17cddc7d5034e647ec2dda8f4ff76ef 100644
--- a/components/sync/engine_impl/cycle/data_type_tracker.cc
+++ b/components/sync/engine_impl/cycle/data_type_tracker.cc
@@ -77,8 +77,7 @@ void DataTypeTracker::RecordRemoteInvalidation(
// Overlaps should be extremely rare for most invalidations. They can happen
// for unknown version invalidations, though.
- ScopedVector<InvalidationInterface>::iterator it =
- pending_invalidations_.begin();
+ auto it = pending_invalidations_.begin();
// Find the lower bound.
while (it != pending_invalidations_.end() &&
@@ -94,8 +93,7 @@ void DataTypeTracker::RecordRemoteInvalidation(
// Acknowledge and overwrite existing.
// Insert before the existing and get iterator to inserted.
- ScopedVector<InvalidationInterface>::iterator it2 =
- pending_invalidations_.insert(it, incoming.release());
+ auto it2 = pending_invalidations_.insert(it, std::move(incoming));
// Increment that iterator to the old one, then acknowledge and remove it.
++it2;
@@ -104,15 +102,15 @@ void DataTypeTracker::RecordRemoteInvalidation(
} else {
// The incoming has a version not in the pending_invalidations_ list.
// Add it to the list at the proper position.
- pending_invalidations_.insert(it, incoming.release());
+ pending_invalidations_.insert(it, std::move(incoming));
}
// The incoming invalidation may have caused us to exceed our buffer size.
// Trim some items from our list, if necessary.
while (pending_invalidations_.size() > payload_buffer_size_) {
- last_dropped_invalidation_.reset(pending_invalidations_.front());
+ last_dropped_invalidation_.reset(pending_invalidations_.front().release());
last_dropped_invalidation_->Drop();
- pending_invalidations_.weak_erase(pending_invalidations_.begin());
+ pending_invalidations_.erase(pending_invalidations_.begin());
}
}
@@ -141,8 +139,7 @@ void DataTypeTracker::RecordSuccessfulSyncCycle() {
// crash before writing all our state, we should wait until the results of
// this sync cycle have been written to disk before updating the invalidations
// state. See crbug.com/324996.
- for (ScopedVector<InvalidationInterface>::const_iterator it =
- pending_invalidations_.begin();
+ for (auto it = pending_invalidations_.begin();
it != pending_invalidations_.end(); ++it) {
(*it)->Acknowledge();
}
@@ -216,8 +213,7 @@ void DataTypeTracker::FillGetUpdatesTriggersMessage(
// Fill the list of payloads, if applicable. The payloads must be ordered
// oldest to newest, so we insert them in the same order as we've been storing
// them internally.
- for (ScopedVector<InvalidationInterface>::const_iterator it =
- pending_invalidations_.begin();
+ for (auto it = pending_invalidations_.begin();
it != pending_invalidations_.end(); ++it) {
if (!(*it)->IsUnknownVersion()) {
msg->add_notification_hint((*it)->GetPayload());
« no previous file with comments | « components/sync/engine_impl/cycle/data_type_tracker.h ('k') | components/sync/test/engine/mock_connection_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698