Index: base/message_loop/message_pump_mac.mm |
diff --git a/base/message_loop/message_pump_mac.mm b/base/message_loop/message_pump_mac.mm |
index 914977b13d59355e1dd566a6453ea4ae4eb69c78..53e3363da572c40c1e562bbb72ddbaa49fce9489 100644 |
--- a/base/message_loop/message_pump_mac.mm |
+++ b/base/message_loop/message_pump_mac.mm |
@@ -10,6 +10,7 @@ |
#include <limits> |
#include "base/logging.h" |
+#include "base/mac/call_with_eh_frame.h" |
#include "base/mac/scoped_cftyperef.h" |
#include "base/message_loop/timer_slack.h" |
#include "base/run_loop.h" |
@@ -300,7 +301,9 @@ void MessagePumpCFRunLoopBase::RunDelayedWorkTimer(CFRunLoopTimerRef timer, |
// static |
void MessagePumpCFRunLoopBase::RunWorkSource(void* info) { |
MessagePumpCFRunLoopBase* self = static_cast<MessagePumpCFRunLoopBase*>(info); |
- self->RunWork(); |
+ base::mac::CallWithEHFrame(^{ |
+ self->RunWork(); |
+ }); |
} |
// Called by MessagePumpCFRunLoopBase::RunWorkSource. |
@@ -359,7 +362,9 @@ bool MessagePumpCFRunLoopBase::RunWork() { |
// static |
void MessagePumpCFRunLoopBase::RunIdleWorkSource(void* info) { |
MessagePumpCFRunLoopBase* self = static_cast<MessagePumpCFRunLoopBase*>(info); |
- self->RunIdleWork(); |
+ base::mac::CallWithEHFrame(^{ |
+ self->RunIdleWork(); |
+ }); |
} |
// Called by MessagePumpCFRunLoopBase::RunIdleWorkSource. |
@@ -393,7 +398,9 @@ bool MessagePumpCFRunLoopBase::RunIdleWork() { |
// static |
void MessagePumpCFRunLoopBase::RunNestingDeferredWorkSource(void* info) { |
MessagePumpCFRunLoopBase* self = static_cast<MessagePumpCFRunLoopBase*>(info); |
- self->RunNestingDeferredWork(); |
+ base::mac::CallWithEHFrame(^{ |
+ self->RunNestingDeferredWork(); |
+ }); |
} |
// Called by MessagePumpCFRunLoopBase::RunNestingDeferredWorkSource. |
@@ -440,15 +447,16 @@ void MessagePumpCFRunLoopBase::PreWaitObserver(CFRunLoopObserverRef observer, |
CFRunLoopActivity activity, |
void* info) { |
MessagePumpCFRunLoopBase* self = static_cast<MessagePumpCFRunLoopBase*>(info); |
- |
- // Attempt to do some idle work before going to sleep. |
- self->RunIdleWork(); |
- |
- // The run loop is about to go to sleep. If any of the work done since it |
- // started or woke up resulted in a nested run loop running, |
- // nesting-deferred work may have accumulated. Schedule it for processing |
- // if appropriate. |
- self->MaybeScheduleNestingDeferredWork(); |
+ base::mac::CallWithEHFrame(^{ |
+ // Attempt to do some idle work before going to sleep. |
+ self->RunIdleWork(); |
+ |
+ // The run loop is about to go to sleep. If any of the work done since it |
+ // started or woke up resulted in a nested run loop running, |
+ // nesting-deferred work may have accumulated. Schedule it for processing |
+ // if appropriate. |
+ self->MaybeScheduleNestingDeferredWork(); |
+ }); |
} |
// Called from the run loop. |
@@ -463,7 +471,9 @@ void MessagePumpCFRunLoopBase::PreSourceObserver(CFRunLoopObserverRef observer, |
// level did not sleep or exit, nesting-deferred work may have accumulated |
// if a nested loop ran. Schedule nesting-deferred work for processing if |
// appropriate. |
- self->MaybeScheduleNestingDeferredWork(); |
+ base::mac::CallWithEHFrame(^{ |
+ self->MaybeScheduleNestingDeferredWork(); |
+ }); |
} |
// Called from the run loop. |
@@ -498,7 +508,9 @@ void MessagePumpCFRunLoopBase::EnterExitObserver(CFRunLoopObserverRef observer, |
// to sleep or exiting. It must be called before decrementing the |
// value so that the value still corresponds to the level of the exiting |
// loop. |
- self->MaybeScheduleNestingDeferredWork(); |
+ base::mac::CallWithEHFrame(^{ |
+ self->MaybeScheduleNestingDeferredWork(); |
+ }); |
--self->nesting_level_; |
break; |
@@ -506,7 +518,9 @@ void MessagePumpCFRunLoopBase::EnterExitObserver(CFRunLoopObserverRef observer, |
break; |
} |
- self->EnterExitRunLoop(activity); |
+ base::mac::CallWithEHFrame(^{ |
+ self->EnterExitRunLoop(activity); |
+ }); |
} |
// Called by MessagePumpCFRunLoopBase::EnterExitRunLoop. The default |