Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5919)

Unified Diff: chrome/browser/component_updater/cros_component_installer.cc

Issue 2744453003: Mount image upon component installed (Closed)
Patch Set: addressing comments from hashimoto Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..04fb7048b50cfa274519d981cee19aeff8fdd45c 100644
--- a/chrome/browser/component_updater/cros_component_installer.cc
+++ b/chrome/browser/component_updater/cros_component_installer.cc
@@ -19,7 +19,30 @@ using content::BrowserThread;
namespace component_updater {
#if defined(OS_CHROMEOS)
-void LogRegistrationResult(chromeos::DBusMethodCallStatus call_status,
+void LogLoadResult(chromeos::DBusMethodCallStatus call_status,
+ 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(const std::string& name,
+ chromeos::DBusMethodCallStatus call_status,
bool result) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
if (call_status != chromeos::DBUS_METHOD_CALL_SUCCESS) {
@@ -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,
@@ -40,7 +64,7 @@ void ImageLoaderRegistration(const std::string& version,
if (loader) {
loader->RegisterComponent(name, version, install_dir.value(),
- base::Bind(&LogRegistrationResult));
+ base::Bind(&LogRegistrationResult, name));
} else {
DVLOG(1) << "Failed to get ImageLoaderClient object.";
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698