OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/gesture_feedback.h" | 5 #include "ui/events/ozone/evdev/libgestures_glue/gesture_feedback.h" |
6 | 6 |
7 #include <time.h> | 7 #include <time.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 } | 93 } |
94 if (!strftime(buffer, kTouchLogTimestampMaxSize, "%Y%m%d-%H%M%S", &timeinfo)) | 94 if (!strftime(buffer, kTouchLogTimestampMaxSize, "%Y%m%d-%H%M%S", &timeinfo)) |
95 return ""; | 95 return ""; |
96 return std::string(buffer); | 96 return std::string(buffer); |
97 } | 97 } |
98 | 98 |
99 // Canonize the device name for logging. | 99 // Canonize the device name for logging. |
100 std::string GetCanonicalDeviceName(const std::string& name) { | 100 std::string GetCanonicalDeviceName(const std::string& name) { |
101 std::string ret(name); | 101 std::string ret(name); |
102 for (size_t i = 0; i < ret.size(); ++i) | 102 for (size_t i = 0; i < ret.size(); ++i) |
103 if (!IsAsciiAlpha(ret[i])) | 103 if (!base::IsAsciiAlpha(ret[i])) |
104 ret[i] = '_'; | 104 ret[i] = '_'; |
105 return ret; | 105 return ret; |
106 } | 106 } |
107 | 107 |
108 // Name event logs in a way that is compatible with existing toolchain. | 108 // Name event logs in a way that is compatible with existing toolchain. |
109 std::string GenerateEventLogName(GesturePropertyProvider* provider, | 109 std::string GenerateEventLogName(GesturePropertyProvider* provider, |
110 const base::FilePath& out_dir, | 110 const base::FilePath& out_dir, |
111 const std::string& prefix, | 111 const std::string& prefix, |
112 const std::string& now, | 112 const std::string& now, |
113 int id) { | 113 int id) { |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 } | 210 } |
211 | 211 |
212 // Compress touchpad/mouse logs on another thread and return. | 212 // Compress touchpad/mouse logs on another thread and return. |
213 base::WorkerPool::PostTaskAndReply( | 213 base::WorkerPool::PostTaskAndReply( |
214 FROM_HERE, | 214 FROM_HERE, |
215 base::Bind(&CompressDumpedLog, base::Passed(&log_paths_to_be_compressed)), | 215 base::Bind(&CompressDumpedLog, base::Passed(&log_paths_to_be_compressed)), |
216 base::Bind(reply, base::Passed(&log_paths)), true /* task_is_slow */); | 216 base::Bind(reply, base::Passed(&log_paths)), true /* task_is_slow */); |
217 } | 217 } |
218 | 218 |
219 } // namespace ui | 219 } // namespace ui |
OLD | NEW |