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

Side by Side Diff: base/thread.h

Issue 198011: Enable database logging on history thread. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 months 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/thread.cc » ('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) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-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 #ifndef BASE_THREAD_H_ 5 #ifndef BASE_THREAD_H_
6 #define BASE_THREAD_H_ 6 #define BASE_THREAD_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 PlatformThreadId thread_id() const { return thread_id_; } 107 PlatformThreadId thread_id() const { return thread_id_; }
108 108
109 // Returns true if the thread has been started, and not yet stopped. 109 // Returns true if the thread has been started, and not yet stopped.
110 // When a thread is running, the thread_id_ is non-zero. 110 // When a thread is running, the thread_id_ is non-zero.
111 bool IsRunning() const { return thread_id_ != 0; } 111 bool IsRunning() const { return thread_id_ != 0; }
112 112
113 protected: 113 protected:
114 // Called just prior to starting the message loop 114 // Called just prior to starting the message loop
115 virtual void Init() {} 115 virtual void Init() {}
116 116
117 // Called to start the message loop
118 virtual void Run(MessageLoop* message_loop);
119
117 // Called just after the message loop ends 120 // Called just after the message loop ends
118 virtual void CleanUp() {} 121 virtual void CleanUp() {}
119 122
120 static void SetThreadWasQuitProperly(bool flag); 123 static void SetThreadWasQuitProperly(bool flag);
121 static bool GetThreadWasQuitProperly(); 124 static bool GetThreadWasQuitProperly();
122 125
123 void set_message_loop(MessageLoop* message_loop) { 126 void set_message_loop(MessageLoop* message_loop) {
124 message_loop_ = message_loop; 127 message_loop_ = message_loop;
125 } 128 }
126 129
(...skipping 23 matching lines...) Expand all
150 std::string name_; 153 std::string name_;
151 154
152 friend class ThreadQuitTask; 155 friend class ThreadQuitTask;
153 156
154 DISALLOW_COPY_AND_ASSIGN(Thread); 157 DISALLOW_COPY_AND_ASSIGN(Thread);
155 }; 158 };
156 159
157 } // namespace base 160 } // namespace base
158 161
159 #endif // BASE_THREAD_H_ 162 #endif // BASE_THREAD_H_
OLDNEW
« no previous file with comments | « no previous file | base/thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698