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

Side by Side Diff: ios/web/web_thread_impl.cc

Issue 1406983008: [iOS] ios/web no longer depends on content::BrowserThread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 1 month 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 | « ios/web/web_thread_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ios/web/web_thread_impl.h" 5 #include "ios/web/web_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 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 490
491 WebThreadGlobals& globals = g_globals.Get(); 491 WebThreadGlobals& globals = g_globals.Get();
492 base::AutoLock lock(globals.lock); 492 base::AutoLock lock(globals.lock);
493 base::Thread* thread = globals.threads[identifier]; 493 base::Thread* thread = globals.threads[identifier];
494 DCHECK(thread); 494 DCHECK(thread);
495 base::MessageLoop* loop = thread->message_loop(); 495 base::MessageLoop* loop = thread->message_loop();
496 return loop; 496 return loop;
497 } 497 }
498 498
499 // static 499 // static
500 void WebThreadImpl::SetDelegate(ID identifier, WebThreadDelegate* delegate) { 500 void WebThread::SetDelegate(ID identifier, WebThreadDelegate* delegate) {
501 using base::subtle::AtomicWord; 501 using base::subtle::AtomicWord;
502 WebThreadGlobals& globals = g_globals.Get(); 502 WebThreadGlobals& globals = g_globals.Get();
503 AtomicWord* storage = 503 AtomicWord* storage =
504 reinterpret_cast<AtomicWord*>(&globals.thread_delegates[identifier]); 504 reinterpret_cast<AtomicWord*>(&globals.thread_delegates[identifier]);
505 AtomicWord old_pointer = base::subtle::NoBarrier_AtomicExchange( 505 AtomicWord old_pointer = base::subtle::NoBarrier_AtomicExchange(
506 storage, reinterpret_cast<AtomicWord>(delegate)); 506 storage, reinterpret_cast<AtomicWord>(delegate));
507 507
508 // This catches registration when previously registered. 508 // This catches registration when previously registered.
509 DCHECK(!delegate || !old_pointer); 509 DCHECK(!delegate || !old_pointer);
510 } 510 }
511 511
512 } // namespace web 512 } // namespace web
OLDNEW
« no previous file with comments | « ios/web/web_thread_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698