| 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/compiler_specific.h" | 9 #include "base/message_loop.h" |
| 10 #include "content/browser/browser_thread.h" | 10 #include "content/browser/browser_thread.h" |
| 11 | 11 |
| 12 namespace policy { | 12 namespace policy { |
| 13 | 13 |
| 14 // Objects of this class are used in the priority-queue of future tasks | 14 // Objects of this class are used in the priority-queue of future tasks |
| 15 // in EventLogger. | 15 // in EventLogger. |
| 16 class EventLogger::Task { | 16 class EventLogger::Task { |
| 17 public: | 17 public: |
| 18 Task(); | 18 Task(); |
| 19 Task(int64 trigger_time, | 19 Task(int64 trigger_time, |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 logger_->PostDelayedWork(callback_, delay); | 174 logger_->PostDelayedWork(callback_, delay); |
| 175 } | 175 } |
| 176 | 176 |
| 177 void LoggingWorkScheduler::CancelDelayedWork() { | 177 void LoggingWorkScheduler::CancelDelayedWork() { |
| 178 if (!callback_.get()) return; | 178 if (!callback_.get()) return; |
| 179 callback_->Reset(); // Erase the callback to the delayed work. | 179 callback_->Reset(); // Erase the callback to the delayed work. |
| 180 callback_.reset(NULL); // Erase the pointer to the callback. | 180 callback_.reset(NULL); // Erase the pointer to the callback. |
| 181 } | 181 } |
| 182 | 182 |
| 183 } // namespace policy | 183 } // namespace policy |
| OLD | NEW |