Index: webkit/plugins/ppapi/ppb_flash_message_loop_impl.cc |
diff --git a/webkit/plugins/ppapi/ppb_flash_message_loop_impl.cc b/webkit/plugins/ppapi/ppb_flash_message_loop_impl.cc |
index 8a3ff48129c11e37000d186d59a3a114874c0c27..647e1a84943697f45737d7804801f2a883e49bd4 100644 |
--- a/webkit/plugins/ppapi/ppb_flash_message_loop_impl.cc |
+++ b/webkit/plugins/ppapi/ppb_flash_message_loop_impl.cc |
@@ -87,14 +87,12 @@ int32_t PPB_Flash_MessageLoop_Impl::InternalRun( |
// It is possible that the PPB_Flash_MessageLoop_Impl object has been |
// destroyed when the nested message loop exits. |
scoped_refptr<State> state_protector(state_); |
- |
- bool old_value = MessageLoop::current()->NestableTasksAllowed(); |
- MessageLoop::current()->SetNestableTasksAllowed(true); |
- MessageLoop::current()->Run(); |
- |
+ { |
+ MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current()); |
+ MessageLoop::current()->Run(); |
+ } |
// Don't access data members of the class below. |
- MessageLoop::current()->SetNestableTasksAllowed(old_value); |
return state_protector->result(); |
} |