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/run_loop.h" | 5 #include "base/run_loop.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 | 8 |
9 namespace base { | 9 namespace base { |
10 | 10 |
11 RunLoop::RunLoop() | 11 RunLoop::RunLoop() |
12 : loop_(MessageLoop::current()), | 12 : loop_(MessageLoop::current()), |
13 weak_factory_(this), | 13 weak_factory_(this), |
14 previous_run_loop_(NULL), | 14 previous_run_loop_(NULL), |
15 run_depth_(0), | 15 run_depth_(0), |
16 run_called_(false), | 16 run_called_(false), |
17 quit_called_(false), | 17 quit_called_(false), |
18 running_(false), | 18 running_(false), |
19 quit_when_idle_received_(false) { | 19 quit_when_idle_received_(false) { |
20 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) | 20 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) && \ |
| 21 !defined(USE_GTK_MESSAGE_PUMP) |
21 dispatcher_ = NULL; | 22 dispatcher_ = NULL; |
22 #endif | 23 #endif |
23 } | 24 } |
24 | 25 |
25 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) | 26 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) && \ |
| 27 !defined(USE_GTK_MESSAGE_PUMP) |
26 RunLoop::RunLoop(MessageLoop::Dispatcher* dispatcher) | 28 RunLoop::RunLoop(MessageLoop::Dispatcher* dispatcher) |
27 : loop_(MessageLoop::current()), | 29 : loop_(MessageLoop::current()), |
28 weak_factory_(this), | 30 weak_factory_(this), |
29 previous_run_loop_(NULL), | 31 previous_run_loop_(NULL), |
30 dispatcher_(dispatcher), | 32 dispatcher_(dispatcher), |
31 run_depth_(0), | 33 run_depth_(0), |
32 run_called_(false), | 34 run_called_(false), |
33 quit_called_(false), | 35 quit_called_(false), |
34 running_(false), | 36 running_(false), |
35 quit_when_idle_received_(false) { | 37 quit_when_idle_received_(false) { |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 87 |
86 // Pop RunLoop stack: | 88 // Pop RunLoop stack: |
87 loop_->run_loop_ = previous_run_loop_; | 89 loop_->run_loop_ = previous_run_loop_; |
88 | 90 |
89 // Execute deferred QuitNow, if any: | 91 // Execute deferred QuitNow, if any: |
90 if (previous_run_loop_ && previous_run_loop_->quit_called_) | 92 if (previous_run_loop_ && previous_run_loop_->quit_called_) |
91 loop_->QuitNow(); | 93 loop_->QuitNow(); |
92 } | 94 } |
93 | 95 |
94 } // namespace base | 96 } // namespace base |
OLD | NEW |