| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/safe_browsing/delayed_callback_runner.h" | 5 #include "chrome/browser/safe_browsing/incident_reporting/delayed_callback_runne
r.h" |
| 6 | 6 |
| 7 #include "base/location.h" | 7 #include "base/location.h" |
| 8 | 8 |
| 9 namespace safe_browsing { | 9 namespace safe_browsing { |
| 10 | 10 |
| 11 DelayedCallbackRunner::DelayedCallbackRunner( | 11 DelayedCallbackRunner::DelayedCallbackRunner( |
| 12 base::TimeDelta delay, | 12 base::TimeDelta delay, |
| 13 const scoped_refptr<base::TaskRunner>& task_runner) | 13 const scoped_refptr<base::TaskRunner>& task_runner) |
| 14 : task_runner_(task_runner), | 14 : task_runner_(task_runner), |
| 15 next_callback_(callbacks_.end()), | 15 next_callback_(callbacks_.end()), |
| (...skipping 26 matching lines...) Expand all Loading... |
| 42 // Run the next callback on the task runner. | 42 // Run the next callback on the task runner. |
| 43 task_runner_->PostTask(FROM_HERE, *next_callback_); | 43 task_runner_->PostTask(FROM_HERE, *next_callback_); |
| 44 | 44 |
| 45 // Remove this callback and get ready for the next if there is one. | 45 // Remove this callback and get ready for the next if there is one. |
| 46 next_callback_ = callbacks_.erase(next_callback_); | 46 next_callback_ = callbacks_.erase(next_callback_); |
| 47 if (next_callback_ != callbacks_.end()) | 47 if (next_callback_ != callbacks_.end()) |
| 48 timer_.Reset(); | 48 timer_.Reset(); |
| 49 } | 49 } |
| 50 | 50 |
| 51 } // namespace safe_browsing | 51 } // namespace safe_browsing |
| OLD | NEW |