| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/update_client/update_engine.h" | 5 #include "components/update_client/update_engine.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 return; | 93 return; |
| 94 } | 94 } |
| 95 | 95 |
| 96 scoped_ptr<UpdateContext> update_context(new UpdateContext( | 96 scoped_ptr<UpdateContext> update_context(new UpdateContext( |
| 97 config_, is_foreground, ids, crx_data_callback, | 97 config_, is_foreground, ids, crx_data_callback, |
| 98 notify_observers_callback_, callback, update_checker_factory_, | 98 notify_observers_callback_, callback, update_checker_factory_, |
| 99 crx_downloader_factory_, ping_manager_)); | 99 crx_downloader_factory_, ping_manager_)); |
| 100 | 100 |
| 101 CrxUpdateItem update_item; | 101 CrxUpdateItem update_item; |
| 102 scoped_ptr<ActionUpdateCheck> update_check_action(new ActionUpdateCheck( | 102 scoped_ptr<ActionUpdateCheck> update_check_action(new ActionUpdateCheck( |
| 103 (*update_context->update_checker_factory)(config_, *metadata_), | 103 (*update_context->update_checker_factory)(config_, metadata_.get()), |
| 104 config_->GetBrowserVersion(), config_->ExtraRequestParams())); | 104 config_->GetBrowserVersion(), config_->ExtraRequestParams())); |
| 105 | 105 |
| 106 update_context->current_action.reset(update_check_action.release()); | 106 update_context->current_action.reset(update_check_action.release()); |
| 107 update_contexts_.insert(update_context.get()); | 107 update_contexts_.insert(update_context.get()); |
| 108 | 108 |
| 109 update_context->current_action->Run( | 109 update_context->current_action->Run( |
| 110 update_context.get(), | 110 update_context.get(), |
| 111 base::Bind(&UpdateEngine::UpdateComplete, base::Unretained(this), | 111 base::Bind(&UpdateEngine::UpdateComplete, base::Unretained(this), |
| 112 update_context.get())); | 112 update_context.get())); |
| 113 | 113 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 144 | 144 |
| 145 const auto now(base::Time::Now()); | 145 const auto now(base::Time::Now()); |
| 146 | 146 |
| 147 // Throttle the calls in the interval (t - 1 day, t) to limit the effect of | 147 // Throttle the calls in the interval (t - 1 day, t) to limit the effect of |
| 148 // unset clocks or clock drift. | 148 // unset clocks or clock drift. |
| 149 return throttle_updates_until_ - base::TimeDelta::FromDays(1) < now && | 149 return throttle_updates_until_ - base::TimeDelta::FromDays(1) < now && |
| 150 now < throttle_updates_until_; | 150 now < throttle_updates_until_; |
| 151 } | 151 } |
| 152 | 152 |
| 153 } // namespace update_client | 153 } // namespace update_client |
| OLD | NEW |