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

Side by Side Diff: chrome/browser/extensions/extension_updater.cc

Issue 7820004: extensions: Use Version ctor instead of calling GetVersionFromString(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add DCHECK Created 9 years, 3 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 | « no previous file | 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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/browser/extensions/extension_updater.h" 5 #include "chrome/browser/extensions/extension_updater.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 extension.GetType(), 306 extension.GetType(),
307 extension.update_url(), update_url_data); 307 extension.update_url(), update_url_data);
308 } 308 }
309 309
310 void ManifestFetchesBuilder::AddPendingExtension( 310 void ManifestFetchesBuilder::AddPendingExtension(
311 const std::string& id, 311 const std::string& id,
312 const PendingExtensionInfo& info) { 312 const PendingExtensionInfo& info) {
313 // Use a zero version to ensure that a pending extension will always 313 // Use a zero version to ensure that a pending extension will always
314 // be updated, and thus installed (assuming all extensions have 314 // be updated, and thus installed (assuming all extensions have
315 // non-zero versions). 315 // non-zero versions).
316 scoped_ptr<Version> version( 316 Version version("0.0.0.0");
317 Version::GetVersionFromString("0.0.0.0")); 317 DCHECK(version.IsValid());
cpu_(ooo_6.6-7.5) 2011/09/01 02:11:32 that dcheck is checking a constant from the line b
318 318
319 AddExtensionData( 319 AddExtensionData(info.install_source(), id, version,
320 info.install_source(), id, *version, 320 Extension::TYPE_UNKNOWN, info.update_url(), "");
321 Extension::TYPE_UNKNOWN, info.update_url(), "");
322 } 321 }
323 322
324 void ManifestFetchesBuilder::ReportStats() const { 323 void ManifestFetchesBuilder::ReportStats() const {
325 UMA_HISTOGRAM_COUNTS_100("Extensions.UpdateCheckExtension", 324 UMA_HISTOGRAM_COUNTS_100("Extensions.UpdateCheckExtension",
326 url_stats_.extension_count); 325 url_stats_.extension_count);
327 UMA_HISTOGRAM_COUNTS_100("Extensions.UpdateCheckTheme", 326 UMA_HISTOGRAM_COUNTS_100("Extensions.UpdateCheckTheme",
328 url_stats_.theme_count); 327 url_stats_.theme_count);
329 UMA_HISTOGRAM_COUNTS_100("Extensions.UpdateCheckApp", 328 UMA_HISTOGRAM_COUNTS_100("Extensions.UpdateCheckApp",
330 url_stats_.app_count); 329 url_stats_.app_count);
331 UMA_HISTOGRAM_COUNTS_100("Extensions.UpdateCheckPending", 330 UMA_HISTOGRAM_COUNTS_100("Extensions.UpdateCheckPending",
(...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after
1242 std::set<std::string>::const_iterator i; 1241 std::set<std::string>::const_iterator i;
1243 for (i = ids.begin(); i != ids.end(); ++i) 1242 for (i = ids.begin(); i != ids.end(); ++i)
1244 in_progress_ids_.insert(*i); 1243 in_progress_ids_.insert(*i);
1245 } 1244 }
1246 1245
1247 void ExtensionUpdater::RemoveFromInProgress(const std::set<std::string>& ids) { 1246 void ExtensionUpdater::RemoveFromInProgress(const std::set<std::string>& ids) {
1248 std::set<std::string>::const_iterator i; 1247 std::set<std::string>::const_iterator i;
1249 for (i = ids.begin(); i != ids.end(); ++i) 1248 for (i = ids.begin(); i != ids.end(); ++i)
1250 in_progress_ids_.erase(*i); 1249 in_progress_ids_.erase(*i);
1251 } 1250 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698