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 <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <set> | 10 #include <set> |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 will_check_soon_ = false; | 313 will_check_soon_ = false; |
314 } | 314 } |
315 | 315 |
316 void ExtensionUpdater::AddToDownloader( | 316 void ExtensionUpdater::AddToDownloader( |
317 const ExtensionSet* extensions, | 317 const ExtensionSet* extensions, |
318 const std::list<std::string>& pending_ids, | 318 const std::list<std::string>& pending_ids, |
319 int request_id) { | 319 int request_id) { |
320 InProgressCheck& request = requests_in_progress_[request_id]; | 320 InProgressCheck& request = requests_in_progress_[request_id]; |
321 for (ExtensionSet::const_iterator extension_iter = extensions->begin(); | 321 for (ExtensionSet::const_iterator extension_iter = extensions->begin(); |
322 extension_iter != extensions->end(); ++extension_iter) { | 322 extension_iter != extensions->end(); ++extension_iter) { |
323 const Extension& extension = *extension_iter->get(); | 323 const Extension& extension = **extension_iter; |
324 if (!Manifest::IsAutoUpdateableLocation(extension.location())) { | 324 if (!Manifest::IsAutoUpdateableLocation(extension.location())) { |
325 VLOG(2) << "Extension " << extension.id() << " is not auto updateable"; | 325 VLOG(2) << "Extension " << extension.id() << " is not auto updateable"; |
326 continue; | 326 continue; |
327 } | 327 } |
328 // An extension might be overwritten by policy, and have its update url | 328 // An extension might be overwritten by policy, and have its update url |
329 // changed. Make sure existing extensions aren't fetched again, if a | 329 // changed. Make sure existing extensions aren't fetched again, if a |
330 // pending fetch for an extension with the same id already exists. | 330 // pending fetch for an extension with the same id already exists. |
331 std::list<std::string>::const_iterator pending_id_iter = std::find( | 331 std::list<std::string>::const_iterator pending_id_iter = std::find( |
332 pending_ids.begin(), pending_ids.end(), extension.id()); | 332 pending_ids.begin(), pending_ids.end(), extension.id()); |
333 if (pending_id_iter == pending_ids.end()) { | 333 if (pending_id_iter == pending_ids.end()) { |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
609 const InProgressCheck& request = requests_in_progress_[request_id]; | 609 const InProgressCheck& request = requests_in_progress_[request_id]; |
610 if (request.in_progress_ids_.empty()) { | 610 if (request.in_progress_ids_.empty()) { |
611 VLOG(2) << "Finished update check " << request_id; | 611 VLOG(2) << "Finished update check " << request_id; |
612 if (!request.callback.is_null()) | 612 if (!request.callback.is_null()) |
613 request.callback.Run(); | 613 request.callback.Run(); |
614 requests_in_progress_.erase(request_id); | 614 requests_in_progress_.erase(request_id); |
615 } | 615 } |
616 } | 616 } |
617 | 617 |
618 } // namespace extensions | 618 } // namespace extensions |
OLD | NEW |