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

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

Issue 8775014: Remove IOThread::message_loop(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head. Created 9 years 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 | Annotate | Revision Log
« no previous file with comments | « chrome/test/base/testing_browser_process.cc ('k') | content/public/browser/browser_thread.h » ('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) 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_impl.h" 5 #include "content/browser/browser_thread_impl.h"
6 6
7 #include "base/atomicops.h" 7 #include "base/atomicops.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 return proxy; 394 return proxy;
395 } 395 }
396 396
397 base::Thread* BrowserThread::UnsafeGetBrowserThread(ID identifier) { 397 base::Thread* BrowserThread::UnsafeGetBrowserThread(ID identifier) {
398 base::AutoLock lock(g_lock.Get()); 398 base::AutoLock lock(g_lock.Get());
399 base::Thread* thread = g_browser_threads[identifier]; 399 base::Thread* thread = g_browser_threads[identifier];
400 DCHECK(thread); 400 DCHECK(thread);
401 return thread; 401 return thread;
402 } 402 }
403 403
404 MessageLoop* BrowserThread::UnsafeGetMessageLoop(ID identifier) {
405 return UnsafeGetBrowserThread(identifier)->message_loop();
406 }
407
404 void BrowserThread::SetDelegate(ID identifier, 408 void BrowserThread::SetDelegate(ID identifier,
405 BrowserThreadDelegate* delegate) { 409 BrowserThreadDelegate* delegate) {
406 using base::subtle::AtomicWord; 410 using base::subtle::AtomicWord;
407 AtomicWord* storage = reinterpret_cast<AtomicWord*>( 411 AtomicWord* storage = reinterpret_cast<AtomicWord*>(
408 &g_browser_thread_delegates[identifier]); 412 &g_browser_thread_delegates[identifier]);
409 AtomicWord old_pointer = base::subtle::NoBarrier_AtomicExchange( 413 AtomicWord old_pointer = base::subtle::NoBarrier_AtomicExchange(
410 storage, reinterpret_cast<AtomicWord>(delegate)); 414 storage, reinterpret_cast<AtomicWord>(delegate));
411 415
412 // This catches registration when previously registered. 416 // This catches registration when previously registered.
413 DCHECK(!delegate || !old_pointer); 417 DCHECK(!delegate || !old_pointer);
414 } 418 }
415 419
416 } // namespace content 420 } // namespace content
OLDNEW
« no previous file with comments | « chrome/test/base/testing_browser_process.cc ('k') | content/public/browser/browser_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698