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

Side by Side Diff: ui/events/event_source.cc

Issue 2546973003: Replace unique_ptr.reset/release with std::move under src/ui (Closed)
Patch Set: Whitespace formatting Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/event_source.h" 5 #include "ui/events/event_source.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ui/events/event_processor.h" 9 #include "ui/events/event_processor.h"
10 #include "ui/events/event_rewriter.h" 10 #include "ui/events/event_rewriter.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 while (status == EVENT_REWRITE_DISPATCH_ANOTHER) { 55 while (status == EVENT_REWRITE_DISPATCH_ANOTHER) {
56 std::unique_ptr<Event> new_event; 56 std::unique_ptr<Event> new_event;
57 status = (*it)->NextDispatchEvent(*rewritten_event, &new_event); 57 status = (*it)->NextDispatchEvent(*rewritten_event, &new_event);
58 if (status == EVENT_REWRITE_DISCARD) 58 if (status == EVENT_REWRITE_DISCARD)
59 return EventDispatchDetails(); 59 return EventDispatchDetails();
60 CHECK_NE(EVENT_REWRITE_CONTINUE, status); 60 CHECK_NE(EVENT_REWRITE_CONTINUE, status);
61 CHECK(new_event); 61 CHECK(new_event);
62 details = DeliverEventToProcessor(new_event.get()); 62 details = DeliverEventToProcessor(new_event.get());
63 if (details.dispatcher_destroyed) 63 if (details.dispatcher_destroyed)
64 return details; 64 return details;
65 rewritten_event.reset(new_event.release()); 65 rewritten_event = std::move(new_event);
66 } 66 }
67 return EventDispatchDetails(); 67 return EventDispatchDetails();
68 } 68 }
69 69
70 EventDispatchDetails EventSource::DeliverEventToProcessor(Event* event) { 70 EventDispatchDetails EventSource::DeliverEventToProcessor(Event* event) {
71 EventProcessor* processor = GetEventProcessor(); 71 EventProcessor* processor = GetEventProcessor();
72 CHECK(processor); 72 CHECK(processor);
73 return processor->OnEventFromSource(event); 73 return processor->OnEventFromSource(event);
74 } 74 }
75 75
76 } // namespace ui 76 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698