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 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 will_check_soon_ = true; | 388 will_check_soon_ = true; |
389 } else { | 389 } else { |
390 NOTREACHED(); | 390 NOTREACHED(); |
391 } | 391 } |
392 } | 392 } |
393 | 393 |
394 bool ExtensionUpdater::WillCheckSoon() const { | 394 bool ExtensionUpdater::WillCheckSoon() const { |
395 return will_check_soon_; | 395 return will_check_soon_; |
396 } | 396 } |
397 | 397 |
| 398 void ExtensionUpdater::SetExtensionCacheForTesting( |
| 399 ExtensionCache* extension_cache) { |
| 400 extension_cache_ = extension_cache; |
| 401 } |
| 402 |
398 void ExtensionUpdater::DoCheckSoon() { | 403 void ExtensionUpdater::DoCheckSoon() { |
399 DCHECK(will_check_soon_); | 404 DCHECK(will_check_soon_); |
400 CheckNow(default_params_); | 405 CheckNow(default_params_); |
401 will_check_soon_ = false; | 406 will_check_soon_ = false; |
402 } | 407 } |
403 | 408 |
404 void ExtensionUpdater::AddToDownloader( | 409 void ExtensionUpdater::AddToDownloader( |
405 const ExtensionSet* extensions, | 410 const ExtensionSet* extensions, |
406 const std::list<std::string>& pending_ids, | 411 const std::list<std::string>& pending_ids, |
407 int request_id) { | 412 int request_id) { |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
757 const InProgressCheck& request = requests_in_progress_[request_id]; | 762 const InProgressCheck& request = requests_in_progress_[request_id]; |
758 if (request.in_progress_ids_.empty()) { | 763 if (request.in_progress_ids_.empty()) { |
759 VLOG(2) << "Finished update check " << request_id; | 764 VLOG(2) << "Finished update check " << request_id; |
760 if (!request.callback.is_null()) | 765 if (!request.callback.is_null()) |
761 request.callback.Run(); | 766 request.callback.Run(); |
762 requests_in_progress_.erase(request_id); | 767 requests_in_progress_.erase(request_id); |
763 } | 768 } |
764 } | 769 } |
765 | 770 |
766 } // namespace extensions | 771 } // namespace extensions |
OLD | NEW |