summaryrefslogtreecommitdiffstats
path: root/base/message_loop.h
diff options
context:
space:
mode:
authorshess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-16 22:56:33 +0000
committershess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-16 22:56:33 +0000
commit18d6a8f3322db4c50ae4a1ebd9e95796f43ea013 (patch)
tree3226e6a9beee4c3106b5425fa24c798c0e3d24c5 /base/message_loop.h
parent2c3ac1f83b329f1175a0295f8d8e806dba592b2a (diff)
downloadchromium_src-18d6a8f3322db4c50ae4a1ebd9e95796f43ea013.zip
chromium_src-18d6a8f3322db4c50ae4a1ebd9e95796f43ea013.tar.gz
chromium_src-18d6a8f3322db4c50ae4a1ebd9e95796f43ea013.tar.bz2
[Mac] Pump nestable tasks while web popups are visible.
BUG=30147 TEST=Go to site with select control and flash animation, popping up control shouldn't pause the flash. See the bug for an example. Review URL: http://codereview.chromium.org/486042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34772 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/message_loop.h')
-rw-r--r--base/message_loop.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/base/message_loop.h b/base/message_loop.h
index e45adde..fe28179 100644
--- a/base/message_loop.h
+++ b/base/message_loop.h
@@ -223,6 +223,23 @@ class MessageLoop : public base::MessagePump::Delegate {
void SetNestableTasksAllowed(bool allowed);
bool NestableTasksAllowed() const;
+ // Enables nestable tasks on |loop| while in scope.
+ class ScopedNestableTaskAllower {
+ public:
+ explicit ScopedNestableTaskAllower(MessageLoop* loop)
+ : loop_(loop),
+ old_state_(loop_->NestableTasksAllowed()) {
+ loop_->SetNestableTasksAllowed(true);
+ }
+ ~ScopedNestableTaskAllower() {
+ loop_->SetNestableTasksAllowed(old_state_);
+ }
+
+ private:
+ MessageLoop* loop_;
+ bool old_state_;
+ };
+
// Enables or disables the restoration during an exception of the unhandled
// exception filter that was active when Run() was called. This can happen
// if some third party code call SetUnhandledExceptionFilter() and never