update_engine: Share payloads for a maximum of five days only.
This helps limit exposure of what version the device may or may not be
running.
BUG=chromium:424823
TEST=New unit test + unit tests pass.
Change-Id: I9db6f8d560e359c2b8a65d1381dc44320ed4b3a1
Reviewed-on: https://chromium-review.googlesource.com/227592
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Tested-by: David Zeuthen <zeuthen@chromium.org>
Commit-Queue: David Zeuthen <zeuthen@chromium.org>
diff --git a/p2p_manager.h b/p2p_manager.h
index ddd0fda..4c6e508 100644
--- a/p2p_manager.h
+++ b/p2p_manager.h
@@ -15,6 +15,7 @@
#include <policy/device_policy.h>
#include <policy/libpolicy.h>
+#include "update_engine/clock_interface.h"
#include "update_engine/prefs_interface.h"
namespace chromeos_update_engine {
@@ -164,11 +165,15 @@
//
// The |num_files_to_keep| parameter specifies how many files to
// keep after performing housekeeping (cf. the PerformHousekeeping()
- // method). If zero is passed, no files will be deleted.
+ // method) - pass zero to allow infinitely many files. The
+ // |max_file_age| parameter specifies the maximum file age after
+ // performing housekeeping (pass zero to allow files of any age).
static P2PManager* Construct(Configuration *configuration,
PrefsInterface *prefs,
+ ClockInterface *clock,
const std::string& file_extension,
- const int num_files_to_keep);
+ const int num_files_to_keep,
+ const base::TimeDelta& max_file_age);
};
} // namespace chromeos_update_engine