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

Unified Diff: content/browser/renderer_host/ui_events_helper.cc

Issue 2742333002: Remove ScopedVector from content/browser/ [1]. (Closed)
Patch Set: Created 3 years, 9 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: content/browser/renderer_host/ui_events_helper.cc
diff --git a/content/browser/renderer_host/ui_events_helper.cc b/content/browser/renderer_host/ui_events_helper.cc
index 5e1a05831d65c1c2d97173790acac23e209c849a..e641862164c5ebbcdc59a0d402b9769167a1a350 100644
--- a/content/browser/renderer_host/ui_events_helper.cc
+++ b/content/browser/renderer_host/ui_events_helper.cc
@@ -6,6 +6,7 @@
#include <stdint.h>
+#include "base/memory/ptr_util.h"
#include "content/common/input/web_touch_event_traits.h"
#include "third_party/WebKit/public/platform/WebInputEvent.h"
#include "ui/events/base_event_utils.h"
@@ -41,7 +42,7 @@ namespace content {
bool MakeUITouchEventsFromWebTouchEvents(
const TouchEventWithLatencyInfo& touch_with_latency,
- ScopedVector<ui::TouchEvent>* list,
+ std::vector<std::unique_ptr<ui::TouchEvent>>* list,
TouchEventCoordinateSystem coordinate_system) {
const blink::WebTouchEvent& touch = touch_with_latency.event;
ui::EventType type = ui::ET_UNKNOWN;
@@ -76,13 +77,13 @@ bool MakeUITouchEventsFromWebTouchEvents(
location = point.position;
else
location = point.screenPosition;
- ui::TouchEvent* uievent = new ui::TouchEvent(
+ auto uievent = base::MakeUnique<ui::TouchEvent>(
type, gfx::Point(), flags, point.id, timestamp, point.radiusX,
point.radiusY, point.rotationAngle, point.force);
uievent->set_location_f(location);
uievent->set_root_location_f(location);
uievent->set_latency(touch_with_latency.latency);
- list->push_back(uievent);
+ list->push_back(std::move(uievent));
}
return true;
}

Powered by Google App Engine
This is Rietveld 408576698