OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/updater/extension_updater.h" | 5 #include "chrome/browser/extensions/updater/extension_updater.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 will_check_soon_ = false; | 295 will_check_soon_ = false; |
296 } | 296 } |
297 | 297 |
298 void ExtensionUpdater::AddToDownloader( | 298 void ExtensionUpdater::AddToDownloader( |
299 const ExtensionSet* extensions, | 299 const ExtensionSet* extensions, |
300 const std::list<std::string>& pending_ids, | 300 const std::list<std::string>& pending_ids, |
301 int request_id) { | 301 int request_id) { |
302 InProgressCheck& request = requests_in_progress_[request_id]; | 302 InProgressCheck& request = requests_in_progress_[request_id]; |
303 for (ExtensionSet::const_iterator extension_iter = extensions->begin(); | 303 for (ExtensionSet::const_iterator extension_iter = extensions->begin(); |
304 extension_iter != extensions->end(); ++extension_iter) { | 304 extension_iter != extensions->end(); ++extension_iter) { |
305 const Extension& extension = **extension_iter; | 305 const Extension& extension = *extension_iter->get(); |
306 if (!Manifest::IsAutoUpdateableLocation(extension.location())) { | 306 if (!Manifest::IsAutoUpdateableLocation(extension.location())) { |
307 VLOG(2) << "Extension " << extension.id() << " is not auto updateable"; | 307 VLOG(2) << "Extension " << extension.id() << " is not auto updateable"; |
308 continue; | 308 continue; |
309 } | 309 } |
310 // An extension might be overwritten by policy, and have its update url | 310 // An extension might be overwritten by policy, and have its update url |
311 // changed. Make sure existing extensions aren't fetched again, if a | 311 // changed. Make sure existing extensions aren't fetched again, if a |
312 // pending fetch for an extension with the same id already exists. | 312 // pending fetch for an extension with the same id already exists. |
313 std::list<std::string>::const_iterator pending_id_iter = std::find( | 313 std::list<std::string>::const_iterator pending_id_iter = std::find( |
314 pending_ids.begin(), pending_ids.end(), extension.id()); | 314 pending_ids.begin(), pending_ids.end(), extension.id()); |
315 if (pending_id_iter == pending_ids.end()) { | 315 if (pending_id_iter == pending_ids.end()) { |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
688 const InProgressCheck& request = requests_in_progress_[request_id]; | 688 const InProgressCheck& request = requests_in_progress_[request_id]; |
689 if (request.in_progress_ids_.empty()) { | 689 if (request.in_progress_ids_.empty()) { |
690 VLOG(2) << "Finished update check " << request_id; | 690 VLOG(2) << "Finished update check " << request_id; |
691 if (!request.callback.is_null()) | 691 if (!request.callback.is_null()) |
692 request.callback.Run(); | 692 request.callback.Run(); |
693 requests_in_progress_.erase(request_id); | 693 requests_in_progress_.erase(request_id); |
694 } | 694 } |
695 } | 695 } |
696 | 696 |
697 } // namespace extensions | 697 } // namespace extensions |
OLD | NEW |