Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Side by Side Diff: base/threading/thread.h

Issue 11293086: base: Constantify thread_name() getter accessor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | base/tracked_objects.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef BASE_THREADING_THREAD_H_ 5 #ifndef BASE_THREADING_THREAD_H_
6 #define BASE_THREADING_THREAD_H_ 6 #define BASE_THREADING_THREAD_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/base_export.h" 10 #include "base/base_export.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 // Returns a MessageLoopProxy for this thread. Use the MessageLoopProxy's 124 // Returns a MessageLoopProxy for this thread. Use the MessageLoopProxy's
125 // PostTask methods to execute code on the thread. This only returns 125 // PostTask methods to execute code on the thread. This only returns
126 // non-NULL after a successful call to Start. After Stop has been called, 126 // non-NULL after a successful call to Start. After Stop has been called,
127 // this will return NULL. Callers can hold on to this even after the thread 127 // this will return NULL. Callers can hold on to this even after the thread
128 // is gone. 128 // is gone.
129 scoped_refptr<MessageLoopProxy> message_loop_proxy() const { 129 scoped_refptr<MessageLoopProxy> message_loop_proxy() const {
130 return message_loop_ ? message_loop_->message_loop_proxy() : NULL; 130 return message_loop_ ? message_loop_->message_loop_proxy() : NULL;
131 } 131 }
132 132
133 // Returns the name of this thread (for display in debugger too). 133 // Returns the name of this thread (for display in debugger too).
134 const std::string &thread_name() { return name_; } 134 const std::string& thread_name() const { return name_; }
135 135
136 // The native thread handle. 136 // The native thread handle.
137 PlatformThreadHandle thread_handle() { return thread_; } 137 PlatformThreadHandle thread_handle() { return thread_; }
138 138
139 // The thread ID. 139 // The thread ID.
140 PlatformThreadId thread_id() const { return thread_id_; } 140 PlatformThreadId thread_id() const { return thread_id_; }
141 141
142 // Returns true if the thread has been started, and not yet stopped. 142 // Returns true if the thread has been started, and not yet stopped.
143 bool IsRunning() const; 143 bool IsRunning() const;
144 144
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 std::string name_; 204 std::string name_;
205 205
206 friend void ThreadQuitHelper(); 206 friend void ThreadQuitHelper();
207 207
208 DISALLOW_COPY_AND_ASSIGN(Thread); 208 DISALLOW_COPY_AND_ASSIGN(Thread);
209 }; 209 };
210 210
211 } // namespace base 211 } // namespace base
212 212
213 #endif // BASE_THREADING_THREAD_H_ 213 #endif // BASE_THREADING_THREAD_H_
OLDNEW
« no previous file with comments | « no previous file | base/tracked_objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698