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

Unified Diff: chrome/common/extensions/update_manifest.cc

Issue 15908002: Differential updates for components. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Sync to LKGR revision 207804. 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 | « chrome/common/extensions/update_manifest.h ('k') | chrome/common/omaha_query_params/omaha_query_params.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/update_manifest.cc
diff --git a/chrome/common/extensions/update_manifest.cc b/chrome/common/extensions/update_manifest.cc
index feb6f7096444f1efd53514a98d23c338872533d5..0ed653ff76a8e32288b96c9bef31027a41ad2324 100644
--- a/chrome/common/extensions/update_manifest.cc
+++ b/chrome/common/extensions/update_manifest.cc
@@ -19,7 +19,9 @@ static const char* kExpectedGupdateProtocol = "2.0";
static const char* kExpectedGupdateXmlns =
"http://www.google.com/update2/response";
-UpdateManifest::Result::Result() {}
+UpdateManifest::Result::Result()
+ : size(0),
+ diff_size(0) {}
UpdateManifest::Result::~Result() {}
@@ -154,7 +156,7 @@ static bool ParseSingleAppTag(xmlNode* app_node, xmlNs* xml_namespace,
result->crx_url = GURL(GetAttribute(updatecheck, "codebase"));
if (!result->crx_url.is_valid()) {
*error_detail = "Invalid codebase url: '";
- *error_detail += GetAttribute(updatecheck, "codebase");
+ *error_detail += result->crx_url.possibly_invalid_spec();
*error_detail += "'.";
return false;
}
@@ -189,6 +191,23 @@ static bool ParseSingleAppTag(xmlNode* app_node, xmlNs* xml_namespace,
// sha256 hash of the package in hex format.
result->package_hash = GetAttribute(updatecheck, "hash");
+ int size = 0;
+ if (base::StringToInt(GetAttribute(updatecheck, "size"), &size)) {
+ result->size = size;
+ }
+
+ // package_fingerprint is optional. It identifies the package, preferably
+ // with a modified sha256 hash of the package in hex format.
+ result->package_fingerprint = GetAttribute(updatecheck, "fp");
+
+ // Differential update information is optional.
+ result->diff_crx_url = GURL(GetAttribute(updatecheck, "codebasediff"));
+ result->diff_package_hash = GetAttribute(updatecheck, "hashdiff");
+ int sizediff = 0;
+ if (base::StringToInt(GetAttribute(updatecheck, "sizediff"), &sizediff)) {
+ result->diff_size = sizediff;
+ }
+
return true;
}
« no previous file with comments | « chrome/common/extensions/update_manifest.h ('k') | chrome/common/omaha_query_params/omaha_query_params.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698