OLD | NEW |
---|---|
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 #include "content/browser/browser_thread_impl.h" | 5 #include "content/browser/browser_thread_impl.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/atomicops.h" | 9 #include "base/atomicops.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 11 matching lines...) Expand all Loading... | |
22 | 22 |
23 // Friendly names for the well-known threads. | 23 // Friendly names for the well-known threads. |
24 static const char* g_browser_thread_names[BrowserThread::ID_COUNT] = { | 24 static const char* g_browser_thread_names[BrowserThread::ID_COUNT] = { |
25 "", // UI (name assembled in browser_main.cc). | 25 "", // UI (name assembled in browser_main.cc). |
26 "Chrome_DBThread", // DB | 26 "Chrome_DBThread", // DB |
27 "Chrome_FileThread", // FILE | 27 "Chrome_FileThread", // FILE |
28 "Chrome_FileUserBlockingThread", // FILE_USER_BLOCKING | 28 "Chrome_FileUserBlockingThread", // FILE_USER_BLOCKING |
29 "Chrome_ProcessLauncherThread", // PROCESS_LAUNCHER | 29 "Chrome_ProcessLauncherThread", // PROCESS_LAUNCHER |
30 "Chrome_CacheThread", // CACHE | 30 "Chrome_CacheThread", // CACHE |
31 "Chrome_IOThread", // IO | 31 "Chrome_IOThread", // IO |
32 "Chrome_PowerProfilerThread", // POWER_PROFILER | |
pfeldman
2014/01/09 11:38:58
Why do you want a named thread for power profiler?
qsr
2014/01/17 11:50:14
You seem to jave defined the thread for the power
| |
32 }; | 33 }; |
33 | 34 |
34 struct BrowserThreadGlobals { | 35 struct BrowserThreadGlobals { |
35 BrowserThreadGlobals() | 36 BrowserThreadGlobals() |
36 : blocking_pool(new base::SequencedWorkerPool(3, "BrowserBlocking")) { | 37 : blocking_pool(new base::SequencedWorkerPool(3, "BrowserBlocking")) { |
37 memset(threads, 0, BrowserThread::ID_COUNT * sizeof(threads[0])); | 38 memset(threads, 0, BrowserThread::ID_COUNT * sizeof(threads[0])); |
38 memset(thread_delegates, 0, | 39 memset(thread_delegates, 0, |
39 BrowserThread::ID_COUNT * sizeof(thread_delegates[0])); | 40 BrowserThread::ID_COUNT * sizeof(thread_delegates[0])); |
40 } | 41 } |
41 | 42 |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
474 AtomicWord* storage = reinterpret_cast<AtomicWord*>( | 475 AtomicWord* storage = reinterpret_cast<AtomicWord*>( |
475 &globals.thread_delegates[identifier]); | 476 &globals.thread_delegates[identifier]); |
476 AtomicWord old_pointer = base::subtle::NoBarrier_AtomicExchange( | 477 AtomicWord old_pointer = base::subtle::NoBarrier_AtomicExchange( |
477 storage, reinterpret_cast<AtomicWord>(delegate)); | 478 storage, reinterpret_cast<AtomicWord>(delegate)); |
478 | 479 |
479 // This catches registration when previously registered. | 480 // This catches registration when previously registered. |
480 DCHECK(!delegate || !old_pointer); | 481 DCHECK(!delegate || !old_pointer); |
481 } | 482 } |
482 | 483 |
483 } // namespace content | 484 } // namespace content |
OLD | NEW |