OLD | NEW |
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 #ifndef BASE_THREAD_H_ | 5 #ifndef BASE_THREAD_H_ |
6 #define BASE_THREAD_H_ | 6 #define BASE_THREAD_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 static bool GetThreadWasQuitProperly(); | 149 static bool GetThreadWasQuitProperly(); |
150 | 150 |
151 void set_message_loop(MessageLoop* message_loop) { | 151 void set_message_loop(MessageLoop* message_loop) { |
152 message_loop_ = message_loop; | 152 message_loop_ = message_loop; |
153 } | 153 } |
154 | 154 |
155 private: | 155 private: |
156 bool thread_was_started() const { return started_; } | 156 bool thread_was_started() const { return started_; } |
157 | 157 |
158 // PlatformThread::Delegate methods: | 158 // PlatformThread::Delegate methods: |
159 virtual void ThreadMain(); | 159 virtual void ThreadMain() OVERRIDE; |
160 | 160 |
161 // Whether we successfully started the thread. | 161 // Whether we successfully started the thread. |
162 bool started_; | 162 bool started_; |
163 | 163 |
164 // If true, we're in the middle of stopping, and shouldn't access | 164 // If true, we're in the middle of stopping, and shouldn't access |
165 // |message_loop_|. It may non-NULL and invalid. | 165 // |message_loop_|. It may non-NULL and invalid. |
166 bool stopping_; | 166 bool stopping_; |
167 | 167 |
168 // Used to pass data to ThreadMain. | 168 // Used to pass data to ThreadMain. |
169 struct StartupData; | 169 struct StartupData; |
(...skipping 13 matching lines...) Expand all Loading... |
183 std::string name_; | 183 std::string name_; |
184 | 184 |
185 friend class ThreadQuitTask; | 185 friend class ThreadQuitTask; |
186 | 186 |
187 DISALLOW_COPY_AND_ASSIGN(Thread); | 187 DISALLOW_COPY_AND_ASSIGN(Thread); |
188 }; | 188 }; |
189 | 189 |
190 } // namespace base | 190 } // namespace base |
191 | 191 |
192 #endif // BASE_THREAD_H_ | 192 #endif // BASE_THREAD_H_ |
OLD | NEW |