| 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 |
| 744 //------------------------------------------------------------------------------ | 750 //------------------------------------------------------------------------------ |
| 745 // MessageLoop::AutoRunState | 751 // MessageLoop::AutoRunState |
| 746 | 752 |
| 747 MessageLoop::AutoRunState::AutoRunState(MessageLoop* loop) : loop_(loop) { | 753 MessageLoop::AutoRunState::AutoRunState(MessageLoop* loop) : loop_(loop) { |
| 748 // Make the loop reference us. | 754 // Make the loop reference us. |
| 749 previous_state_ = loop_->state_; | 755 previous_state_ = loop_->state_; |
| 750 if (previous_state_) { | 756 if (previous_state_) { |
| 751 run_depth = previous_state_->run_depth + 1; | 757 run_depth = previous_state_->run_depth + 1; |
| 752 } else { | 758 } else { |
| 753 run_depth = 1; | 759 run_depth = 1; |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 827 Watcher *delegate) { | 833 Watcher *delegate) { |
| 828 return pump_libevent()->WatchFileDescriptor( | 834 return pump_libevent()->WatchFileDescriptor( |
| 829 fd, | 835 fd, |
| 830 persistent, | 836 persistent, |
| 831 static_cast<base::MessagePumpLibevent::Mode>(mode), | 837 static_cast<base::MessagePumpLibevent::Mode>(mode), |
| 832 controller, | 838 controller, |
| 833 delegate); | 839 delegate); |
| 834 } | 840 } |
| 835 | 841 |
| 836 #endif | 842 #endif |
| OLD | NEW |