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 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 | 392 |
393 bool ExtensionUpdater::WillCheckSoon() const { | 393 bool ExtensionUpdater::WillCheckSoon() const { |
394 return will_check_soon_; | 394 return will_check_soon_; |
395 } | 395 } |
396 | 396 |
397 void ExtensionUpdater::SetExtensionCacheForTesting( | 397 void ExtensionUpdater::SetExtensionCacheForTesting( |
398 ExtensionCache* extension_cache) { | 398 ExtensionCache* extension_cache) { |
399 extension_cache_ = extension_cache; | 399 extension_cache_ = extension_cache; |
400 } | 400 } |
401 | 401 |
| 402 void ExtensionUpdater::StopTimerForTesting() { |
| 403 timer_.Stop(); |
| 404 } |
| 405 |
402 void ExtensionUpdater::DoCheckSoon() { | 406 void ExtensionUpdater::DoCheckSoon() { |
403 DCHECK(will_check_soon_); | 407 DCHECK(will_check_soon_); |
404 CheckNow(default_params_); | 408 CheckNow(default_params_); |
405 will_check_soon_ = false; | 409 will_check_soon_ = false; |
406 } | 410 } |
407 | 411 |
408 void ExtensionUpdater::AddToDownloader( | 412 void ExtensionUpdater::AddToDownloader( |
409 const ExtensionSet* extensions, | 413 const ExtensionSet* extensions, |
410 const std::list<std::string>& pending_ids, | 414 const std::list<std::string>& pending_ids, |
411 int request_id) { | 415 int request_id) { |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
763 const InProgressCheck& request = requests_in_progress_[request_id]; | 767 const InProgressCheck& request = requests_in_progress_[request_id]; |
764 if (request.in_progress_ids_.empty()) { | 768 if (request.in_progress_ids_.empty()) { |
765 VLOG(2) << "Finished update check " << request_id; | 769 VLOG(2) << "Finished update check " << request_id; |
766 if (!request.callback.is_null()) | 770 if (!request.callback.is_null()) |
767 request.callback.Run(); | 771 request.callback.Run(); |
768 requests_in_progress_.erase(request_id); | 772 requests_in_progress_.erase(request_id); |
769 } | 773 } |
770 } | 774 } |
771 | 775 |
772 } // namespace extensions | 776 } // namespace extensions |
OLD | NEW |