summaryrefslogtreecommitdiff
path: root/payload_state_interface.h
diff options
context:
space:
mode:
authorGilad Arnold <garnold@chromium.org>2014-10-07 08:17:16 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-11-03 18:24:08 +0000
commit74b5f55e6ff608857664fe151f54d78bfe0b75bb (patch)
treef44e9b3b244ea2930bc7d6c6b4e3d30fbb013eb9 /payload_state_interface.h
parent14a9e70709b4cda5afc97ac6219bc660810b2077 (diff)
update_engine: Relocate inference and storage of P2P related properties.
This change moves the inference of P2P related properties from OmahaRequestAction to OmahaResponseHandlerAction, and their storage from OmahaRequestParams to PayloadState. This is needed in order for the UpdateCanStart policy to be able to decide P2P properties, which only happens after the Omaha response is received and processed, and prior to applying the update. Further, P2P properties do not affect the Omaha request, and so there's no reason for them to reside in OmahaRequestParams nor decided as early as OmahaRequestAction. Additional cleanup includes swapping expected/actual arguments to EXPECT macros where appropriate, and removing redundant .Times(1) expectation qualifiers. BUG=chromium:384087 TEST=Unit tests. Change-Id: I6d5b4b44745d5dab7e350bdf019dbf804bf196a1 Reviewed-on: https://chromium-review.googlesource.com/223618 Reviewed-by: Gilad Arnold <garnold@chromium.org> Commit-Queue: Gilad Arnold <garnold@chromium.org> Tested-by: Gilad Arnold <garnold@chromium.org>
Diffstat (limited to 'payload_state_interface.h')
-rw-r--r--payload_state_interface.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/payload_state_interface.h b/payload_state_interface.h
index c706e984..1825a40d 100644
--- a/payload_state_interface.h
+++ b/payload_state_interface.h
@@ -74,11 +74,14 @@ class PayloadStateInterface {
virtual void ExpectRebootInNewVersion(
const std::string& target_version_uid) = 0;
- // Sets whether p2p is being used to download the update payload. This
- // is used to keep track download sources being used and should be called
+ // Sets whether P2P is being used to download the update payload. This
+ // is used to keep track of download sources being used and should be called
// before the transfer begins.
virtual void SetUsingP2PForDownloading(bool value) = 0;
+ // Sets whether P2P is being used for sharing the update payloads.
+ virtual void SetUsingP2PForSharing(bool value) = 0;
+
// Returns true if we should backoff the current download attempt.
// False otherwise.
virtual bool ShouldBackoffDownload() = 0;
@@ -161,14 +164,20 @@ class PayloadStateInterface {
// as when the first attempt was.
virtual bool P2PAttemptAllowed() = 0;
- // Gets the value previously set with SetUsingP2PForDownloading().
- virtual bool GetUsingP2PForDownloading() = 0;
+ // Gets the values previously set with SetUsingP2PForDownloading() and
+ // SetUsingP2PForSharing().
+ virtual bool GetUsingP2PForDownloading() const = 0;
+ virtual bool GetUsingP2PForSharing() const = 0;
// Returns the current (persisted) scattering wallclock-based wait period.
virtual base::TimeDelta GetScatteringWaitPeriod() = 0;
// Sets and persists the scattering wallclock-based wait period.
virtual void SetScatteringWaitPeriod(base::TimeDelta wait_period) = 0;
+
+ // Sets/gets the P2P download URL, if one is to be used.
+ virtual void SetP2PUrl(const std::string& url) = 0;
+ virtual std::string GetP2PUrl() const = 0;
};
} // namespace chromeos_update_engine