| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/chrome_thread.h" | 5 #include "chrome/browser/chrome_thread.h" |
| 6 | 6 |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/message_loop_proxy.h" | 8 #include "base/message_loop_proxy.h" |
| 9 | 9 |
| 10 // Friendly names for the well-known threads. | 10 // Friendly names for the well-known threads. |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 return ChromeThread::PostNonNestableTask(id_, from_here, task); | 44 return ChromeThread::PostNonNestableTask(id_, from_here, task); |
| 45 } | 45 } |
| 46 | 46 |
| 47 virtual bool PostNonNestableDelayedTask( | 47 virtual bool PostNonNestableDelayedTask( |
| 48 const tracked_objects::Location& from_here, | 48 const tracked_objects::Location& from_here, |
| 49 Task* task, | 49 Task* task, |
| 50 int64 delay_ms) { | 50 int64 delay_ms) { |
| 51 return ChromeThread::PostNonNestableDelayedTask(id_, from_here, task, | 51 return ChromeThread::PostNonNestableDelayedTask(id_, from_here, task, |
| 52 delay_ms); | 52 delay_ms); |
| 53 } | 53 } |
| 54 virtual bool BelongsToCurrentThread() { |
| 55 return ChromeThread::CurrentlyOn(id_); |
| 56 } |
| 54 | 57 |
| 55 private: | 58 private: |
| 56 ChromeThread::ID id_; | 59 ChromeThread::ID id_; |
| 57 DISALLOW_COPY_AND_ASSIGN(ChromeThreadMessageLoopProxy); | 60 DISALLOW_COPY_AND_ASSIGN(ChromeThreadMessageLoopProxy); |
| 58 }; | 61 }; |
| 59 | 62 |
| 60 | 63 |
| 61 Lock ChromeThread::lock_; | 64 Lock ChromeThread::lock_; |
| 62 | 65 |
| 63 ChromeThread* ChromeThread::chrome_threads_[ID_COUNT]; | 66 ChromeThread* ChromeThread::chrome_threads_[ID_COUNT]; |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 } | 203 } |
| 201 } else { | 204 } else { |
| 202 delete task; | 205 delete task; |
| 203 } | 206 } |
| 204 | 207 |
| 205 if (!guaranteed_to_outlive_target_thread) | 208 if (!guaranteed_to_outlive_target_thread) |
| 206 lock_.Release(); | 209 lock_.Release(); |
| 207 | 210 |
| 208 return !!message_loop; | 211 return !!message_loop; |
| 209 } | 212 } |
| OLD | NEW |