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.h> | 7 #include <string.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 } | 93 } |
94 | 94 |
95 scoped_refptr<base::SingleThreadTaskRunner> proxies[BrowserThread::ID_COUNT]; | 95 scoped_refptr<base::SingleThreadTaskRunner> proxies[BrowserThread::ID_COUNT]; |
96 }; | 96 }; |
97 | 97 |
98 base::LazyInstance<BrowserThreadTaskRunners>::Leaky g_task_runners = | 98 base::LazyInstance<BrowserThreadTaskRunners>::Leaky g_task_runners = |
99 LAZY_INSTANCE_INITIALIZER; | 99 LAZY_INSTANCE_INITIALIZER; |
100 | 100 |
101 struct BrowserThreadGlobals { | 101 struct BrowserThreadGlobals { |
102 BrowserThreadGlobals() | 102 BrowserThreadGlobals() |
103 : blocking_pool(new base::SequencedWorkerPool(3, "BrowserBlocking")) { | 103 : blocking_pool( |
| 104 new base::SequencedWorkerPool(3, |
| 105 "BrowserBlocking", |
| 106 base::TaskPriority::USER_VISIBLE)) { |
104 memset(threads, 0, BrowserThread::ID_COUNT * sizeof(threads[0])); | 107 memset(threads, 0, BrowserThread::ID_COUNT * sizeof(threads[0])); |
105 memset(thread_delegates, 0, | 108 memset(thread_delegates, 0, |
106 BrowserThread::ID_COUNT * sizeof(thread_delegates[0])); | 109 BrowserThread::ID_COUNT * sizeof(thread_delegates[0])); |
107 } | 110 } |
108 | 111 |
109 // This lock protects |threads|. Do not read or modify that array | 112 // This lock protects |threads|. Do not read or modify that array |
110 // without holding this lock. Do not block while holding this lock. | 113 // without holding this lock. Do not block while holding this lock. |
111 base::Lock lock; | 114 base::Lock lock; |
112 | 115 |
113 // This array is protected by |lock|. The threads are not owned by this | 116 // This array is protected by |lock|. The threads are not owned by this |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
548 AtomicWord* storage = reinterpret_cast<AtomicWord*>( | 551 AtomicWord* storage = reinterpret_cast<AtomicWord*>( |
549 &globals.thread_delegates[identifier]); | 552 &globals.thread_delegates[identifier]); |
550 AtomicWord old_pointer = base::subtle::NoBarrier_AtomicExchange( | 553 AtomicWord old_pointer = base::subtle::NoBarrier_AtomicExchange( |
551 storage, reinterpret_cast<AtomicWord>(delegate)); | 554 storage, reinterpret_cast<AtomicWord>(delegate)); |
552 | 555 |
553 // This catches registration when previously registered. | 556 // This catches registration when previously registered. |
554 DCHECK(!delegate || !old_pointer); | 557 DCHECK(!delegate || !old_pointer); |
555 } | 558 } |
556 | 559 |
557 } // namespace content | 560 } // namespace content |
OLD | NEW |