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

Unified Diff: ui/events/gestures/gesture_provider_aura.cc

Issue 2628393003: Remove ScopedVector from ui/events/. (Closed)
Patch Set: chromeos2 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: ui/events/gestures/gesture_provider_aura.cc
diff --git a/ui/events/gestures/gesture_provider_aura.cc b/ui/events/gestures/gesture_provider_aura.cc
index 1e14dcbbe6490166744a19f0d4558000b974520b..e154e4b920f3519112aa63b1324790c12348022a 100644
--- a/ui/events/gestures/gesture_provider_aura.cc
+++ b/ui/events/gestures/gesture_provider_aura.cc
@@ -61,19 +61,15 @@ void GestureProviderAura::OnGestureEvent(const GestureEventData& gesture) {
// Dispatching event caused by timer.
client_->OnGestureEvent(gesture_consumer_, event.get());
} else {
- // Memory managed by ScopedVector pending_gestures_.
pending_gestures_.push_back(std::move(event));
}
}
-ScopedVector<GestureEvent>* GestureProviderAura::GetAndResetPendingGestures() {
- if (pending_gestures_.empty())
- return NULL;
- // Caller is responsible for deleting old_pending_gestures.
- ScopedVector<GestureEvent>* old_pending_gestures =
- new ScopedVector<GestureEvent>();
- old_pending_gestures->swap(pending_gestures_);
- return old_pending_gestures;
+std::vector<std::unique_ptr<GestureEvent>>
+GestureProviderAura::GetAndResetPendingGestures() {
+ std::vector<std::unique_ptr<GestureEvent>> result;
+ result.swap(pending_gestures_);
+ return result;
}
void GestureProviderAura::OnTouchEnter(int pointer_id, float x, float y) {

Powered by Google App Engine
This is Rietveld 408576698