OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_H_ | 5 #ifndef BASE_MESSAGE_LOOP_H_ |
6 #define BASE_MESSAGE_LOOP_H_ | 6 #define BASE_MESSAGE_LOOP_H_ |
7 | 7 |
8 #include <queue> | 8 #include <queue> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 bool NestableTasksAllowed() const; | 224 bool NestableTasksAllowed() const; |
225 | 225 |
226 // Enables or disables the restoration during an exception of the unhandled | 226 // Enables or disables the restoration during an exception of the unhandled |
227 // exception filter that was active when Run() was called. This can happen | 227 // exception filter that was active when Run() was called. This can happen |
228 // if some third party code call SetUnhandledExceptionFilter() and never | 228 // if some third party code call SetUnhandledExceptionFilter() and never |
229 // restores the previous filter. | 229 // restores the previous filter. |
230 void set_exception_restoration(bool restore) { | 230 void set_exception_restoration(bool restore) { |
231 exception_restoration_ = restore; | 231 exception_restoration_ = restore; |
232 } | 232 } |
233 | 233 |
| 234 // Returns true if we are currently running a nested message loop. |
| 235 bool IsNested(); |
| 236 |
234 //---------------------------------------------------------------------------- | 237 //---------------------------------------------------------------------------- |
235 protected: | 238 protected: |
236 struct RunState { | 239 struct RunState { |
237 // Used to count how many Run() invocations are on the stack. | 240 // Used to count how many Run() invocations are on the stack. |
238 int run_depth; | 241 int run_depth; |
239 | 242 |
240 // Used to record that Quit() was called, or that we should quit the pump | 243 // Used to record that Quit() was called, or that we should quit the pump |
241 // once it becomes idle. | 244 // once it becomes idle. |
242 bool quit_received; | 245 bool quit_received; |
243 | 246 |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 #endif // defined(OS_POSIX) | 505 #endif // defined(OS_POSIX) |
503 }; | 506 }; |
504 | 507 |
505 // Do not add any member variables to MessageLoopForIO! This is important b/c | 508 // Do not add any member variables to MessageLoopForIO! This is important b/c |
506 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra | 509 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra |
507 // data that you need should be stored on the MessageLoop's pump_ instance. | 510 // data that you need should be stored on the MessageLoop's pump_ instance. |
508 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO), | 511 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO), |
509 MessageLoopForIO_should_not_have_extra_member_variables); | 512 MessageLoopForIO_should_not_have_extra_member_variables); |
510 | 513 |
511 #endif // BASE_MESSAGE_LOOP_H_ | 514 #endif // BASE_MESSAGE_LOOP_H_ |
OLD | NEW |