| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <time.h> | 8 #include <time.h> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/location.h" | 12 #include "base/location.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/process/launch.h" | 14 #include "base/process/launch.h" |
| 15 #include "base/strings/string_number_conversions.h" | 15 #include "base/strings/string_number_conversions.h" |
| 16 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
| 17 #include "base/strings/stringprintf.h" | 17 #include "base/strings/stringprintf.h" |
| 18 #include "base/threading/worker_pool.h" | 18 #include "base/task_scheduler/post_task.h" |
| 19 #include "ui/events/ozone/evdev/libgestures_glue/gesture_property_provider.h" | 19 #include "ui/events/ozone/evdev/libgestures_glue/gesture_property_provider.h" |
| 20 | 20 |
| 21 namespace ui { | 21 namespace ui { |
| 22 | 22 |
| 23 namespace { | 23 namespace { |
| 24 | 24 |
| 25 // Binary paths. | 25 // Binary paths. |
| 26 const char kGzipCommand[] = "/bin/gzip"; | 26 const char kGzipCommand[] = "/bin/gzip"; |
| 27 | 27 |
| 28 const size_t kTouchLogTimestampMaxSize = 80; | 28 const size_t kTouchLogTimestampMaxSize = 80; |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 if (converter->HasTouchscreen()) { | 225 if (converter->HasTouchscreen()) { |
| 226 converter->DumpTouchEventLog(kInputEventsLogFile); | 226 converter->DumpTouchEventLog(kInputEventsLogFile); |
| 227 std::string touch_evdev_log_filename = GenerateEventLogName( | 227 std::string touch_evdev_log_filename = GenerateEventLogName( |
| 228 out_dir, "evdev_input_events_", now, converter->id()); | 228 out_dir, "evdev_input_events_", now, converter->id()); |
| 229 base::Move(base::FilePath(kInputEventsLogFile), | 229 base::Move(base::FilePath(kInputEventsLogFile), |
| 230 base::FilePath(touch_evdev_log_filename)); | 230 base::FilePath(touch_evdev_log_filename)); |
| 231 log_paths->push_back(base::FilePath(touch_evdev_log_filename)); | 231 log_paths->push_back(base::FilePath(touch_evdev_log_filename)); |
| 232 } | 232 } |
| 233 } | 233 } |
| 234 | 234 |
| 235 // Compress touchpad/mouse logs on another thread and return. | 235 // Compress touchpad/mouse logs asynchronously |
| 236 base::WorkerPool::PostTaskAndReply( | 236 base::PostTaskWithTraitsAndReply( |
| 237 FROM_HERE, | 237 FROM_HERE, base::TaskTraits() |
| 238 .WithShutdownBehavior( |
| 239 base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN) |
| 240 .WithPriority(base::TaskPriority::BACKGROUND) |
| 241 .MayBlock(), |
| 238 base::Bind(&CompressDumpedLog, base::Passed(&log_paths_to_be_compressed)), | 242 base::Bind(&CompressDumpedLog, base::Passed(&log_paths_to_be_compressed)), |
| 239 base::Bind(reply, base::Passed(&log_paths)), true /* task_is_slow */); | 243 base::Bind(reply, base::Passed(&log_paths))); |
| 240 } | 244 } |
| 241 | 245 |
| 242 } // namespace ui | 246 } // namespace ui |
| OLD | NEW |