Commit 2ca0df03 authored by Mila Green's avatar Mila Green Committed by Chromium LUCI CQ

Updater: Implement AppInstall::RegisterUpdater to register the updater.

Bug: 1128060
Change-Id: I787b44462a2154119e256725fd7b8bcac7d9f74d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2617868Reviewed-by: default avatarSorin Jianu <sorin@chromium.org>
Reviewed-by: default avatarJoshua Pawlicki <waffles@chromium.org>
Commit-Queue: Mila Green <milagreen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#842261}
parent 2e4e0f37
...@@ -143,14 +143,18 @@ void AppInstall::WakeCandidate() { ...@@ -143,14 +143,18 @@ void AppInstall::WakeCandidate() {
} }
void AppInstall::RegisterUpdater() { void AppInstall::RegisterUpdater() {
// TODO(crbug.com/1128060): We should update the updater's registration with RegistrationRequest registration_request;
// the new version, brand code, etc. For now, fake it. registration_request.app_id = kUpdaterAppId;
RegistrationResponse result; registration_request.version = base::Version(UPDATER_VERSION_STRING);
result.status_code = 0;
RegisterUpdaterDone(result); scoped_refptr<UpdateService> update_service = CreateUpdateService();
update_service->RegisterApp(
registration_request,
base::BindOnce(&AppInstall::RegisterUpdaterDone, this, update_service));
} }
void AppInstall::RegisterUpdaterDone(const RegistrationResponse& response) { void AppInstall::RegisterUpdaterDone(scoped_refptr<UpdateService>,
const RegistrationResponse& response) {
VLOG(1) << "Updater registration complete, code = " << response.status_code; VLOG(1) << "Updater registration complete, code = " << response.status_code;
MaybeInstallApp(); MaybeInstallApp();
} }
......
...@@ -68,7 +68,8 @@ class AppInstall : public App { ...@@ -68,7 +68,8 @@ class AppInstall : public App {
void RegisterUpdater(); void RegisterUpdater();
void RegisterUpdaterDone(const RegistrationResponse& response); void RegisterUpdaterDone(scoped_refptr<UpdateService>,
const RegistrationResponse& response);
// Handles the --tag and --app-id command line arguments, and triggers // Handles the --tag and --app-id command line arguments, and triggers
// installing of the corresponding application if either argument is present. // installing of the corresponding application if either argument is present.
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include "base/version.h" #include "base/version.h"
#include "base/win/scoped_bstr.h" #include "base/win/scoped_bstr.h"
#include "chrome/updater/app/server/win/updater_idl.h" #include "chrome/updater/app/server/win/updater_idl.h"
#include "chrome/updater/registration_data.h"
#include "chrome/updater/util.h" #include "chrome/updater/util.h"
namespace updater { namespace updater {
...@@ -302,7 +303,9 @@ void UpdateServiceProxy::RegisterApp( ...@@ -302,7 +303,9 @@ void UpdateServiceProxy::RegisterApp(
const RegistrationRequest& request, const RegistrationRequest& request,
base::OnceCallback<void(const RegistrationResponse&)> callback) { base::OnceCallback<void(const RegistrationResponse&)> callback) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
NOTREACHED(); // TODO(crbug.com/1163524): Implement registration API.
base::SequencedTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::BindOnce(std::move(callback), RegistrationResponse(0)));
} }
void UpdateServiceProxy::UpdateAll(StateChangeCallback state_update, void UpdateServiceProxy::UpdateAll(StateChangeCallback state_update,
......
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