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

Side by Side Diff: ui/events/ozone/evdev/libgestures_glue/event_reader_libevdev_cros.cc

Issue 2126433002: Use container::back() and container::pop_back() in ui/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pre-increment Created 4 years, 5 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
« no previous file with comments | « ui/display/mac/screen_mac.mm ('k') | ui/events/ozone/evdev/libgestures_glue/gesture_logging.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/ozone/evdev/libgestures_glue/event_reader_libevdev_cros.h" 5 #include "ui/events/ozone/evdev/libgestures_glue/event_reader_libevdev_cros.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <libevdev/libevdev.h> 8 #include <libevdev/libevdev.h>
9 #include <linux/input.h> 9 #include <linux/input.h>
10 #include <utility> 10 #include <utility>
11 11
12 #include "base/message_loop/message_loop.h" 12 #include "base/message_loop/message_loop.h"
13 #include "base/strings/string_util.h" 13 #include "base/strings/string_util.h"
14 #include "base/strings/stringprintf.h" 14 #include "base/strings/stringprintf.h"
15 #include "base/trace_event/trace_event.h" 15 #include "base/trace_event/trace_event.h"
16 16
17 namespace ui { 17 namespace ui {
18 18
19 namespace { 19 namespace {
20 20
21 std::string FormatLog(const char* fmt, va_list args) { 21 std::string FormatLog(const char* fmt, va_list args) {
22 std::string msg = base::StringPrintV(fmt, args); 22 std::string msg = base::StringPrintV(fmt, args);
23 if (!msg.empty() && msg[msg.size() - 1] == '\n') 23 if (!msg.empty() && msg.back() == '\n')
24 msg.erase(msg.end() - 1, msg.end()); 24 msg.pop_back();
25 return msg; 25 return msg;
26 } 26 }
27 27
28 } // namespace 28 } // namespace
29 29
30 EventReaderLibevdevCros::EventReaderLibevdevCros( 30 EventReaderLibevdevCros::EventReaderLibevdevCros(
31 int fd, 31 int fd,
32 const base::FilePath& path, 32 const base::FilePath& path,
33 int id, 33 int id,
34 const EventDeviceInfo& devinfo, 34 const EventDeviceInfo& devinfo,
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 if (level >= LOGLEVEL_ERROR) 127 if (level >= LOGLEVEL_ERROR)
128 LOG(ERROR) << "libevdev: " << FormatLog(fmt, args); 128 LOG(ERROR) << "libevdev: " << FormatLog(fmt, args);
129 else if (level >= LOGLEVEL_WARNING) 129 else if (level >= LOGLEVEL_WARNING)
130 LOG(WARNING) << "libevdev: " << FormatLog(fmt, args); 130 LOG(WARNING) << "libevdev: " << FormatLog(fmt, args);
131 else 131 else
132 VLOG(3) << "libevdev: " << FormatLog(fmt, args); 132 VLOG(3) << "libevdev: " << FormatLog(fmt, args);
133 va_end(args); 133 va_end(args);
134 } 134 }
135 135
136 } // namespace ui 136 } // namespace ui
OLDNEW
« no previous file with comments | « ui/display/mac/screen_mac.mm ('k') | ui/events/ozone/evdev/libgestures_glue/gesture_logging.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698