OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 } | 65 } |
66 | 66 |
67 #endif // defined(OS_WIN) | 67 #endif // defined(OS_WIN) |
68 | 68 |
69 //------------------------------------------------------------------------------ | 69 //------------------------------------------------------------------------------ |
70 | 70 |
71 // static | 71 // static |
72 MessageLoop* MessageLoop::current() { | 72 MessageLoop* MessageLoop::current() { |
73 // TODO(darin): sadly, we cannot enable this yet since people call us even | 73 // TODO(darin): sadly, we cannot enable this yet since people call us even |
74 // when they have no intention of using us. | 74 // when they have no intention of using us. |
75 //DCHECK(loop) << "Ouch, did you forget to initialize me?"; | 75 // DCHECK(loop) << "Ouch, did you forget to initialize me?"; |
76 return lazy_tls_ptr.Pointer()->Get(); | 76 return lazy_tls_ptr.Pointer()->Get(); |
77 } | 77 } |
78 | 78 |
79 MessageLoop::MessageLoop(Type type) | 79 MessageLoop::MessageLoop(Type type) |
80 : type_(type), | 80 : type_(type), |
81 nestable_tasks_allowed_(true), | 81 nestable_tasks_allowed_(true), |
82 exception_restoration_(false), | 82 exception_restoration_(false), |
83 state_(NULL), | 83 state_(NULL), |
84 next_sequence_num_(0) { | 84 next_sequence_num_(0) { |
85 DCHECK(!current()) << "should only have one message loop per thread"; | 85 DCHECK(!current()) << "should only have one message loop per thread"; |
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
626 Watcher *delegate) { | 626 Watcher *delegate) { |
627 return pump_libevent()->WatchFileDescriptor( | 627 return pump_libevent()->WatchFileDescriptor( |
628 fd, | 628 fd, |
629 persistent, | 629 persistent, |
630 static_cast<base::MessagePumpLibevent::Mode>(mode), | 630 static_cast<base::MessagePumpLibevent::Mode>(mode), |
631 controller, | 631 controller, |
632 delegate); | 632 delegate); |
633 } | 633 } |
634 | 634 |
635 #endif | 635 #endif |
OLD | NEW |