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

Side by Side Diff: content/browser/browser_thread_impl.cc

Issue 2135413003: Add |joinable| to Thread::Options (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ignore SetMessageLoop(nullptr) for now -- added TODO Created 4 years, 4 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
« no previous file with comments | « base/threading/thread_unittest.cc ('k') | ios/web/web_thread_impl.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) 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 // BrowserThread ID to be reinitialized. We explicitly clear the thread ID 145 // BrowserThread ID to be reinitialized. We explicitly clear the thread ID
146 // here so Start() can sanity check. 146 // here so Start() can sanity check.
147 BrowserThreadGlobals& globals = g_globals.Get(); 147 BrowserThreadGlobals& globals = g_globals.Get();
148 base::AutoLock lock(globals.lock); 148 base::AutoLock lock(globals.lock);
149 globals.thread_ids[identifier] = base::kInvalidThreadId; 149 globals.thread_ids[identifier] = base::kInvalidThreadId;
150 } 150 }
151 151
152 BrowserThreadImpl::BrowserThreadImpl(ID identifier, 152 BrowserThreadImpl::BrowserThreadImpl(ID identifier,
153 base::MessageLoop* message_loop) 153 base::MessageLoop* message_loop)
154 : Thread(GetThreadName(identifier)), identifier_(identifier) { 154 : Thread(GetThreadName(identifier)), identifier_(identifier) {
155 set_message_loop(message_loop); 155 SetMessageLoop(message_loop);
156 Initialize(); 156 Initialize();
157 157
158 // If constructed with an explicit message loop, this is a fake BrowserThread 158 // If constructed with an explicit message loop, this is a fake BrowserThread
159 // which runs on the current thread. 159 // which runs on the current thread.
160 BrowserThreadGlobals& globals = g_globals.Get(); 160 BrowserThreadGlobals& globals = g_globals.Get();
161 base::AutoLock lock(globals.lock); 161 base::AutoLock lock(globals.lock);
162 globals.thread_ids[identifier] = base::PlatformThread::CurrentId(); 162 globals.thread_ids[identifier] = base::PlatformThread::CurrentId();
163 } 163 }
164 164
165 // static 165 // static
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 AtomicWord* storage = reinterpret_cast<AtomicWord*>( 582 AtomicWord* storage = reinterpret_cast<AtomicWord*>(
583 &globals.thread_delegates[identifier]); 583 &globals.thread_delegates[identifier]);
584 AtomicWord old_pointer = base::subtle::NoBarrier_AtomicExchange( 584 AtomicWord old_pointer = base::subtle::NoBarrier_AtomicExchange(
585 storage, reinterpret_cast<AtomicWord>(delegate)); 585 storage, reinterpret_cast<AtomicWord>(delegate));
586 586
587 // This catches registration when previously registered. 587 // This catches registration when previously registered.
588 DCHECK(!delegate || !old_pointer); 588 DCHECK(!delegate || !old_pointer);
589 } 589 }
590 590
591 } // namespace content 591 } // namespace content
OLDNEW
« no previous file with comments | « base/threading/thread_unittest.cc ('k') | ios/web/web_thread_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698