summaryrefslogtreecommitdiff
path: root/real_system_state.cc
diff options
context:
space:
mode:
Diffstat (limited to 'real_system_state.cc')
-rw-r--r--real_system_state.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/real_system_state.cc b/real_system_state.cc
index d61e8c38..f16f2f8f 100644
--- a/real_system_state.cc
+++ b/real_system_state.cc
@@ -41,10 +41,6 @@ bool RealSystemState::Initialize() {
system_rebooted_ = true;
}
- p2p_manager_.reset(P2PManager::Construct(
- nullptr, &prefs_, &clock_, "cros_au", kMaxP2PFilesToKeep,
- base::TimeDelta::FromDays(kMaxP2PFileAgeDays)));
-
// Initialize the Update Manager using the default state factory.
chromeos_update_manager::State* um_state =
chromeos_update_manager::DefaultStateFactory(
@@ -58,6 +54,11 @@ bool RealSystemState::Initialize() {
&clock_, base::TimeDelta::FromSeconds(5),
base::TimeDelta::FromHours(12), um_state));
+ // The P2P Manager depends on the Update Manager for its initialization.
+ p2p_manager_.reset(P2PManager::Construct(
+ nullptr, &clock_, update_manager_.get(), "cros_au",
+ kMaxP2PFilesToKeep, base::TimeDelta::FromDays(kMaxP2PFileAgeDays)));
+
if (!payload_state_.Initialize(this)) {
LOG(ERROR) << "Failed to initialize the payload state object.";
return false;