Chromium Code Reviews| Index: chromeos/dbus/update_engine_client.h |
| diff --git a/chromeos/dbus/update_engine_client.h b/chromeos/dbus/update_engine_client.h |
| index 94c89ea7b50546c2f449b43f537636602f90d047..561a4d15d7987ac97b84de8ab4d4b3b606e6ad48 100644 |
| --- a/chromeos/dbus/update_engine_client.h |
| +++ b/chromeos/dbus/update_engine_client.h |
| @@ -40,7 +40,8 @@ class CHROMEOS_EXPORT UpdateEngineClient : public DBusClient { |
| UPDATE_STATUS_FINALIZING, |
| UPDATE_STATUS_UPDATED_NEED_REBOOT, |
| UPDATE_STATUS_REPORTING_ERROR_EVENT, |
| - UPDATE_STATUS_ATTEMPTING_ROLLBACK |
| + UPDATE_STATUS_ATTEMPTING_ROLLBACK, |
| + UPDATE_STATUS_NEED_PERMISSION_TO_UPDATE, |
| }; |
| // The status of the ongoing update attempt. |
| @@ -84,7 +85,7 @@ class CHROMEOS_EXPORT UpdateEngineClient : public DBusClient { |
| // Called once RequestUpdateCheck() is complete. Takes one parameter: |
| // - UpdateCheckResult: the result of the update check. |
| - typedef base::Callback<void(UpdateCheckResult)> UpdateCheckCallback; |
| + using UpdateCheckCallback = base::Callback<void(UpdateCheckResult)>; |
| // Requests an update check and calls |callback| when completed. |
| virtual void RequestUpdateCheck(const UpdateCheckCallback& callback) = 0; |
| @@ -97,7 +98,7 @@ class CHROMEOS_EXPORT UpdateEngineClient : public DBusClient { |
| // Called once CanRollbackCheck() is complete. Takes one parameter: |
| // - bool: the result of the rollback availability check. |
| - typedef base::Callback<void(bool can_rollback)> RollbackCheckCallback; |
| + using RollbackCheckCallback = base::Callback<void(bool can_rollback)>; |
| // Checks if Rollback is available and calls |callback| when completed. |
| virtual void CanRollbackCheck( |
| @@ -105,8 +106,8 @@ class CHROMEOS_EXPORT UpdateEngineClient : public DBusClient { |
| // Called once GetChannel() is complete. Takes one parameter; |
| // - string: the channel name like "beta-channel". |
| - typedef base::Callback<void(const std::string& channel_name)> |
| - GetChannelCallback; |
| + using GetChannelCallback = |
| + base::Callback<void(const std::string& channel_name)>; |
| // Returns the last status the object received from the update engine. |
| // |
| @@ -137,8 +138,8 @@ class CHROMEOS_EXPORT UpdateEngineClient : public DBusClient { |
| // Called once GetEolStatus() is complete. Takes one parameter; |
| // - EndOfLife Status: the end of life status of the device. |
| - typedef base::Callback<void(update_engine::EndOfLifeStatus status)> |
| - GetEolStatusCallback; |
| + using GetEolStatusCallback = |
| + base::Callback<void(update_engine::EndOfLifeStatus status)>; |
| // Get EndOfLife status of the device and calls |callback| when completed. |
| virtual void GetEolStatus(const GetEolStatusCallback& callback) = 0; |
| @@ -149,6 +150,27 @@ class CHROMEOS_EXPORT UpdateEngineClient : public DBusClient { |
| bool allowed, |
| const base::Closure& callback) = 0; |
| + // Called once SetUpdateOverCellularTarget() is complete. Takes one parameter; |
| + // - success: indicates whether the target is set successfully. |
| + using SetUpdateOverCellularTargetCallback = |
| + base::Callback<void(bool success)>; |
| + |
| + // Set the target in the preferences maintained by update engine which then |
|
Daniel Erat
2017/05/12 18:13:30
nit: s/Set/Sets/
weidongg
2017/05/12 18:23:18
Done.
|
| + // performs update to this given target after RequestUpdateCheck() is invoked |
| + // in the |callback|. |
| + // - target_version: the chrome os version we want to update to. |
|
Daniel Erat
2017/05/12 18:13:30
nit: s/chrome os/Chrome OS/
weidongg
2017/05/12 18:23:18
Done.
|
| + // - target_size: the size of that chrome os version in bytes. |
|
Daniel Erat
2017/05/12 18:13:30
same here
weidongg
2017/05/12 18:23:18
Done.
|
| + // These two parameters are a failsafe to prevent downloading an update user |
| + // didn't agree to. They should be set using the version and size we received |
| + // from update engine when it broadcasts NEED_PERMISSION_TO_UPDATE. They are |
| + // used by update engine to double-check with update server in case there's a |
| + // new update available or a delta update becomes a full update with larger |
| + // size. |
| + virtual void SetUpdateOverCellularTarget( |
| + const std::string& target_version, |
| + int64_t target_size, |
| + const SetUpdateOverCellularTargetCallback& callback) = 0; |
| + |
| // Returns an empty UpdateCheckCallback that does nothing. |
| static UpdateCheckCallback EmptyUpdateCheckCallback(); |