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

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

Issue 12184029: Make pnacl install on demand when it is not already installed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: forward decl Created 7 years, 10 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/component_updater_service.cc
diff --git a/chrome/browser/component_updater/component_updater_service.cc b/chrome/browser/component_updater/component_updater_service.cc
index f2d0155e2c6cd16dd34e57fa52d607dba6b3d2b6..8f7678a5246fb8e53b28ddf1fd3b1d4624676f5c 100644
--- a/chrome/browser/component_updater/component_updater_service.cc
+++ b/chrome/browser/component_updater/component_updater_service.cc
@@ -255,6 +255,8 @@ class CrxUpdateService : public ComponentUpdateService {
virtual Status Stop() OVERRIDE;
virtual Status RegisterComponent(const CrxComponent& component) OVERRIDE;
virtual Status CheckForUpdateSoon(const CrxComponent& component) OVERRIDE;
+ virtual bool FindRegisteredComponent(const std::vector<uint8>& pk_hash,
+ CrxComponent* component) OVERRIDE;
// The only purpose of this class is to forward the
// UtilityProcessHostClient callbacks so CrxUpdateService does
@@ -499,6 +501,21 @@ ComponentUpdateService::Status CrxUpdateService::RegisterComponent(
return kOk;
}
+bool CrxUpdateService::FindRegisteredComponent(
+ const std::vector<uint8>& pk_hash,
+ CrxComponent* component) {
+ std::string id =
+ HexStringToID(StringToLowerASCII(base::HexEncode(&pk_hash[0],
+ pk_hash.size()/2)));
+ CrxUpdateItem* uit = FindUpdateItemById(id);
+ if (uit) {
+ *component = uit->component;
+ return true;
+ }
+ return false;
+}
+
+
// Sets a component to be checked for updates.
// The componet to add is |crxit| and the |query| string is modified with the
// required omaha compatible query. Returns false when the query strings

Powered by Google App Engine
This is Rietveld 408576698