task_info.cc 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // Copyright 2020 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. #include "components/background_task_scheduler/task_info.h"
  5. namespace background_task {
  6. PeriodicInfo::PeriodicInfo()
  7. : interval_ms(0), flex_ms(0), expires_after_window_end_time(false) {}
  8. PeriodicInfo::~PeriodicInfo() = default;
  9. OneOffInfo::OneOffInfo()
  10. : window_start_time_ms(0),
  11. window_end_time_ms(0),
  12. expires_after_window_end_time(false) {}
  13. OneOffInfo::~OneOffInfo() = default;
  14. ExactInfo::ExactInfo() : trigger_at_ms(0) {}
  15. ExactInfo::~ExactInfo() = default;
  16. TaskInfo::TaskInfo(int task_id, const PeriodicInfo& timing_info)
  17. : task_id(task_id),
  18. network_type(NetworkType::NONE),
  19. requires_charging(false),
  20. is_persisted(false),
  21. update_current(false),
  22. periodic_info(timing_info) {}
  23. TaskInfo::TaskInfo(int task_id, const OneOffInfo& timing_info)
  24. : task_id(task_id),
  25. network_type(NetworkType::NONE),
  26. requires_charging(false),
  27. is_persisted(false),
  28. update_current(false),
  29. one_off_info(timing_info) {}
  30. TaskInfo::TaskInfo(int task_id, const ExactInfo& timing_info)
  31. : task_id(task_id),
  32. network_type(NetworkType::NONE),
  33. requires_charging(false),
  34. is_persisted(false),
  35. update_current(false),
  36. exact_info(timing_info) {}
  37. TaskInfo::~TaskInfo() = default;
  38. } // namespace background_task