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

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

Issue 2762393002: Add more commentsin cros_component_installer (Closed)
Patch Set: fix alignment 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.h
diff --git a/chrome/browser/component_updater/cros_component_installer.h b/chrome/browser/component_updater/cros_component_installer.h
index 1058bb7efb5c6b60f2cc05cc654ee2cd363f2b5c..fa9b985920d616a92627c7b6030c14c85b06232b 100644
--- a/chrome/browser/component_updater/cros_component_installer.h
+++ b/chrome/browser/component_updater/cros_component_installer.h
@@ -60,12 +60,54 @@ class CrOSComponentInstallerTraits : public ComponentInstallerTraits {
// This class contains functions used to register and install a component.
class CrOSComponent {
public:
- // Register and start installing a CrOS component.
- // |install_callback| is triggered after install finishes and returns error
- // code: update_client::Error::INVALID_ARGUMENT - component name is invalid.
- // update_client::Error::NONE
- // - successful install
- // other error returns are processed by OnDemandUpdate upon install finishes.
+ // Register and start installing a CrOS component.
+ // |install_callback| is triggered after install finishes and returns error
+ // code.
+ //
+ // example:
+ // ...
+ // void PerformOperations(chromeos::DBusMethodCallStatus call_status,
+ // const std::string& version){
+ // if (call_status != chromeos::DBUS_METHOD_CALL_SUCCESS) {
+ // DVLOG(1) << "Call to imageloader service failed.";
+ // return;
+ // }
+ // if (version.empty()) {
+ // DVLOG(1) << "[PerformOperations] Component is not installed";
+ // return;
+ // }
+ // // [mounted compnent path: /run/imageloader/[component name]/[version]]
+ // //
+ // // [component is ready to do your work]
+ // }
+ // void install_callback(update_client::Error error){
+ // // switch(error){
+ // // case update_client::Error::NONE:
+ // // // component is installed
+ // // break;
+ // // case update_client::Error::INVALID_ARGUMENT:
+ // // // your install failed due of your wrong parameters.
+ // // break;
+ // // default:
+ // // // your install failed due to system failure.
+ // // break;
+ // // }
+ // // Even when error code other than NONE returned (your install failed),
+ // // component might has already being installed previously.
+ // // Plus, if you want to know current version of component.
+ // chromeos::ImageLoaderClient* loader =
+ // chromeos::DBusThreadManager::Get()->GetImageLoaderClient();
+ // if (loader) {
+ // loader->GetComponentVersion("escpr", base::Bind(&PerformOperations));
+ // } else {
+ // VLOG(0) << "Failed to get ImageLoaderClient object.";
+ // }
+ // }
+ // ...
+ // component_updater::CrOSComponent::InstallCrOSComponent(
+ // name,
+ // base::Bind(&install_callback));
+ //
static bool InstallCrOSComponent(
const std::string& name,
const update_client::Callback& install_callback);
« 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