| 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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 const base::Closure& task, | 207 const base::Closure& task, |
| 208 base::TimeDelta delay) OVERRIDE { | 208 base::TimeDelta delay) OVERRIDE { |
| 209 return BrowserThread::PostNonNestableDelayedTask(id_, from_here, task, | 209 return BrowserThread::PostNonNestableDelayedTask(id_, from_here, task, |
| 210 delay); | 210 delay); |
| 211 } | 211 } |
| 212 | 212 |
| 213 virtual bool RunsTasksOnCurrentThread() const OVERRIDE { | 213 virtual bool RunsTasksOnCurrentThread() const OVERRIDE { |
| 214 return BrowserThread::CurrentlyOn(id_); | 214 return BrowserThread::CurrentlyOn(id_); |
| 215 } | 215 } |
| 216 | 216 |
| 217 protected: |
| 218 virtual ~BrowserThreadMessageLoopProxy() {} |
| 219 |
| 217 private: | 220 private: |
| 218 BrowserThread::ID id_; | 221 BrowserThread::ID id_; |
| 219 DISALLOW_COPY_AND_ASSIGN(BrowserThreadMessageLoopProxy); | 222 DISALLOW_COPY_AND_ASSIGN(BrowserThreadMessageLoopProxy); |
| 220 }; | 223 }; |
| 221 | 224 |
| 222 // static | 225 // static |
| 223 bool BrowserThread::PostBlockingPoolTask( | 226 bool BrowserThread::PostBlockingPoolTask( |
| 224 const tracked_objects::Location& from_here, | 227 const tracked_objects::Location& from_here, |
| 225 const base::Closure& task) { | 228 const base::Closure& task) { |
| 226 return g_globals.Get().blocking_pool->PostWorkerTask(from_here, task); | 229 return g_globals.Get().blocking_pool->PostWorkerTask(from_here, task); |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 AtomicWord* storage = reinterpret_cast<AtomicWord*>( | 407 AtomicWord* storage = reinterpret_cast<AtomicWord*>( |
| 405 &globals.thread_delegates[identifier]); | 408 &globals.thread_delegates[identifier]); |
| 406 AtomicWord old_pointer = base::subtle::NoBarrier_AtomicExchange( | 409 AtomicWord old_pointer = base::subtle::NoBarrier_AtomicExchange( |
| 407 storage, reinterpret_cast<AtomicWord>(delegate)); | 410 storage, reinterpret_cast<AtomicWord>(delegate)); |
| 408 | 411 |
| 409 // This catches registration when previously registered. | 412 // This catches registration when previously registered. |
| 410 DCHECK(!delegate || !old_pointer); | 413 DCHECK(!delegate || !old_pointer); |
| 411 } | 414 } |
| 412 | 415 |
| 413 } // namespace content | 416 } // namespace content |
| OLD | NEW |