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

Side by Side Diff: ui/events/gesture_detection/motion_event_generic.cc

Issue 1138993007: Substituting pattern push_back(ptr.release()) with push_back(ptr.Pass()) in ui/events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporated the review comments Created 5 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/events/gesture_detection/motion_event_generic.h" 5 #include "ui/events/gesture_detection/motion_event_generic.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ui/events/base_event_utils.h" 8 #include "ui/events/base_event_utils.h"
9 9
10 namespace ui { 10 namespace ui {
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 pointers_->erase(pointers_->begin() + index); 210 pointers_->erase(pointers_->begin() + index);
211 } 211 }
212 212
213 void MotionEventGeneric::PushHistoricalEvent(scoped_ptr<MotionEvent> event) { 213 void MotionEventGeneric::PushHistoricalEvent(scoped_ptr<MotionEvent> event) {
214 DCHECK(event); 214 DCHECK(event);
215 DCHECK_EQ(event->GetAction(), ACTION_MOVE); 215 DCHECK_EQ(event->GetAction(), ACTION_MOVE);
216 DCHECK_EQ(event->GetPointerCount(), GetPointerCount()); 216 DCHECK_EQ(event->GetPointerCount(), GetPointerCount());
217 DCHECK_EQ(event->GetAction(), GetAction()); 217 DCHECK_EQ(event->GetAction(), GetAction());
218 DCHECK_LE(event->GetEventTime().ToInternalValue(), 218 DCHECK_LE(event->GetEventTime().ToInternalValue(),
219 GetEventTime().ToInternalValue()); 219 GetEventTime().ToInternalValue());
220 historical_events_.push_back(event.release()); 220 historical_events_.push_back(event.Pass());
221 } 221 }
222 222
223 MotionEventGeneric::MotionEventGeneric() 223 MotionEventGeneric::MotionEventGeneric()
224 : action_(ACTION_CANCEL), 224 : action_(ACTION_CANCEL),
225 unique_event_id_(ui::GetNextTouchEventId()), 225 unique_event_id_(ui::GetNextTouchEventId()),
226 action_index_(0), 226 action_index_(0),
227 button_state_(0) { 227 button_state_(0) {
228 } 228 }
229 229
230 MotionEventGeneric::MotionEventGeneric(const MotionEvent& event, 230 MotionEventGeneric::MotionEventGeneric(const MotionEvent& event,
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 PushHistoricalEvent(other.historical_events_[h]->Clone()); 274 PushHistoricalEvent(other.historical_events_[h]->Clone());
275 return *this; 275 return *this;
276 } 276 }
277 277
278 void MotionEventGeneric::PopPointer() { 278 void MotionEventGeneric::PopPointer() {
279 DCHECK_GT(pointers_->size(), 0U); 279 DCHECK_GT(pointers_->size(), 0U);
280 pointers_->pop_back(); 280 pointers_->pop_back();
281 } 281 }
282 282
283 } // namespace ui 283 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/gesture_detection/motion_event_buffer.cc ('k') | ui/events/gestures/gesture_provider_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698