Chromium Code Reviews| Index: chrome/browser/component_updater/cros_component_installer.cc |
| diff --git a/chrome/browser/component_updater/cros_component_installer.cc b/chrome/browser/component_updater/cros_component_installer.cc |
| index 0aa088658e3f12ec5aad14c5e7bc90cbbd48943f..b7fba9f3b12e02e70cd1b20074de37ab1f4a4cc3 100644 |
| --- a/chrome/browser/component_updater/cros_component_installer.cc |
| +++ b/chrome/browser/component_updater/cros_component_installer.cc |
| @@ -19,8 +19,31 @@ using content::BrowserThread; |
| namespace component_updater { |
| #if defined(OS_CHROMEOS) |
| +void LogLoadResult(chromeos::DBusMethodCallStatus call_status, |
|
hashimoto
2017/03/10 04:27:22
Does this code compile?
Seems this callback lacks
xiaochu
2017/03/10 16:49:00
it is a StringDBusMethodCallback type. And a new i
|
| + const std::string& result) { |
| + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| + if (call_status != chromeos::DBUS_METHOD_CALL_SUCCESS) { |
| + DVLOG(1) << "Call to imageloader service failed."; |
| + return; |
| + } |
| + if (result.empty()) { |
| + DVLOG(1) << "Component load failed"; |
| + return; |
| + } |
| +} |
| +void ImageLoaderLoad(const std::string& name) { |
| + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| + chromeos::ImageLoaderClient* loader = |
| + chromeos::DBusThreadManager::Get()->GetImageLoaderClient(); |
| + if (loader) { |
| + loader->LoadComponent(name, base::Bind(&LogLoadResult)); |
| + } else { |
| + DVLOG(1) << "Failed to get ImageLoaderClient object."; |
| + } |
| +} |
| void LogRegistrationResult(chromeos::DBusMethodCallStatus call_status, |
| - bool result) { |
| + bool result, |
| + const std::string& name) { |
| DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| if (call_status != chromeos::DBUS_METHOD_CALL_SUCCESS) { |
| DVLOG(1) << "Call to imageloader service failed."; |
| @@ -30,6 +53,7 @@ void LogRegistrationResult(chromeos::DBusMethodCallStatus call_status, |
| DVLOG(1) << "Component registration failed"; |
| return; |
| } |
| + ImageLoaderLoad(name); |
| } |
| void ImageLoaderRegistration(const std::string& version, |
| const base::FilePath& install_dir, |