InstallAppController receives state changes using a callback.
Since UpdateClient::Install now takes a repeating callback to convey state changes, the updater can use this callback mechanism instead of observer events. Also, fixed the second parameter for the ctor, which imo, it was confusing. A ctor decl like Ctor(param, callback) may indicate to the reader that the ctor is handled in a non-blocking manner. In this case we are talking about, it is the InstallApp call which is non-blocking: void InstallApp(const std::string& app_id, base::OnceCallback<void(int)> callback); I made the InstallAppController ref counted thread safe, since the class is shared among different threads of execution, and it is more correct to be declared this way. There is no corresponding component state for the COMPONENT_WAIT event, so at one point we may do something about the state machine, or come up with a different way to receive this, or just ignore. Bug: 1059938 Change-Id: Ib27f7fed50e5513a974bef1c74c6eac6827935fc Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2095866Reviewed-by:Joshua Pawlicki <waffles@chromium.org> Commit-Queue: Sorin Jianu <sorin@chromium.org> Cr-Commit-Position: refs/heads/master@{#748669}
Showing
This diff is collapsed.
Please register or sign in to comment