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/policy/logging_work_scheduler.h" | 5 #include "chrome/browser/policy/logging_work_scheduler.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
11 #include "content/public/browser/browser_thread.h" | 11 #include "content/public/browser/browser_thread.h" |
12 | 12 |
| 13 using content::BrowserThread; |
| 14 |
13 namespace policy { | 15 namespace policy { |
14 | 16 |
15 // Objects of this class are used in the priority-queue of future tasks | 17 // Objects of this class are used in the priority-queue of future tasks |
16 // in EventLogger. | 18 // in EventLogger. |
17 class EventLogger::Task { | 19 class EventLogger::Task { |
18 public: | 20 public: |
19 Task(); | 21 Task(); |
20 Task(int64 trigger_time, | 22 Task(int64 trigger_time, |
21 int64 secondary_key, | 23 int64 secondary_key, |
22 linked_ptr<base::Closure> callback); | 24 linked_ptr<base::Closure> callback); |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 logger_->PostDelayedWork(callback_, delay); | 181 logger_->PostDelayedWork(callback_, delay); |
180 } | 182 } |
181 | 183 |
182 void LoggingWorkScheduler::CancelDelayedWork() { | 184 void LoggingWorkScheduler::CancelDelayedWork() { |
183 if (!callback_.get()) return; | 185 if (!callback_.get()) return; |
184 callback_->Reset(); // Erase the callback to the delayed work. | 186 callback_->Reset(); // Erase the callback to the delayed work. |
185 callback_.reset(NULL); // Erase the pointer to the callback. | 187 callback_.reset(NULL); // Erase the pointer to the callback. |
186 } | 188 } |
187 | 189 |
188 } // namespace policy | 190 } // namespace policy |
OLD | NEW |