Commit fcdded46 authored by Sorin Jianu's avatar Sorin Jianu Committed by Commit Bot

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: default avatarJoshua Pawlicki <waffles@chromium.org>
Commit-Queue: Sorin Jianu <sorin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#748669}
parent d6a98892
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment