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

Unified Diff: chrome/browser/component_updater/pnacl/pnacl_component_installer.h

Issue 18006003: Consistently use notifications from component updater w/ on-demand PNaCl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more cleanup Created 7 years, 5 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
Index: chrome/browser/component_updater/pnacl/pnacl_component_installer.h
diff --git a/chrome/browser/component_updater/pnacl/pnacl_component_installer.h b/chrome/browser/component_updater/pnacl/pnacl_component_installer.h
index 88fb61fb823b7290114296b8d4f1524afaf40b9e..da5a3c54911b15a02b32392296e601fe9898f6ab 100644
--- a/chrome/browser/component_updater/pnacl/pnacl_component_installer.h
+++ b/chrome/browser/component_updater/pnacl/pnacl_component_installer.h
@@ -47,6 +47,8 @@ class PnaclComponentInstaller : public ComponentInstaller {
// updater service.
void ReRegisterPnacl();
+ CrxComponent GetCrxComponent();
+
// Return true if PNaCl installs are separated by user.
bool per_user() const { return per_user_; }
@@ -66,17 +68,20 @@ class PnaclComponentInstaller : public ComponentInstaller {
ComponentUpdateService* cus() const { return cus_; }
typedef base::Callback<void(bool)> InstallCallback;
- void AddInstallCallback(const InstallCallback& cb);
-
- void NotifyInstallError();
- void NotifyInstallSuccess();
+ // Ask the component updater service to do a first-install for PNaCl.
+ // The |installed| callback will be run with |true| on success,
+ // or run with |false| on an error. The callback is called on the UI thread.
+ void RequestFirstInstall(const InstallCallback& installed);
private:
- // Cancel a particular callback after a timeout.
- void CancelCallback(int callback_num);
+ friend class PnaclUpdaterObserver;
- void NotifyAllWithResult(bool status);
+ // Called when a RequestFirstInstall completed successfully.
+ void NotifyInstallSuccess();
+
+ // Called when a RequestFirstInstall will not happen, or an error occurred.
+ void NotifyInstallError();
bool per_user_;
bool updates_disabled_;
@@ -84,26 +89,12 @@ class PnaclComponentInstaller : public ComponentInstaller {
base::FilePath current_profile_path_;
base::Version current_version_;
ComponentUpdateService* cus_;
- // Counter to issue identifiers to each callback.
- int callback_nums_;
- // List of callbacks to issue when an install completes successfully.
- std::list<std::pair<InstallCallback, int> > install_callbacks_;
+ // The one callback to call when there is a RequestFirstInstall.
+ InstallCallback install_callback_;
// Component updater service observer, to determine when an on-demand
// install request failed.
scoped_ptr<PnaclUpdaterObserver> updater_observer_;
DISALLOW_COPY_AND_ASSIGN(PnaclComponentInstaller);
};
-// Returns true if this browser is compatible with the given Pnacl component
-// manifest, with the version specified in the manifest in |version_out|.
-bool CheckPnaclComponentManifest(const base::DictionaryValue& manifest,
jvoung (off chromium) 2013/08/02 21:17:59 Noticed that this shouldn't have been in the globa
- base::Version* version_out);
-
-// Ask the given component updater service to do a first-install for PNaCl.
-// The |installed| callback will be run with |true| on success,
-// or run with |false| on an error. The callback is called on the UI thread.
-void RequestFirstInstall(ComponentUpdateService* cus,
- PnaclComponentInstaller* pci,
- const base::Callback<void(bool)>& installed);
-
#endif // CHROME_BROWSER_COMPONENT_UPDATER_PNACL_PNACL_COMPONENT_INSTALLER_H_

Powered by Google App Engine
This is Rietveld 408576698