OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "base/message_loop.h" | 5 #include "base/message_loop.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
734 bool MessageLoop::DoIdleWork() { | 734 bool MessageLoop::DoIdleWork() { |
735 if (ProcessNextDelayedNonNestableTask()) | 735 if (ProcessNextDelayedNonNestableTask()) |
736 return true; | 736 return true; |
737 | 737 |
738 if (state_->quit_received) | 738 if (state_->quit_received) |
739 pump_->Quit(); | 739 pump_->Quit(); |
740 | 740 |
741 return false; | 741 return false; |
742 } | 742 } |
743 | 743 |
744 void MessageLoop::DeleteSoonInternal(const tracked_objects::Location& from_here, | |
745 void(*deleter)(const void*), | |
746 const void* object) { | |
747 PostNonNestableTask(from_here, base::Bind(deleter, object)); | |
748 } | |
749 | |
750 //------------------------------------------------------------------------------ | 744 //------------------------------------------------------------------------------ |
751 // MessageLoop::AutoRunState | 745 // MessageLoop::AutoRunState |
752 | 746 |
753 MessageLoop::AutoRunState::AutoRunState(MessageLoop* loop) : loop_(loop) { | 747 MessageLoop::AutoRunState::AutoRunState(MessageLoop* loop) : loop_(loop) { |
754 // Make the loop reference us. | 748 // Make the loop reference us. |
755 previous_state_ = loop_->state_; | 749 previous_state_ = loop_->state_; |
756 if (previous_state_) { | 750 if (previous_state_) { |
757 run_depth = previous_state_->run_depth + 1; | 751 run_depth = previous_state_->run_depth + 1; |
758 } else { | 752 } else { |
759 run_depth = 1; | 753 run_depth = 1; |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
833 Watcher *delegate) { | 827 Watcher *delegate) { |
834 return pump_libevent()->WatchFileDescriptor( | 828 return pump_libevent()->WatchFileDescriptor( |
835 fd, | 829 fd, |
836 persistent, | 830 persistent, |
837 static_cast<base::MessagePumpLibevent::Mode>(mode), | 831 static_cast<base::MessagePumpLibevent::Mode>(mode), |
838 controller, | 832 controller, |
839 delegate); | 833 delegate); |
840 } | 834 } |
841 | 835 |
842 #endif | 836 #endif |
OLD | NEW |