| OLD | NEW | 
|    1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |    1 // Copyright (c) 2012 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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  315  |  315  | 
|  316 void MessageLoop::QuitNow() { |  316 void MessageLoop::QuitNow() { | 
|  317   DCHECK_EQ(this, current()); |  317   DCHECK_EQ(this, current()); | 
|  318   if (run_loop_) { |  318   if (run_loop_) { | 
|  319     pump_->Quit(); |  319     pump_->Quit(); | 
|  320   } else { |  320   } else { | 
|  321     NOTREACHED() << "Must be inside Run to call Quit"; |  321     NOTREACHED() << "Must be inside Run to call Quit"; | 
|  322   } |  322   } | 
|  323 } |  323 } | 
|  324  |  324  | 
 |  325 bool MessageLoop::IsType(Type type) const { | 
 |  326   return type_ == type; | 
 |  327 } | 
 |  328  | 
|  325 static void QuitCurrentWhenIdle() { |  329 static void QuitCurrentWhenIdle() { | 
|  326   MessageLoop::current()->QuitWhenIdle(); |  330   MessageLoop::current()->QuitWhenIdle(); | 
|  327 } |  331 } | 
|  328  |  332  | 
|  329 // static |  333 // static | 
|  330 base::Closure MessageLoop::QuitWhenIdleClosure() { |  334 base::Closure MessageLoop::QuitWhenIdleClosure() { | 
|  331   return base::Bind(&QuitCurrentWhenIdle); |  335   return base::Bind(&QuitCurrentWhenIdle); | 
|  332 } |  336 } | 
|  333  |  337  | 
|  334 void MessageLoop::SetNestableTasksAllowed(bool allowed) { |  338 void MessageLoop::SetNestableTasksAllowed(bool allowed) { | 
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  760                                            Watcher *delegate) { |  764                                            Watcher *delegate) { | 
|  761   return pump_libevent()->WatchFileDescriptor( |  765   return pump_libevent()->WatchFileDescriptor( | 
|  762       fd, |  766       fd, | 
|  763       persistent, |  767       persistent, | 
|  764       static_cast<base::MessagePumpLibevent::Mode>(mode), |  768       static_cast<base::MessagePumpLibevent::Mode>(mode), | 
|  765       controller, |  769       controller, | 
|  766       delegate); |  770       delegate); | 
|  767 } |  771 } | 
|  768  |  772  | 
|  769 #endif |  773 #endif | 
| OLD | NEW |