| 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 900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 911 ScheduleNextCheck(TimeDelta::FromSeconds(frequency_seconds_)); | 911 ScheduleNextCheck(TimeDelta::FromSeconds(frequency_seconds_)); |
| 912 } | 912 } |
| 913 | 913 |
| 914 void ExtensionUpdater::CheckSoon() { | 914 void ExtensionUpdater::CheckSoon() { |
| 915 DCHECK(alive_); | 915 DCHECK(alive_); |
| 916 if (will_check_soon_) { | 916 if (will_check_soon_) { |
| 917 return; | 917 return; |
| 918 } | 918 } |
| 919 if (BrowserThread::PostTask( | 919 if (BrowserThread::PostTask( |
| 920 BrowserThread::UI, FROM_HERE, | 920 BrowserThread::UI, FROM_HERE, |
| 921 method_factory_.NewRunnableMethod(&ExtensionUpdater::CheckNow))) { | 921 method_factory_.NewRunnableMethod( |
| 922 &ExtensionUpdater::DoCheckSoon))) { |
| 922 will_check_soon_ = true; | 923 will_check_soon_ = true; |
| 923 } else { | 924 } else { |
| 924 NOTREACHED(); | 925 NOTREACHED(); |
| 925 } | 926 } |
| 926 } | 927 } |
| 927 | 928 |
| 928 bool ExtensionUpdater::WillCheckSoon() const { | 929 bool ExtensionUpdater::WillCheckSoon() const { |
| 929 return will_check_soon_; | 930 return will_check_soon_; |
| 930 } | 931 } |
| 931 | 932 |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1167 std::set<std::string>::const_iterator i; | 1168 std::set<std::string>::const_iterator i; |
| 1168 for (i = ids.begin(); i != ids.end(); ++i) | 1169 for (i = ids.begin(); i != ids.end(); ++i) |
| 1169 in_progress_ids_.insert(*i); | 1170 in_progress_ids_.insert(*i); |
| 1170 } | 1171 } |
| 1171 | 1172 |
| 1172 void ExtensionUpdater::RemoveFromInProgress(const std::set<std::string>& ids) { | 1173 void ExtensionUpdater::RemoveFromInProgress(const std::set<std::string>& ids) { |
| 1173 std::set<std::string>::const_iterator i; | 1174 std::set<std::string>::const_iterator i; |
| 1174 for (i = ids.begin(); i != ids.end(); ++i) | 1175 for (i = ids.begin(); i != ids.end(); ++i) |
| 1175 in_progress_ids_.erase(*i); | 1176 in_progress_ids_.erase(*i); |
| 1176 } | 1177 } |
| OLD | NEW |