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

Side by Side Diff: extensions/common/update_manifest.cc

Issue 2259383002: Consistently use namespaced base::Version in extensions code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « extensions/common/manifest_handlers/shared_module_info.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
278 std::string error; 278 std::string error;
279 if (!ParseSingleAppTag(apps[i], gupdate_ns, &current, &error)) { 279 if (!ParseSingleAppTag(apps[i], gupdate_ns, &current, &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 }
OLDNEW
« no previous file with comments | « extensions/common/manifest_handlers/shared_module_info.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698