log_cleanup.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. // Copyright 2018 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef COMPONENTS_WEBRTC_LOGGING_BROWSER_LOG_CLEANUP_H_
  5. #define COMPONENTS_WEBRTC_LOGGING_BROWSER_LOG_CLEANUP_H_
  6. #include "base/time/time.h"
  7. namespace base {
  8. class FilePath;
  9. class Time;
  10. } // namespace base
  11. namespace webrtc_logging {
  12. extern const base::TimeDelta kTimeToKeepLogs;
  13. // Deletes logs files older that 5 days. Updates the log file list.
  14. // Must be called on a task runner that's allowed to block.
  15. // TODO(crbug.com/826221): Only call on the same task runner as where writing
  16. // is done.
  17. void DeleteOldWebRtcLogFiles(const base::FilePath& log_dir);
  18. // Deletes logs files older that 5 days and logs younger than
  19. // |delete_begin_time|. Updates the log file list. If |delete_begin_time| is
  20. // base::time::Max(), no recent logs will be deleted, and the function is
  21. // equal to DeleteOldWebRtcLogFiles().
  22. // Must be called on a task runner that's allowed to block.
  23. // TODO(crbug.com/826221): Only call on the same task runner as where writing
  24. // is done.
  25. void DeleteOldAndRecentWebRtcLogFiles(const base::FilePath& log_dir,
  26. const base::Time& delete_begin_time);
  27. } // namespace webrtc_logging
  28. #endif // COMPONENTS_WEBRTC_LOGGING_BROWSER_LOG_CLEANUP_H_