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

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

Issue 17001003: Replace early check for PNaCl with an on-demand check. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 7 years, 6 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 | chrome/browser/component_updater/pnacl/pnacl_component_installer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3ecf2a9cdbe6da86e3af23218e16fe8f4268312a..c2dfb870ec3b5ec2bbbdefb143b77ebea676a44c 100644
--- a/chrome/browser/component_updater/pnacl/pnacl_component_installer.h
+++ b/chrome/browser/component_updater/pnacl/pnacl_component_installer.h
@@ -5,14 +5,16 @@
#ifndef CHROME_BROWSER_COMPONENT_UPDATER_PNACL_PNACL_COMPONENT_INSTALLER_H_
#define CHROME_BROWSER_COMPONENT_UPDATER_PNACL_PNACL_COMPONENT_INSTALLER_H_
-#include <string>
+#include <list>
+#include "base/callback_forward.h"
#include "base/compiler_specific.h"
#include "base/files/file_path.h"
#include "base/memory/scoped_ptr.h"
#include "base/version.h"
#include "chrome/browser/component_updater/component_updater_service.h"
#include "chrome/browser/component_updater/pnacl/pnacl_profile_observer.h"
+#include "chrome/browser/component_updater/pnacl/pnacl_updater_observer.h"
class CommandLine;
@@ -59,12 +61,31 @@ class PnaclComponentInstaller : public ComponentInstaller {
ComponentUpdateService* cus() const { return cus_; }
+ typedef base::Callback<void(bool)> InstallCallback;
+ void AddInstallCallback(const InstallCallback& cb);
+
+ void NotifyInstallError();
+
+ void NotifyInstallSuccess();
+
private:
+ // Cancel a particular callback after a timeout.
+ void CancelCallback(int callback_num);
+
+ void NotifyAllWithResult(bool status);
+
bool per_user_;
scoped_ptr<PnaclProfileObserver> profile_observer_;
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_;
+ // Component updater service observer, to determine when an on-demand
+ // install request failed.
+ scoped_ptr<PnaclUpdaterObserver> updater_observer_;
DISALLOW_COPY_AND_ASSIGN(PnaclComponentInstaller);
};
@@ -73,4 +94,11 @@ class PnaclComponentInstaller : public ComponentInstaller {
bool CheckPnaclComponentManifest(const base::DictionaryValue& manifest,
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_
« no previous file with comments | « no previous file | chrome/browser/component_updater/pnacl/pnacl_component_installer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698