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_MESSAGE_LOOP_H_ | 5 #ifndef BASE_MESSAGE_LOOP_H_ |
6 #define BASE_MESSAGE_LOOP_H_ | 6 #define BASE_MESSAGE_LOOP_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <queue> | 9 #include <queue> |
10 #include <string> | 10 #include <string> |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 // Returns the type passed to the constructor. | 265 // Returns the type passed to the constructor. |
266 Type type() const { return type_; } | 266 Type type() const { return type_; } |
267 | 267 |
268 // Optional call to connect the thread name with this loop. | 268 // Optional call to connect the thread name with this loop. |
269 void set_thread_name(const std::string& thread_name) { | 269 void set_thread_name(const std::string& thread_name) { |
270 DCHECK(thread_name_.empty()) << "Should not rename this thread!"; | 270 DCHECK(thread_name_.empty()) << "Should not rename this thread!"; |
271 thread_name_ = thread_name; | 271 thread_name_ = thread_name; |
272 } | 272 } |
273 const std::string& thread_name() const { return thread_name_; } | 273 const std::string& thread_name() const { return thread_name_; } |
274 | 274 |
275 // Gets the message loop proxy associated with this message loop proxy | 275 // Gets the message loop proxy associated with this message loop. |
276 scoped_refptr<base::MessageLoopProxy> message_loop_proxy() { | 276 scoped_refptr<base::MessageLoopProxy> message_loop_proxy() { |
277 return message_loop_proxy_.get(); | 277 return message_loop_proxy_.get(); |
278 } | 278 } |
279 | 279 |
280 // Enables or disables the recursive task processing. This happens in the case | 280 // Enables or disables the recursive task processing. This happens in the case |
281 // of recursive message loops. Some unwanted message loop may occurs when | 281 // of recursive message loops. Some unwanted message loop may occurs when |
282 // using common controls or printer functions. By default, recursive task | 282 // using common controls or printer functions. By default, recursive task |
283 // processing is disabled. | 283 // processing is disabled. |
284 // | 284 // |
285 // The specific case where tasks get queued is: | 285 // The specific case where tasks get queued is: |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
706 #endif // defined(OS_POSIX) | 706 #endif // defined(OS_POSIX) |
707 }; | 707 }; |
708 | 708 |
709 // Do not add any member variables to MessageLoopForIO! This is important b/c | 709 // Do not add any member variables to MessageLoopForIO! This is important b/c |
710 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra | 710 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra |
711 // data that you need should be stored on the MessageLoop's pump_ instance. | 711 // data that you need should be stored on the MessageLoop's pump_ instance. |
712 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO), | 712 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO), |
713 MessageLoopForIO_should_not_have_extra_member_variables); | 713 MessageLoopForIO_should_not_have_extra_member_variables); |
714 | 714 |
715 #endif // BASE_MESSAGE_LOOP_H_ | 715 #endif // BASE_MESSAGE_LOOP_H_ |
OLD | NEW |