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 #ifndef BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ | 5 #ifndef BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ |
6 #define BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ | 6 #define BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <queue> | 9 #include <queue> |
10 #include <string> | 10 #include <string> |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 void PostTask(const tracked_objects::Location& from_here, | 182 void PostTask(const tracked_objects::Location& from_here, |
183 const Closure& task); | 183 const Closure& task); |
184 | 184 |
185 void PostDelayedTask(const tracked_objects::Location& from_here, | 185 void PostDelayedTask(const tracked_objects::Location& from_here, |
186 const Closure& task, | 186 const Closure& task, |
187 TimeDelta delay); | 187 TimeDelta delay); |
188 | 188 |
189 void PostNonNestableTask(const tracked_objects::Location& from_here, | 189 void PostNonNestableTask(const tracked_objects::Location& from_here, |
190 const Closure& task); | 190 const Closure& task); |
191 | 191 |
192 void PostNonNestableDelayedTask(const tracked_objects::Location& from_here, | |
193 const Closure& task, | |
194 TimeDelta delay); | |
195 | |
196 // A variant on PostTask that deletes the given object. This is useful | 192 // A variant on PostTask that deletes the given object. This is useful |
197 // if the object needs to live until the next run of the MessageLoop (for | 193 // if the object needs to live until the next run of the MessageLoop (for |
198 // example, deleting a RenderProcessHost from within an IPC callback is not | 194 // example, deleting a RenderProcessHost from within an IPC callback is not |
199 // good). | 195 // good). |
200 // | 196 // |
201 // NOTE: This method may be called on any thread. The object will be deleted | 197 // NOTE: This method may be called on any thread. The object will be deleted |
202 // on the thread that executes MessageLoop::Run(). | 198 // on the thread that executes MessageLoop::Run(). |
203 template <class T> | 199 template <class T> |
204 void DeleteSoon(const tracked_objects::Location& from_here, const T* object) { | 200 void DeleteSoon(const tracked_objects::Location& from_here, const T* object) { |
205 base::subtle::DeleteHelperInternal<T, void>::DeleteViaSequencedTaskRunner( | 201 base::subtle::DeleteHelperInternal<T, void>::DeleteViaSequencedTaskRunner( |
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
691 | 687 |
692 // Do not add any member variables to MessageLoopForIO! This is important b/c | 688 // Do not add any member variables to MessageLoopForIO! This is important b/c |
693 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra | 689 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra |
694 // data that you need should be stored on the MessageLoop's pump_ instance. | 690 // data that you need should be stored on the MessageLoop's pump_ instance. |
695 static_assert(sizeof(MessageLoop) == sizeof(MessageLoopForIO), | 691 static_assert(sizeof(MessageLoop) == sizeof(MessageLoopForIO), |
696 "MessageLoopForIO should not have extra member variables"); | 692 "MessageLoopForIO should not have extra member variables"); |
697 | 693 |
698 } // namespace base | 694 } // namespace base |
699 | 695 |
700 #endif // BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ | 696 #endif // BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ |
OLD | NEW |