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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 } | 296 } |
297 #elif defined(OS_POSIX) | 297 #elif defined(OS_POSIX) |
298 base::MessagePumpLibevent* pump_libevent() { | 298 base::MessagePumpLibevent* pump_libevent() { |
299 return static_cast<base::MessagePumpLibevent*>(pump_.get()); | 299 return static_cast<base::MessagePumpLibevent*>(pump_.get()); |
300 } | 300 } |
301 #endif | 301 #endif |
302 | 302 |
303 // A function to encapsulate all the exception handling capability in the | 303 // A function to encapsulate all the exception handling capability in the |
304 // stacks around the running of a main message loop. It will run the message | 304 // stacks around the running of a main message loop. It will run the message |
305 // loop in a SEH try block or not depending on the set_SEH_restoration() | 305 // loop in a SEH try block or not depending on the set_SEH_restoration() |
306 // flag. | 306 // flag invoking respectively RunInternalInSEHFrame() or RunInternal(). |
307 void RunHandler(); | 307 void RunHandler(); |
308 | 308 |
| 309 #if defined(OS_WIN) |
| 310 __declspec(noinline) void RunInternalInSEHFrame(); |
| 311 #endif |
| 312 |
309 // A surrounding stack frame around the running of the message loop that | 313 // A surrounding stack frame around the running of the message loop that |
310 // supports all saving and restoring of state, as is needed for any/all (ugly) | 314 // supports all saving and restoring of state, as is needed for any/all (ugly) |
311 // recursive calls. | 315 // recursive calls. |
312 void RunInternal(); | 316 void RunInternal(); |
313 | 317 |
314 // Called to process any delayed non-nestable tasks. | 318 // Called to process any delayed non-nestable tasks. |
315 bool ProcessNextDelayedNonNestableTask(); | 319 bool ProcessNextDelayedNonNestableTask(); |
316 | 320 |
317 //---------------------------------------------------------------------------- | 321 //---------------------------------------------------------------------------- |
318 // Run a work_queue_ task or new_task, and delete it (if it was processed by | 322 // Run a work_queue_ task or new_task, and delete it (if it was processed by |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 #endif // defined(OS_POSIX) | 514 #endif // defined(OS_POSIX) |
511 }; | 515 }; |
512 | 516 |
513 // Do not add any member variables to MessageLoopForIO! This is important b/c | 517 // Do not add any member variables to MessageLoopForIO! This is important b/c |
514 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra | 518 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra |
515 // data that you need should be stored on the MessageLoop's pump_ instance. | 519 // data that you need should be stored on the MessageLoop's pump_ instance. |
516 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO), | 520 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO), |
517 MessageLoopForIO_should_not_have_extra_member_variables); | 521 MessageLoopForIO_should_not_have_extra_member_variables); |
518 | 522 |
519 #endif // BASE_MESSAGE_LOOP_H_ | 523 #endif // BASE_MESSAGE_LOOP_H_ |
OLD | NEW |