OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "extensions/common/one_shot_event.h" | 5 #include "extensions/common/one_shot_event.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
11 #include "base/location.h" | 11 #include "base/location.h" |
12 #include "base/single_thread_task_runner.h" | 12 #include "base/single_thread_task_runner.h" |
13 #include "base/task_runner.h" | 13 #include "base/task_runner.h" |
14 #include "base/thread_task_runner_handle.h" | 14 #include "base/threading/thread_task_runner_handle.h" |
15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
16 | 16 |
17 using base::SingleThreadTaskRunner; | 17 using base::SingleThreadTaskRunner; |
18 | 18 |
19 namespace extensions { | 19 namespace extensions { |
20 | 20 |
21 struct OneShotEvent::TaskInfo { | 21 struct OneShotEvent::TaskInfo { |
22 TaskInfo() {} | 22 TaskInfo() {} |
23 TaskInfo(const tracked_objects::Location& from_here, | 23 TaskInfo(const tracked_objects::Location& from_here, |
24 const scoped_refptr<SingleThreadTaskRunner>& runner, | 24 const scoped_refptr<SingleThreadTaskRunner>& runner, |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 if (delay.is_zero()) | 93 if (delay.is_zero()) |
94 runner->PostTask(from_here, task); | 94 runner->PostTask(from_here, task); |
95 else | 95 else |
96 runner->PostDelayedTask(from_here, task, delay); | 96 runner->PostDelayedTask(from_here, task, delay); |
97 } else { | 97 } else { |
98 tasks_.push_back(TaskInfo(from_here, runner, task, delay)); | 98 tasks_.push_back(TaskInfo(from_here, runner, task, delay)); |
99 } | 99 } |
100 } | 100 } |
101 | 101 |
102 } // namespace extensions | 102 } // namespace extensions |
OLD | NEW |