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 #include "content/browser/browser_thread.h" | 5 #include "content/browser/browser_thread.h" |
6 | 6 |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "base/message_loop_proxy.h" | 8 #include "base/message_loop_proxy.h" |
9 #include "base/threading/thread_restrictions.h" | 9 #include "base/threading/thread_restrictions.h" |
10 | 10 |
11 // Friendly names for the well-known threads. | 11 // Friendly names for the well-known threads. |
12 static const char* browser_thread_names[BrowserThread::ID_COUNT] = { | 12 static const char* browser_thread_names[BrowserThread::ID_COUNT] = { |
13 "", // UI (name assembled in browser_main.cc). | 13 "", // UI (name assembled in browser_main.cc). |
14 "Chrome_DBThread", // DB | 14 "Chrome_DBThread", // DB |
15 "Chrome_WebKitThread", // WEBKIT | 15 "Chrome_WebKitThread", // WEBKIT |
16 "Chrome_FileThread", // FILE | 16 "Chrome_FileThread", // FILE |
17 "Chrome_ProcessLauncherThread", // PROCESS_LAUNCHER | 17 "Chrome_ProcessLauncherThread", // PROCESS_LAUNCHER |
18 "Chrome_CacheThread", // CACHE | 18 "Chrome_CacheThread", // CACHE |
19 "Chrome_IOThread", // IO | 19 "Chrome_IOThread", // IO |
20 "Chrome_GpuThread", // GPU | 20 "Chrome_GpuThread", // GPU |
21 #if defined(USE_X11) | 21 #if defined(USE_X11) |
22 "Chrome_Background_X11Thread", // BACKGROUND_X11 | 22 "Chrome_Background_X11Thread", // BACKGROUND_X11 |
23 #endif | 23 #endif |
| 24 #if defined(OS_CHROMEOS) |
| 25 "Chrome_WebproxyThread", // WEBPROXY |
| 26 #endif |
24 }; | 27 }; |
25 | 28 |
26 // An implementation of MessageLoopProxy to be used in conjunction | 29 // An implementation of MessageLoopProxy to be used in conjunction |
27 // with BrowserThread. | 30 // with BrowserThread. |
28 class BrowserThreadMessageLoopProxy : public base::MessageLoopProxy { | 31 class BrowserThreadMessageLoopProxy : public base::MessageLoopProxy { |
29 public: | 32 public: |
30 explicit BrowserThreadMessageLoopProxy(BrowserThread::ID identifier) | 33 explicit BrowserThreadMessageLoopProxy(BrowserThread::ID identifier) |
31 : id_(identifier) { | 34 : id_(identifier) { |
32 } | 35 } |
33 | 36 |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 } | 229 } |
227 | 230 |
228 if (!guaranteed_to_outlive_target_thread) | 231 if (!guaranteed_to_outlive_target_thread) |
229 lock_.Release(); | 232 lock_.Release(); |
230 | 233 |
231 if (!message_loop) | 234 if (!message_loop) |
232 delete task; | 235 delete task; |
233 | 236 |
234 return !!message_loop; | 237 return !!message_loop; |
235 } | 238 } |
OLD | NEW |