Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: base/message_loop.cc

Issue 9004051: Replace MessageLoop::DeleteSoon implementation with one that uses base::Bind. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Final Created 8 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/message_loop.h ('k') | base/message_loop_helpers.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « base/message_loop.h ('k') | base/message_loop_helpers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698