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

Unified Diff: mojo/converters/input_events/input_events_type_converters.cc

Issue 1538823002: Convert Pass()→std::move() in mojo/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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: mojo/converters/input_events/input_events_type_converters.cc
diff --git a/mojo/converters/input_events/input_events_type_converters.cc b/mojo/converters/input_events/input_events_type_converters.cc
index 215c6460199aab4c0edffaeb920d0ff824362c98..91a9820c7a22a22d18c36f3f85fce6871c28a548 100644
--- a/mojo/converters/input_events/input_events_type_converters.cc
+++ b/mojo/converters/input_events/input_events_type_converters.cc
@@ -4,6 +4,8 @@
#include "mojo/converters/input_events/input_events_type_converters.h"
+#include <utility>
+
#if defined(USE_X11)
#include <X11/extensions/XInput2.h>
#include <X11/Xlib.h>
@@ -182,7 +184,7 @@ mus::mojom::EventPtr TypeConverter<mus::mojom::EventPtr, ui::Event>::Convert(
pointer_data->kind = mus::mojom::POINTER_KIND_MOUSE;
mus::mojom::LocationDataPtr location_data(mus::mojom::LocationData::New());
SetPointerDataLocationFromEvent(*located_event, location_data.get());
- pointer_data->location = location_data.Pass();
+ pointer_data->location = std::move(location_data);
if (input.IsMouseWheelEvent()) {
const ui::MouseWheelEvent* wheel_event =
@@ -206,9 +208,9 @@ mus::mojom::EventPtr TypeConverter<mus::mojom::EventPtr, ui::Event>::Convert(
wheel_data->delta_y = wheel_event->y_offset();
wheel_data->delta_z = 0;
}
- pointer_data->wheel_data = wheel_data.Pass();
+ pointer_data->wheel_data = std::move(wheel_data);
}
- event->pointer_data = pointer_data.Pass();
+ event->pointer_data = std::move(pointer_data);
} else if (input.IsTouchEvent()) {
const ui::TouchEvent* touch_event =
static_cast<const ui::TouchEvent*>(&input);
@@ -218,7 +220,7 @@ mus::mojom::EventPtr TypeConverter<mus::mojom::EventPtr, ui::Event>::Convert(
pointer_data->kind = mus::mojom::POINTER_KIND_TOUCH;
mus::mojom::LocationDataPtr location_data(mus::mojom::LocationData::New());
SetPointerDataLocationFromEvent(*touch_event, location_data.get());
- pointer_data->location = location_data.Pass();
+ pointer_data->location = std::move(location_data);
mus::mojom::BrushDataPtr brush_data(mus::mojom::BrushData::New());
@@ -229,8 +231,8 @@ mus::mojom::EventPtr TypeConverter<mus::mojom::EventPtr, ui::Event>::Convert(
brush_data->pressure = touch_event->pointer_details().force();
brush_data->tilt_y = 0;
brush_data->tilt_z = 0;
- pointer_data->brush_data = brush_data.Pass();
- event->pointer_data = pointer_data.Pass();
+ pointer_data->brush_data = std::move(brush_data);
+ event->pointer_data = std::move(pointer_data);
// TODO(rjkroege): Plumb raw pointer events on windows.
// TODO(rjkroege): Handle force-touch on MacOS
@@ -258,9 +260,9 @@ mus::mojom::EventPtr TypeConverter<mus::mojom::EventPtr, ui::Event>::Convert(
key_data->text = key_event->GetText();
key_data->unmodified_text = key_event->GetUnmodifiedText();
}
- event->key_data = key_data.Pass();
+ event->key_data = std::move(key_data);
}
- return event.Pass();
+ return event;
}
// static
@@ -306,7 +308,7 @@ TypeConverter<scoped_ptr<ui::Event>, mus::mojom::EventPtr>::Convert(
static_cast<int32_t>(input->key_data->windows_key_code),
input->key_data->text,
input->key_data->unmodified_text)));
- return key_event.Pass();
+ return std::move(key_event);
}
case mus::mojom::EVENT_TYPE_POINTER_DOWN:
case mus::mojom::EVENT_TYPE_POINTER_UP:
@@ -321,7 +323,7 @@ TypeConverter<scoped_ptr<ui::Event>, mus::mojom::EventPtr>::Convert(
ui::EventFlags(input->flags)));
event->set_location_f(location);
event->set_root_location_f(screen_location);
- return event.Pass();
+ return std::move(event);
} break;
case mus::mojom::POINTER_KIND_TOUCH: {
DCHECK(input->pointer_data->brush_data);
@@ -334,7 +336,7 @@ TypeConverter<scoped_ptr<ui::Event>, mus::mojom::EventPtr>::Convert(
input->pointer_data->brush_data->pressure));
touch_event->set_location_f(location);
touch_event->set_root_location_f(screen_location);
- return touch_event.Pass();
+ return std::move(touch_event);
} break;
case mus::mojom::POINTER_KIND_PEN:
NOTIMPLEMENTED();
@@ -353,7 +355,7 @@ TypeConverter<scoped_ptr<ui::Event>, mus::mojom::EventPtr>::Convert(
*pre_wheel_event,
static_cast<int>(input->pointer_data->wheel_data->delta_x),
static_cast<int>(input->pointer_data->wheel_data->delta_y)));
- return wheel_event.Pass();
+ return std::move(wheel_event);
} break;
default:
« no previous file with comments | « mojo/converters/geometry/geometry_type_converters.cc ('k') | mojo/converters/network/network_type_converters.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698