| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 CHROME_BROWSER_CHROME_THREAD_H__ | 5 #ifndef CHROME_BROWSER_CHROME_THREAD_H__ |
| 6 #define CHROME_BROWSER_CHROME_THREAD_H__ | 6 #define CHROME_BROWSER_CHROME_THREAD_H__ |
| 7 | 7 |
| 8 #include "base/lock.h" | 8 #include "base/lock.h" |
| 9 #include "base/thread.h" | 9 #include "base/thread.h" |
| 10 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 enum ID { | 31 enum ID { |
| 32 // This is the thread that processes IPC and network messages. | 32 // This is the thread that processes IPC and network messages. |
| 33 IO, | 33 IO, |
| 34 | 34 |
| 35 // This is the thread that interacts with the file system. | 35 // This is the thread that interacts with the file system. |
| 36 FILE, | 36 FILE, |
| 37 | 37 |
| 38 // This is the thread that interacts with the database. | 38 // This is the thread that interacts with the database. |
| 39 DB, | 39 DB, |
| 40 | 40 |
| 41 // This is the thread that interacts with the history database. |
| 42 HISTORY, |
| 43 |
| 44 #if defined(OS_LINUX) |
| 45 // This thread has a second connection to the X server and is used to |
| 46 // process UI requests when routing the request to the UI thread would risk |
| 47 // deadlock. |
| 48 BACKGROUND_X11, |
| 49 #endif |
| 50 |
| 41 // This identifier does not represent a thread. Instead it counts the | 51 // This identifier does not represent a thread. Instead it counts the |
| 42 // number of well-known threads. Insert new well-known threads before this | 52 // number of well-known threads. Insert new well-known threads before this |
| 43 // identifier. | 53 // identifier. |
| 44 ID_COUNT | 54 ID_COUNT |
| 45 }; | 55 }; |
| 46 | 56 |
| 47 // Construct a ChromeThread with the supplied identifier. It is an error | 57 // Construct a ChromeThread with the supplied identifier. It is an error |
| 48 // to construct a ChromeThread that already exists. | 58 // to construct a ChromeThread that already exists. |
| 49 explicit ChromeThread(ID identifier); | 59 explicit ChromeThread(ID identifier); |
| 50 virtual ~ChromeThread(); | 60 virtual ~ChromeThread(); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 68 static Lock lock_; | 78 static Lock lock_; |
| 69 | 79 |
| 70 // An array of the ChromeThread objects. This array is protected by |lock_|. | 80 // An array of the ChromeThread objects. This array is protected by |lock_|. |
| 71 // The threads are not owned by this array. Typically, the threads are owned | 81 // The threads are not owned by this array. Typically, the threads are owned |
| 72 // on the UI thread by the g_browser_process object. ChromeThreads remove | 82 // on the UI thread by the g_browser_process object. ChromeThreads remove |
| 73 // themselves from this array upon destruction. | 83 // themselves from this array upon destruction. |
| 74 static ChromeThread* chrome_threads_[ID_COUNT]; | 84 static ChromeThread* chrome_threads_[ID_COUNT]; |
| 75 }; | 85 }; |
| 76 | 86 |
| 77 #endif // #ifndef CHROME_BROWSER_CHROME_THREAD_H__ | 87 #endif // #ifndef CHROME_BROWSER_CHROME_THREAD_H__ |
| OLD | NEW |