| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "extensions/common/update_manifest.h" | 5 #include "extensions/common/update_manifest.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 if (result->browser_min_version.length()) { | 180 if (result->browser_min_version.length()) { |
| 181 Version browser_min_version(result->browser_min_version); | 181 Version browser_min_version(result->browser_min_version); |
| 182 if (!browser_min_version.IsValid()) { | 182 if (!browser_min_version.IsValid()) { |
| 183 *error_detail = "Invalid prodversionmin: '"; | 183 *error_detail = "Invalid prodversionmin: '"; |
| 184 *error_detail += result->browser_min_version; | 184 *error_detail += result->browser_min_version; |
| 185 *error_detail += "'."; | 185 *error_detail += "'."; |
| 186 return false; | 186 return false; |
| 187 } | 187 } |
| 188 } | 188 } |
| 189 | 189 |
| 190 // package_hash is optional. It is only required for blacklist. It is a | 190 // package_hash is optional. It is a sha256 hash of the package in hex |
| 191 // sha256 hash of the package in hex format. | 191 // format. |
| 192 result->package_hash = GetAttribute(updatecheck, "hash"); | 192 result->package_hash = GetAttribute(updatecheck, "hash_sha256"); |
| 193 | 193 |
| 194 int size = 0; | 194 int size = 0; |
| 195 if (base::StringToInt(GetAttribute(updatecheck, "size"), &size)) { | 195 if (base::StringToInt(GetAttribute(updatecheck, "size"), &size)) { |
| 196 result->size = size; | 196 result->size = size; |
| 197 } | 197 } |
| 198 | 198 |
| 199 // package_fingerprint is optional. It identifies the package, preferably | 199 // package_fingerprint is optional. It identifies the package, preferably |
| 200 // with a modified sha256 hash of the package in hex format. | 200 // with a modified sha256 hash of the package in hex format. |
| 201 result->package_fingerprint = GetAttribute(updatecheck, "fp"); | 201 result->package_fingerprint = GetAttribute(updatecheck, "fp"); |
| 202 | 202 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 std::string error; | 276 std::string error; |
| 277 if (!ParseSingleAppTag(apps[i], gupdate_ns, ¤t, &error)) { | 277 if (!ParseSingleAppTag(apps[i], gupdate_ns, ¤t, &error)) { |
| 278 ParseError("%s", error.c_str()); | 278 ParseError("%s", error.c_str()); |
| 279 } else { | 279 } else { |
| 280 results_.list.push_back(current); | 280 results_.list.push_back(current); |
| 281 } | 281 } |
| 282 } | 282 } |
| 283 | 283 |
| 284 return true; | 284 return true; |
| 285 } | 285 } |
| OLD | NEW |