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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 } | 135 } |
136 | 136 |
137 //------------------------------------------------------------------------------ | 137 //------------------------------------------------------------------------------ |
138 | 138 |
139 MessageLoop::MessageLoop(Type type) | 139 MessageLoop::MessageLoop(Type type) |
140 : type_(type), | 140 : type_(type), |
141 nestable_tasks_allowed_(true), | 141 nestable_tasks_allowed_(true), |
142 exception_restoration_(false), | 142 exception_restoration_(false), |
143 message_histogram_(NULL), | 143 message_histogram_(NULL), |
144 run_loop_(NULL), | 144 run_loop_(NULL), |
145 #ifdef OS_WIN | 145 #if defined(OS_WIN) |
146 os_modal_loop_(false), | 146 os_modal_loop_(false), |
147 #endif // OS_WIN | 147 #endif // OS_WIN |
148 next_sequence_num_(0) { | 148 next_sequence_num_(0) { |
149 DCHECK(!current()) << "should only have one message loop per thread"; | 149 DCHECK(!current()) << "should only have one message loop per thread"; |
150 lazy_tls_ptr.Pointer()->Set(this); | 150 lazy_tls_ptr.Pointer()->Set(this); |
151 | 151 |
152 message_loop_proxy_ = new base::MessageLoopProxyImpl(); | 152 message_loop_proxy_ = new base::MessageLoopProxyImpl(); |
153 thread_task_runner_handle_.reset( | 153 thread_task_runner_handle_.reset( |
154 new base::ThreadTaskRunnerHandle(message_loop_proxy_)); | 154 new base::ThreadTaskRunnerHandle(message_loop_proxy_)); |
155 | 155 |
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
806 Watcher *delegate) { | 806 Watcher *delegate) { |
807 return pump_libevent()->WatchFileDescriptor( | 807 return pump_libevent()->WatchFileDescriptor( |
808 fd, | 808 fd, |
809 persistent, | 809 persistent, |
810 mode, | 810 mode, |
811 controller, | 811 controller, |
812 delegate); | 812 delegate); |
813 } | 813 } |
814 | 814 |
815 #endif | 815 #endif |
OLD | NEW |