| 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 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 *error_detail += "'."; | 162 *error_detail += "'."; |
| 163 return false; | 163 return false; |
| 164 } | 164 } |
| 165 | 165 |
| 166 // Get the version. | 166 // Get the version. |
| 167 result->version = GetAttribute(updatecheck, "version"); | 167 result->version = GetAttribute(updatecheck, "version"); |
| 168 if (result->version.length() == 0) { | 168 if (result->version.length() == 0) { |
| 169 *error_detail = "Missing version for updatecheck."; | 169 *error_detail = "Missing version for updatecheck."; |
| 170 return false; | 170 return false; |
| 171 } | 171 } |
| 172 Version version(result->version); | 172 base::Version version(result->version); |
| 173 if (!version.IsValid()) { | 173 if (!version.IsValid()) { |
| 174 *error_detail = "Invalid version: '"; | 174 *error_detail = "Invalid version: '"; |
| 175 *error_detail += result->version; | 175 *error_detail += result->version; |
| 176 *error_detail += "'."; | 176 *error_detail += "'."; |
| 177 return false; | 177 return false; |
| 178 } | 178 } |
| 179 | 179 |
| 180 // Get the minimum browser version (not required). | 180 // Get the minimum browser version (not required). |
| 181 result->browser_min_version = GetAttribute(updatecheck, "prodversionmin"); | 181 result->browser_min_version = GetAttribute(updatecheck, "prodversionmin"); |
| 182 if (result->browser_min_version.length()) { | 182 if (result->browser_min_version.length()) { |
| 183 Version browser_min_version(result->browser_min_version); | 183 base::Version browser_min_version(result->browser_min_version); |
| 184 if (!browser_min_version.IsValid()) { | 184 if (!browser_min_version.IsValid()) { |
| 185 *error_detail = "Invalid prodversionmin: '"; | 185 *error_detail = "Invalid prodversionmin: '"; |
| 186 *error_detail += result->browser_min_version; | 186 *error_detail += result->browser_min_version; |
| 187 *error_detail += "'."; | 187 *error_detail += "'."; |
| 188 return false; | 188 return false; |
| 189 } | 189 } |
| 190 } | 190 } |
| 191 | 191 |
| 192 // package_hash is optional. It is a sha256 hash of the package in hex | 192 // package_hash is optional. It is a sha256 hash of the package in hex |
| 193 // format. | 193 // format. |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 std::string error; | 278 std::string error; |
| 279 if (!ParseSingleAppTag(apps[i], gupdate_ns, ¤t, &error)) { | 279 if (!ParseSingleAppTag(apps[i], gupdate_ns, ¤t, &error)) { |
| 280 ParseError("%s", error.c_str()); | 280 ParseError("%s", error.c_str()); |
| 281 } else { | 281 } else { |
| 282 results_.list.push_back(current); | 282 results_.list.push_back(current); |
| 283 } | 283 } |
| 284 } | 284 } |
| 285 | 285 |
| 286 return true; | 286 return true; |
| 287 } | 287 } |
| OLD | NEW |