diff options
Diffstat (limited to 'content/browser/renderer_host/input')
11 files changed, 88 insertions, 69 deletions
diff --git a/content/browser/renderer_host/input/composited_scrolling_browsertest.cc b/content/browser/renderer_host/input/composited_scrolling_browsertest.cc index a23e509..cbf48e8 100644 --- a/content/browser/renderer_host/input/composited_scrolling_browsertest.cc +++ b/content/browser/renderer_host/input/composited_scrolling_browsertest.cc @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <utility> + #include "base/bind.h" #include "base/command_line.h" #include "base/macros.h" @@ -130,7 +132,7 @@ class CompositedScrollingBrowserTest : public ContentBrowserTest { scoped_ptr<SyntheticSmoothScrollGesture> gesture( new SyntheticSmoothScrollGesture(params)); GetWidgetHost()->QueueSyntheticGesture( - gesture.Pass(), + std::move(gesture), base::Bind(&CompositedScrollingBrowserTest::OnSyntheticGestureCompleted, base::Unretained(this))); diff --git a/content/browser/renderer_host/input/gesture_event_queue_unittest.cc b/content/browser/renderer_host/input/gesture_event_queue_unittest.cc index 7e7c6e7..4408727 100644 --- a/content/browser/renderer_host/input/gesture_event_queue_unittest.cc +++ b/content/browser/renderer_host/input/gesture_event_queue_unittest.cc @@ -2,8 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include <stddef.h> +#include "content/browser/renderer_host/input/gesture_event_queue.h" +#include <stddef.h> +#include <utility> #include <vector> #include "base/location.h" @@ -13,7 +15,6 @@ #include "base/single_thread_task_runner.h" #include "base/thread_task_runner_handle.h" #include "base/time/time.h" -#include "content/browser/renderer_host/input/gesture_event_queue.h" #include "content/browser/renderer_host/input/touchpad_tap_suppression_controller.h" #include "content/common/input/input_event_ack_state.h" #include "content/common/input/synthetic_web_input_event_builders.h" @@ -53,7 +54,7 @@ class GestureEventQueueTest : public testing::Test, const GestureEventWithLatencyInfo& event) override { ++sent_gesture_event_count_; if (sync_ack_result_) { - scoped_ptr<InputEventAckState> ack_result = sync_ack_result_.Pass(); + scoped_ptr<InputEventAckState> ack_result = std::move(sync_ack_result_); SendInputEventACK(event.event.type, *ack_result); } } @@ -63,7 +64,7 @@ class GestureEventQueueTest : public testing::Test, ++acked_gesture_event_count_; last_acked_event_ = event.event; if (sync_followup_event_) { - auto sync_followup_event = sync_followup_event_.Pass(); + auto sync_followup_event = std::move(sync_followup_event_); SimulateGestureEvent(*sync_followup_event); } } diff --git a/content/browser/renderer_host/input/input_router_impl.cc b/content/browser/renderer_host/input/input_router_impl.cc index d88634d..dcae714 100644 --- a/content/browser/renderer_host/input/input_router_impl.cc +++ b/content/browser/renderer_host/input/input_router_impl.cc @@ -5,6 +5,7 @@ #include "content/browser/renderer_host/input/input_router_impl.h" #include <math.h> +#include <utility> #include "base/auto_reset.h" #include "base/command_line.h" @@ -96,9 +97,9 @@ bool InputRouterImpl::SendInput(scoped_ptr<IPC::Message> message) { // Check for types that require an ACK. case InputMsg_SelectRange::ID: case InputMsg_MoveRangeSelectionExtent::ID: - return SendSelectMessage(message.Pass()); + return SendSelectMessage(std::move(message)); case InputMsg_MoveCaret::ID: - return SendMoveCaret(message.Pass()); + return SendMoveCaret(std::move(message)); case InputMsg_HandleInputEvent::ID: NOTREACHED() << "WebInputEvents should never be sent via SendInput."; return false; @@ -328,7 +329,7 @@ bool InputRouterImpl::SendSelectMessage( bool InputRouterImpl::SendMoveCaret(scoped_ptr<IPC::Message> message) { DCHECK(message->type() == InputMsg_MoveCaret::ID); if (move_caret_pending_) { - next_move_caret_ = message.Pass(); + next_move_caret_ = std::move(message); return true; } @@ -460,7 +461,7 @@ void InputRouterImpl::OnDidOverscroll(const DidOverscrollParams& params) { void InputRouterImpl::OnMsgMoveCaretAck() { move_caret_pending_ = false; if (next_move_caret_) - SendMoveCaret(next_move_caret_.Pass()); + SendMoveCaret(std::move(next_move_caret_)); } void InputRouterImpl::OnSelectMessageAck() { @@ -470,7 +471,7 @@ void InputRouterImpl::OnSelectMessageAck() { make_scoped_ptr(pending_select_messages_.front()); pending_select_messages_.pop_front(); - SendSelectMessage(next_message.Pass()); + SendSelectMessage(std::move(next_message)); } } @@ -585,8 +586,8 @@ void InputRouterImpl::ProcessMouseAck(blink::WebInputEvent::Type type, if (next_mouse_move_) { DCHECK(next_mouse_move_->event.type == WebInputEvent::MouseMove); - scoped_ptr<MouseEventWithLatencyInfo> next_mouse_move - = next_mouse_move_.Pass(); + scoped_ptr<MouseEventWithLatencyInfo> next_mouse_move = + std::move(next_mouse_move_); SendMouseEvent(*next_mouse_move); } } diff --git a/content/browser/renderer_host/input/mock_input_ack_handler.h b/content/browser/renderer_host/input/mock_input_ack_handler.h index a0e1aa9..4753a15 100644 --- a/content/browser/renderer_host/input/mock_input_ack_handler.h +++ b/content/browser/renderer_host/input/mock_input_ack_handler.h @@ -6,6 +6,7 @@ #define CONTENT_BROWSER_RENDERER_HOST_INPUT_MOCK_INPUT_ACK_HANDLER_H_ #include <stddef.h> +#include <utility> #include "base/memory/scoped_ptr.h" #include "content/browser/renderer_host/input/input_ack_handler.h" @@ -39,11 +40,11 @@ class MockInputAckHandler : public InputAckHandler { } void set_followup_touch_event(scoped_ptr<GestureEventWithLatencyInfo> event) { - gesture_followup_event_ = event.Pass(); + gesture_followup_event_ = std::move(event); } void set_followup_touch_event(scoped_ptr<TouchEventWithLatencyInfo> event) { - touch_followup_event_ = event.Pass(); + touch_followup_event_ = std::move(event); } bool unexpected_event_ack_called() const { diff --git a/content/browser/renderer_host/input/stylus_text_selector.cc b/content/browser/renderer_host/input/stylus_text_selector.cc index 11cace7..20eee82 100644 --- a/content/browser/renderer_host/input/stylus_text_selector.cc +++ b/content/browser/renderer_host/input/stylus_text_selector.cc @@ -30,7 +30,7 @@ scoped_ptr<GestureDetector> CreateGestureDetector( detector->set_longpress_enabled(false); detector->set_showpress_enabled(false); - return detector.Pass(); + return detector; } } // namespace diff --git a/content/browser/renderer_host/input/synthetic_gesture_controller.cc b/content/browser/renderer_host/input/synthetic_gesture_controller.cc index 536426b..109ce34 100644 --- a/content/browser/renderer_host/input/synthetic_gesture_controller.cc +++ b/content/browser/renderer_host/input/synthetic_gesture_controller.cc @@ -4,6 +4,8 @@ #include "content/browser/renderer_host/input/synthetic_gesture_controller.h" +#include <utility> + #include "base/trace_event/trace_event.h" #include "content/browser/renderer_host/input/synthetic_gesture_target.h" #include "content/common/input/synthetic_smooth_scroll_gesture_params.h" @@ -14,7 +16,7 @@ namespace content { SyntheticGestureController::SyntheticGestureController( scoped_ptr<SyntheticGestureTarget> gesture_target) - : gesture_target_(gesture_target.Pass()) {} + : gesture_target_(std::move(gesture_target)) {} SyntheticGestureController::~SyntheticGestureController() {} @@ -25,7 +27,8 @@ void SyntheticGestureController::QueueSyntheticGesture( bool was_empty = pending_gesture_queue_.IsEmpty(); - pending_gesture_queue_.Push(synthetic_gesture.Pass(), completion_callback); + pending_gesture_queue_.Push(std::move(synthetic_gesture), + completion_callback); if (was_empty) StartGesture(*pending_gesture_queue_.FrontGesture()); @@ -61,7 +64,7 @@ void SyntheticGestureController::OnDidFlushInput() { return; DCHECK(!pending_gesture_queue_.IsEmpty()); - auto pending_gesture_result = pending_gesture_result_.Pass(); + auto pending_gesture_result = std::move(pending_gesture_result_); StopGesture(*pending_gesture_queue_.FrontGesture(), pending_gesture_queue_.FrontCallback(), *pending_gesture_result); diff --git a/content/browser/renderer_host/input/synthetic_gesture_controller_unittest.cc b/content/browser/renderer_host/input/synthetic_gesture_controller_unittest.cc index dccbbc3..9369bfd 100644 --- a/content/browser/renderer_host/input/synthetic_gesture_controller_unittest.cc +++ b/content/browser/renderer_host/input/synthetic_gesture_controller_unittest.cc @@ -2,14 +2,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "content/browser/renderer_host/input/synthetic_gesture_controller.h" + #include <stddef.h> #include <stdint.h> +#include <utility> #include "base/bind.h" #include "base/memory/scoped_ptr.h" #include "base/time/time.h" #include "content/browser/renderer_host/input/synthetic_gesture.h" -#include "content/browser/renderer_host/input/synthetic_gesture_controller.h" #include "content/browser/renderer_host/input/synthetic_gesture_target.h" #include "content/browser/renderer_host/input/synthetic_pinch_gesture.h" #include "content/browser/renderer_host/input/synthetic_pointer_action.h" @@ -523,7 +525,7 @@ class SyntheticGestureControllerTestBase { void QueueSyntheticGesture(scoped_ptr<SyntheticGesture> gesture) { controller_->QueueSyntheticGesture( - gesture.Pass(), + std::move(gesture), base::Bind( &SyntheticGestureControllerTestBase::OnSyntheticGestureCompleted, base::Unretained(this))); @@ -600,7 +602,7 @@ TEST_F(SyntheticGestureControllerTest, SingleGesture) { bool finished = false; scoped_ptr<MockSyntheticGesture> gesture( new MockSyntheticGesture(&finished, 3)); - QueueSyntheticGesture(gesture.Pass()); + QueueSyntheticGesture(std::move(gesture)); FlushInputUntilComplete(); EXPECT_TRUE(finished); @@ -614,7 +616,7 @@ TEST_F(SyntheticGestureControllerTest, GestureFailed) { bool finished = false; scoped_ptr<MockSyntheticGesture> gesture( new MockSyntheticGesture(&finished, 0)); - QueueSyntheticGesture(gesture.Pass()); + QueueSyntheticGesture(std::move(gesture)); FlushInputUntilComplete(); EXPECT_TRUE(finished); @@ -633,7 +635,7 @@ TEST_F(SyntheticGestureControllerTest, SuccessiveGestures) { new MockSyntheticGesture(&finished_2, 4)); // Queue first gesture and wait for it to finish - QueueSyntheticGesture(gesture_1.Pass()); + QueueSyntheticGesture(std::move(gesture_1)); FlushInputUntilComplete(); EXPECT_TRUE(finished_1); @@ -641,7 +643,7 @@ TEST_F(SyntheticGestureControllerTest, SuccessiveGestures) { EXPECT_EQ(0, num_failure_); // Queue second gesture. - QueueSyntheticGesture(gesture_2.Pass()); + QueueSyntheticGesture(std::move(gesture_2)); FlushInputUntilComplete(); EXPECT_TRUE(finished_2); @@ -659,8 +661,8 @@ TEST_F(SyntheticGestureControllerTest, TwoGesturesInFlight) { scoped_ptr<MockSyntheticGesture> gesture_2( new MockSyntheticGesture(&finished_2, 4)); - QueueSyntheticGesture(gesture_1.Pass()); - QueueSyntheticGesture(gesture_2.Pass()); + QueueSyntheticGesture(std::move(gesture_1)); + QueueSyntheticGesture(std::move(gesture_2)); FlushInputUntilComplete(); EXPECT_TRUE(finished_1); @@ -679,8 +681,8 @@ TEST_F(SyntheticGestureControllerTest, GestureCompletedOnDidFlushInput) { scoped_ptr<MockSyntheticGesture> gesture_2( new MockSyntheticGesture(&finished_2, 4)); - QueueSyntheticGesture(gesture_1.Pass()); - QueueSyntheticGesture(gesture_2.Pass()); + QueueSyntheticGesture(std::move(gesture_1)); + QueueSyntheticGesture(std::move(gesture_2)); while (target_->flush_requested()) { target_->ClearFlushRequest(); @@ -734,7 +736,7 @@ TEST_P(SyntheticGestureControllerTestWithParam, scoped_ptr<SyntheticSmoothMoveGesture> gesture( new SyntheticSmoothMoveGesture(params)); - QueueSyntheticGesture(gesture.Pass()); + QueueSyntheticGesture(std::move(gesture)); FlushInputUntilComplete(); MockMoveGestureTarget* scroll_target = @@ -763,7 +765,7 @@ TEST_P(SyntheticGestureControllerTestWithParam, scoped_ptr<SyntheticSmoothMoveGesture> gesture( new SyntheticSmoothMoveGesture(params)); - QueueSyntheticGesture(gesture.Pass()); + QueueSyntheticGesture(std::move(gesture)); FlushInputUntilComplete(); MockMoveGestureTarget* scroll_target = @@ -808,7 +810,7 @@ TEST_F(SyntheticGestureControllerTest, SingleScrollGestureTouchDiagonal) { scoped_ptr<SyntheticSmoothMoveGesture> gesture( new SyntheticSmoothMoveGesture(params)); - QueueSyntheticGesture(gesture.Pass()); + QueueSyntheticGesture(std::move(gesture)); FlushInputUntilComplete(); MockMoveGestureTarget* scroll_target = @@ -834,7 +836,7 @@ TEST_F(SyntheticGestureControllerTest, SingleScrollGestureTouchLongStop) { scoped_ptr<SyntheticSmoothMoveGesture> gesture( new SyntheticSmoothMoveGesture(params)); - QueueSyntheticGesture(gesture.Pass()); + QueueSyntheticGesture(std::move(gesture)); FlushInputUntilComplete(); MockMoveGestureTarget* scroll_target = @@ -862,7 +864,7 @@ TEST_F(SyntheticGestureControllerTest, SingleScrollGestureTouchFling) { scoped_ptr<SyntheticSmoothMoveGesture> gesture( new SyntheticSmoothMoveGesture(params)); - QueueSyntheticGesture(gesture.Pass()); + QueueSyntheticGesture(std::move(gesture)); FlushInputUntilComplete(); MockMoveGestureTarget* scroll_target = @@ -888,7 +890,7 @@ TEST_P(SyntheticGestureControllerTestWithParam, scoped_ptr<SyntheticSmoothMoveGesture> gesture( new SyntheticSmoothMoveGesture(params)); - QueueSyntheticGesture(gesture.Pass()); + QueueSyntheticGesture(std::move(gesture)); FlushInputUntilComplete(); MockMoveGestureTarget* scroll_target = @@ -908,7 +910,7 @@ TEST_F(SyntheticGestureControllerTest, SingleScrollGestureMouseVertical) { scoped_ptr<SyntheticSmoothMoveGesture> gesture( new SyntheticSmoothMoveGesture(params)); - QueueSyntheticGesture(gesture.Pass()); + QueueSyntheticGesture(std::move(gesture)); FlushInputUntilComplete(); MockMoveGestureTarget* scroll_target = @@ -928,7 +930,7 @@ TEST_F(SyntheticGestureControllerTest, SingleScrollGestureMouseHorizontal) { scoped_ptr<SyntheticSmoothMoveGesture> gesture( new SyntheticSmoothMoveGesture(params)); - QueueSyntheticGesture(gesture.Pass()); + QueueSyntheticGesture(std::move(gesture)); FlushInputUntilComplete(); MockMoveGestureTarget* scroll_target = @@ -948,7 +950,7 @@ TEST_F(SyntheticGestureControllerTest, SingleScrollGestureMouseDiagonal) { scoped_ptr<SyntheticSmoothMoveGesture> gesture( new SyntheticSmoothMoveGesture(params)); - QueueSyntheticGesture(gesture.Pass()); + QueueSyntheticGesture(std::move(gesture)); FlushInputUntilComplete(); MockMoveGestureTarget* scroll_target = @@ -969,7 +971,7 @@ TEST_F(SyntheticGestureControllerTest, MultiScrollGestureMouse) { scoped_ptr<SyntheticSmoothMoveGesture> gesture( new SyntheticSmoothMoveGesture(params)); - QueueSyntheticGesture(gesture.Pass()); + QueueSyntheticGesture(std::move(gesture)); FlushInputUntilComplete(); MockMoveGestureTarget* scroll_target = @@ -991,7 +993,7 @@ TEST_F(SyntheticGestureControllerTest, MultiScrollGestureMouseHorizontal) { scoped_ptr<SyntheticSmoothMoveGesture> gesture( new SyntheticSmoothMoveGesture(params)); - QueueSyntheticGesture(gesture.Pass()); + QueueSyntheticGesture(std::move(gesture)); FlushInputUntilComplete(); MockMoveGestureTarget* scroll_target = @@ -1037,7 +1039,7 @@ TEST_F(SyntheticGestureControllerTest, MultiScrollGestureTouch) { scoped_ptr<SyntheticSmoothMoveGesture> gesture( new SyntheticSmoothMoveGesture(params)); - QueueSyntheticGesture(gesture.Pass()); + QueueSyntheticGesture(std::move(gesture)); FlushInputUntilComplete(); MockMoveGestureTarget* scroll_target = @@ -1065,7 +1067,7 @@ TEST_P(SyntheticGestureControllerTestWithParam, scoped_ptr<SyntheticSmoothMoveGesture> gesture( new SyntheticSmoothMoveGesture(params)); - QueueSyntheticGesture(gesture.Pass()); + QueueSyntheticGesture(std::move(gesture)); FlushInputUntilComplete(); MockMoveGestureTarget* scroll_target = @@ -1102,7 +1104,7 @@ TEST_F(SyntheticGestureControllerTest, SingleDragGestureMouseDiagonal) { scoped_ptr<SyntheticSmoothMoveGesture> gesture( new SyntheticSmoothMoveGesture(params)); - QueueSyntheticGesture(gesture.Pass()); + QueueSyntheticGesture(std::move(gesture)); FlushInputUntilComplete(); MockMoveGestureTarget* drag_target = @@ -1122,7 +1124,7 @@ TEST_F(SyntheticGestureControllerTest, SingleDragGestureMouseZeroDistance) { scoped_ptr<SyntheticSmoothMoveGesture> gesture( new SyntheticSmoothMoveGesture(params)); - QueueSyntheticGesture(gesture.Pass()); + QueueSyntheticGesture(std::move(gesture)); FlushInputUntilComplete(); MockMoveGestureTarget* drag_target = @@ -1143,7 +1145,7 @@ TEST_F(SyntheticGestureControllerTest, MultiDragGestureMouse) { scoped_ptr<SyntheticSmoothMoveGesture> gesture( new SyntheticSmoothMoveGesture(params)); - QueueSyntheticGesture(gesture.Pass()); + QueueSyntheticGesture(std::move(gesture)); FlushInputUntilComplete(); MockMoveGestureTarget* drag_target = @@ -1225,7 +1227,7 @@ TEST_F(SyntheticGestureControllerTest, scoped_ptr<SyntheticTouchscreenPinchGesture> gesture( new SyntheticTouchscreenPinchGesture(params)); - QueueSyntheticGesture(gesture.Pass()); + QueueSyntheticGesture(std::move(gesture)); FlushInputUntilComplete(); MockSyntheticTouchscreenPinchTouchTarget* pinch_target = @@ -1248,7 +1250,7 @@ TEST_F(SyntheticGestureControllerTest, scoped_ptr<SyntheticTouchscreenPinchGesture> gesture( new SyntheticTouchscreenPinchGesture(params)); - QueueSyntheticGesture(gesture.Pass()); + QueueSyntheticGesture(std::move(gesture)); FlushInputUntilComplete(); MockSyntheticTouchscreenPinchTouchTarget* pinch_target = @@ -1270,7 +1272,7 @@ TEST_F(SyntheticGestureControllerTest, scoped_ptr<SyntheticTouchscreenPinchGesture> gesture( new SyntheticTouchscreenPinchGesture(params)); - QueueSyntheticGesture(gesture.Pass()); + QueueSyntheticGesture(std::move(gesture)); FlushInputUntilComplete(); MockSyntheticTouchscreenPinchTouchTarget* pinch_target = @@ -1292,7 +1294,7 @@ TEST_F(SyntheticGestureControllerTest, TouchpadPinchGestureTouchZoomIn) { scoped_ptr<SyntheticTouchpadPinchGesture> gesture( new SyntheticTouchpadPinchGesture(params)); - QueueSyntheticGesture(gesture.Pass()); + QueueSyntheticGesture(std::move(gesture)); FlushInputUntilComplete(); MockSyntheticTouchpadPinchTouchTarget* pinch_target = @@ -1314,7 +1316,7 @@ TEST_F(SyntheticGestureControllerTest, TouchpadPinchGestureTouchZoomOut) { scoped_ptr<SyntheticTouchpadPinchGesture> gesture( new SyntheticTouchpadPinchGesture(params)); - QueueSyntheticGesture(gesture.Pass()); + QueueSyntheticGesture(std::move(gesture)); FlushInputUntilComplete(); MockSyntheticTouchpadPinchTouchTarget* pinch_target = @@ -1335,7 +1337,7 @@ TEST_F(SyntheticGestureControllerTest, TouchpadPinchGestureTouchNoScaling) { scoped_ptr<SyntheticTouchpadPinchGesture> gesture( new SyntheticTouchpadPinchGesture(params)); - QueueSyntheticGesture(gesture.Pass()); + QueueSyntheticGesture(std::move(gesture)); FlushInputUntilComplete(); MockSyntheticTouchpadPinchTouchTarget* pinch_target = @@ -1358,7 +1360,7 @@ TEST_F(SyntheticGestureControllerTest, PinchGestureExplicitTouch) { params.anchor.SetPoint(54, 89); scoped_ptr<SyntheticPinchGesture> gesture(new SyntheticPinchGesture(params)); - QueueSyntheticGesture(gesture.Pass()); + QueueSyntheticGesture(std::move(gesture)); FlushInputUntilComplete(); // Gesture target will fail expectations if the wrong underlying @@ -1376,7 +1378,7 @@ TEST_F(SyntheticGestureControllerTest, PinchGestureExplicitMouse) { params.anchor.SetPoint(54, 89); scoped_ptr<SyntheticPinchGesture> gesture(new SyntheticPinchGesture(params)); - QueueSyntheticGesture(gesture.Pass()); + QueueSyntheticGesture(std::move(gesture)); FlushInputUntilComplete(); // Gesture target will fail expectations if the wrong underlying @@ -1394,7 +1396,7 @@ TEST_F(SyntheticGestureControllerTest, PinchGestureDefaultTouch) { params.anchor.SetPoint(54, 89); scoped_ptr<SyntheticPinchGesture> gesture(new SyntheticPinchGesture(params)); - QueueSyntheticGesture(gesture.Pass()); + QueueSyntheticGesture(std::move(gesture)); FlushInputUntilComplete(); // Gesture target will fail expectations if the wrong underlying @@ -1412,7 +1414,7 @@ TEST_F(SyntheticGestureControllerTest, PinchGestureDefaultMouse) { params.anchor.SetPoint(54, 89); scoped_ptr<SyntheticPinchGesture> gesture(new SyntheticPinchGesture(params)); - QueueSyntheticGesture(gesture.Pass()); + QueueSyntheticGesture(std::move(gesture)); FlushInputUntilComplete(); // Gesture target will fail expectations if the wrong underlying @@ -1428,7 +1430,7 @@ TEST_F(SyntheticGestureControllerTest, TapGestureTouch) { params.position.SetPoint(87, -124); scoped_ptr<SyntheticTapGesture> gesture(new SyntheticTapGesture(params)); - QueueSyntheticGesture(gesture.Pass()); + QueueSyntheticGesture(std::move(gesture)); FlushInputUntilComplete(); MockSyntheticTapTouchTarget* tap_target = @@ -1451,7 +1453,7 @@ TEST_F(SyntheticGestureControllerTest, TapGestureMouse) { params.position.SetPoint(98, 123); scoped_ptr<SyntheticTapGesture> gesture(new SyntheticTapGesture(params)); - QueueSyntheticGesture(gesture.Pass()); + QueueSyntheticGesture(std::move(gesture)); FlushInputUntilComplete(); MockSyntheticTapMouseTarget* tap_target = @@ -1474,7 +1476,7 @@ TEST_F(SyntheticGestureControllerTest, PointerTouchAction) { scoped_ptr<SyntheticPointerAction> gesture(new SyntheticPointerAction( SyntheticGestureParams::TOUCH_INPUT, SyntheticGesture::PRESS, &synthetic_pointer, position)); - QueueSyntheticGesture(gesture.Pass()); + QueueSyntheticGesture(std::move(gesture)); FlushInputUntilComplete(); MockSyntheticPointerTouchActionTarget* pointer_touch_target = @@ -1488,7 +1490,7 @@ TEST_F(SyntheticGestureControllerTest, PointerTouchAction) { gesture.reset(new SyntheticPointerAction(SyntheticGestureParams::TOUCH_INPUT, SyntheticGesture::PRESS, &synthetic_pointer, position)); - QueueSyntheticGesture(gesture.Pass()); + QueueSyntheticGesture(std::move(gesture)); FlushInputUntilComplete(); pointer_touch_target = @@ -1504,7 +1506,7 @@ TEST_F(SyntheticGestureControllerTest, PointerTouchAction) { gesture.reset(new SyntheticPointerAction( SyntheticGestureParams::TOUCH_INPUT, SyntheticGesture::MOVE, &synthetic_pointer, position, index)); - QueueSyntheticGesture(gesture.Pass()); + QueueSyntheticGesture(std::move(gesture)); FlushInputUntilComplete(); pointer_touch_target = @@ -1517,7 +1519,7 @@ TEST_F(SyntheticGestureControllerTest, PointerTouchAction) { gesture.reset(new SyntheticPointerAction( SyntheticGestureParams::TOUCH_INPUT, SyntheticGesture::RELEASE, &synthetic_pointer, position, index)); - QueueSyntheticGesture(gesture.Pass()); + QueueSyntheticGesture(std::move(gesture)); FlushInputUntilComplete(); pointer_touch_target = diff --git a/content/browser/renderer_host/input/touch_action_browsertest.cc b/content/browser/renderer_host/input/touch_action_browsertest.cc index f8fc11a..72c8bc9 100644 --- a/content/browser/renderer_host/input/touch_action_browsertest.cc +++ b/content/browser/renderer_host/input/touch_action_browsertest.cc @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <utility> + #include "base/auto_reset.h" #include "base/bind.h" #include "base/command_line.h" @@ -148,7 +150,7 @@ class TouchActionBrowserTest : public ContentBrowserTest { scoped_ptr<SyntheticSmoothScrollGesture> gesture( new SyntheticSmoothScrollGesture(params)); GetWidgetHost()->QueueSyntheticGesture( - gesture.Pass(), + std::move(gesture), base::Bind(&TouchActionBrowserTest::OnSyntheticGestureCompleted, base::Unretained(this))); diff --git a/content/browser/renderer_host/input/touch_event_queue.cc b/content/browser/renderer_host/input/touch_event_queue.cc index 9397cf7..550b46b 100644 --- a/content/browser/renderer_host/input/touch_event_queue.cc +++ b/content/browser/renderer_host/input/touch_event_queue.cc @@ -4,6 +4,8 @@ #include "content/browser/renderer_host/input/touch_event_queue.h" +#include <utility> + #include "base/auto_reset.h" #include "base/macros.h" #include "base/metrics/histogram_macros.h" @@ -619,7 +621,8 @@ void TouchEventQueue::ForwardNextEventToRenderer() { void TouchEventQueue::FlushPendingAsyncTouchmove() { DCHECK(!dispatching_touch_); - scoped_ptr<TouchEventWithLatencyInfo> touch = pending_async_touchmove_.Pass(); + scoped_ptr<TouchEventWithLatencyInfo> touch = + std::move(pending_async_touchmove_); touch->event.cancelable = false; touch_queue_.push_front(new CoalescedWebTouchEvent(*touch, true)); SendTouchEventImmediately(touch.get()); @@ -741,7 +744,7 @@ scoped_ptr<CoalescedWebTouchEvent> TouchEventQueue::PopTouchEvent() { DCHECK(!touch_queue_.empty()); scoped_ptr<CoalescedWebTouchEvent> event(touch_queue_.front()); touch_queue_.pop_front(); - return event.Pass(); + return event; } void TouchEventQueue::SendTouchEventImmediately( diff --git a/content/browser/renderer_host/input/touch_event_queue_unittest.cc b/content/browser/renderer_host/input/touch_event_queue_unittest.cc index 392d822..f1091d4 100644 --- a/content/browser/renderer_host/input/touch_event_queue_unittest.cc +++ b/content/browser/renderer_host/input/touch_event_queue_unittest.cc @@ -2,7 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "content/browser/renderer_host/input/touch_event_queue.h" + #include <stddef.h> +#include <utility> #include "base/location.h" #include "base/logging.h" @@ -11,7 +14,6 @@ #include "base/single_thread_task_runner.h" #include "base/thread_task_runner_handle.h" #include "content/browser/renderer_host/input/timeout_monitor.h" -#include "content/browser/renderer_host/input/touch_event_queue.h" #include "content/common/input/synthetic_web_input_event_builders.h" #include "content/common/input/web_touch_event_traits.h" #include "testing/gtest/include/gtest/gtest.h" @@ -58,7 +60,7 @@ class TouchEventQueueTest : public testing::Test, sent_events_.push_back(event.event); sent_events_ids_.push_back(event.event.uniqueTouchEventId); if (sync_ack_result_) { - auto sync_ack_result = sync_ack_result_.Pass(); + auto sync_ack_result = std::move(sync_ack_result_); SendTouchEventAck(*sync_ack_result); } } @@ -70,12 +72,12 @@ class TouchEventQueueTest : public testing::Test, last_acked_event_state_ = ack_result; if (followup_touch_event_) { scoped_ptr<WebTouchEvent> followup_touch_event = - followup_touch_event_.Pass(); + std::move(followup_touch_event_); SendTouchEvent(*followup_touch_event); } if (followup_gesture_event_) { scoped_ptr<WebGestureEvent> followup_gesture_event = - followup_gesture_event_.Pass(); + std::move(followup_gesture_event_); queue_->OnGestureScrollEvent( GestureEventWithLatencyInfo(*followup_gesture_event, ui::LatencyInfo())); diff --git a/content/browser/renderer_host/input/touchscreen_tap_suppression_controller.cc b/content/browser/renderer_host/input/touchscreen_tap_suppression_controller.cc index 872cfb0..791422d3 100644 --- a/content/browser/renderer_host/input/touchscreen_tap_suppression_controller.cc +++ b/content/browser/renderer_host/input/touchscreen_tap_suppression_controller.cc @@ -4,6 +4,8 @@ #include "content/browser/renderer_host/input/touchscreen_tap_suppression_controller.h" +#include <utility> + #include "content/browser/renderer_host/input/gesture_event_queue.h" using blink::WebInputEvent; @@ -63,8 +65,8 @@ void TouchscreenTapSuppressionController::DropStashedTapDown() { void TouchscreenTapSuppressionController::ForwardStashedTapDown() { DCHECK(stashed_tap_down_); - ScopedGestureEvent tap_down = stashed_tap_down_.Pass(); - ScopedGestureEvent show_press = stashed_show_press_.Pass(); + ScopedGestureEvent tap_down = std::move(stashed_tap_down_); + ScopedGestureEvent show_press = std::move(stashed_show_press_); gesture_event_queue_->ForwardGestureEvent(*tap_down); if (show_press) gesture_event_queue_->ForwardGestureEvent(*show_press); |