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

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

Issue 6609008: Change other usages of .size() to .empty() when applicable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Peter nits Created 9 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « chrome/common/extensions/extension_icon_set.cc ('k') | chrome/common/extensions/user_script.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/common/extensions/update_manifest.h" 5 #include "chrome/common/extensions/update_manifest.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/scoped_ptr.h" 9 #include "base/scoped_ptr.h"
10 #include "base/stl_util-inl.h" 10 #include "base/stl_util-inl.h"
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 235
236 // Check for the gupdate "protocol" attribute. 236 // Check for the gupdate "protocol" attribute.
237 if (GetAttribute(root, "protocol") != kExpectedGupdateProtocol) { 237 if (GetAttribute(root, "protocol") != kExpectedGupdateProtocol) {
238 ParseError("Missing/incorrect protocol on gupdate tag " 238 ParseError("Missing/incorrect protocol on gupdate tag "
239 "(expected '%s')", kExpectedGupdateProtocol); 239 "(expected '%s')", kExpectedGupdateProtocol);
240 return false; 240 return false;
241 } 241 }
242 242
243 // Parse the first <daystart> if it's present. 243 // Parse the first <daystart> if it's present.
244 std::vector<xmlNode*> daystarts = GetChildren(root, gupdate_ns, "daystart"); 244 std::vector<xmlNode*> daystarts = GetChildren(root, gupdate_ns, "daystart");
245 if (daystarts.size() > 0) { 245 if (!daystarts.empty()) {
246 xmlNode* first = daystarts[0]; 246 xmlNode* first = daystarts[0];
247 std::string elapsed_seconds = GetAttribute(first, "elapsed_seconds"); 247 std::string elapsed_seconds = GetAttribute(first, "elapsed_seconds");
248 int parsed_elapsed = kNoDaystart; 248 int parsed_elapsed = kNoDaystart;
249 if (base::StringToInt(elapsed_seconds, &parsed_elapsed)) { 249 if (base::StringToInt(elapsed_seconds, &parsed_elapsed)) {
250 results_.daystart_elapsed_seconds = parsed_elapsed; 250 results_.daystart_elapsed_seconds = parsed_elapsed;
251 } 251 }
252 } 252 }
253 253
254 // Parse each of the <app> tags. 254 // Parse each of the <app> tags.
255 std::vector<xmlNode*> apps = GetChildren(root, gupdate_ns, "app"); 255 std::vector<xmlNode*> apps = GetChildren(root, gupdate_ns, "app");
256 for (unsigned int i = 0; i < apps.size(); i++) { 256 for (unsigned int i = 0; i < apps.size(); i++) {
257 Result current; 257 Result current;
258 std::string error; 258 std::string error;
259 if (!ParseSingleAppTag(apps[i], gupdate_ns, &current, &error)) { 259 if (!ParseSingleAppTag(apps[i], gupdate_ns, &current, &error)) {
260 ParseError("%s", error.c_str()); 260 ParseError("%s", error.c_str());
261 } else { 261 } else {
262 results_.list.push_back(current); 262 results_.list.push_back(current);
263 } 263 }
264 } 264 }
265 265
266 return true; 266 return true;
267 } 267 }
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension_icon_set.cc ('k') | chrome/common/extensions/user_script.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698