OLD | NEW |
---|---|
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 Loading... | |
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"); |
tfarina
2011/08/31 21:18:40
please, check if that is right. Do I need to call
akalin
2011/08/31 21:28:03
I think so. DCHECK(version.IsValid()); should suf
tfarina
2011/08/31 21:35:36
Done.
| |
317 Version::GetVersionFromString("0.0.0.0")); | |
tfarina
2011/08/31 21:18:40
This is a TODO in base/version.cc to remove GetVer
| |
318 | 317 |
319 AddExtensionData( | 318 AddExtensionData(info.install_source(), id, version, |
320 info.install_source(), id, *version, | 319 Extension::TYPE_UNKNOWN, info.update_url(), ""); |
321 Extension::TYPE_UNKNOWN, info.update_url(), ""); | |
322 } | 320 } |
323 | 321 |
324 void ManifestFetchesBuilder::ReportStats() const { | 322 void ManifestFetchesBuilder::ReportStats() const { |
325 UMA_HISTOGRAM_COUNTS_100("Extensions.UpdateCheckExtension", | 323 UMA_HISTOGRAM_COUNTS_100("Extensions.UpdateCheckExtension", |
326 url_stats_.extension_count); | 324 url_stats_.extension_count); |
327 UMA_HISTOGRAM_COUNTS_100("Extensions.UpdateCheckTheme", | 325 UMA_HISTOGRAM_COUNTS_100("Extensions.UpdateCheckTheme", |
328 url_stats_.theme_count); | 326 url_stats_.theme_count); |
329 UMA_HISTOGRAM_COUNTS_100("Extensions.UpdateCheckApp", | 327 UMA_HISTOGRAM_COUNTS_100("Extensions.UpdateCheckApp", |
330 url_stats_.app_count); | 328 url_stats_.app_count); |
331 UMA_HISTOGRAM_COUNTS_100("Extensions.UpdateCheckPending", | 329 UMA_HISTOGRAM_COUNTS_100("Extensions.UpdateCheckPending", |
(...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1242 std::set<std::string>::const_iterator i; | 1240 std::set<std::string>::const_iterator i; |
1243 for (i = ids.begin(); i != ids.end(); ++i) | 1241 for (i = ids.begin(); i != ids.end(); ++i) |
1244 in_progress_ids_.insert(*i); | 1242 in_progress_ids_.insert(*i); |
1245 } | 1243 } |
1246 | 1244 |
1247 void ExtensionUpdater::RemoveFromInProgress(const std::set<std::string>& ids) { | 1245 void ExtensionUpdater::RemoveFromInProgress(const std::set<std::string>& ids) { |
1248 std::set<std::string>::const_iterator i; | 1246 std::set<std::string>::const_iterator i; |
1249 for (i = ids.begin(); i != ids.end(); ++i) | 1247 for (i = ids.begin(); i != ids.end(); ++i) |
1250 in_progress_ids_.erase(*i); | 1248 in_progress_ids_.erase(*i); |
1251 } | 1249 } |
OLD | NEW |