OLD | NEW |
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.h" | 5 #include "content/browser/browser_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 #include "base/threading/thread_restrictions.h" | 9 #include "base/threading/thread_restrictions.h" |
10 | 10 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 return BrowserThread::PostNonNestableTask(id_, from_here, task); | 46 return BrowserThread::PostNonNestableTask(id_, from_here, task); |
47 } | 47 } |
48 | 48 |
49 virtual bool PostNonNestableDelayedTask( | 49 virtual bool PostNonNestableDelayedTask( |
50 const tracked_objects::Location& from_here, | 50 const tracked_objects::Location& from_here, |
51 Task* task, | 51 Task* task, |
52 int64 delay_ms) { | 52 int64 delay_ms) { |
53 return BrowserThread::PostNonNestableDelayedTask(id_, from_here, task, | 53 return BrowserThread::PostNonNestableDelayedTask(id_, from_here, task, |
54 delay_ms); | 54 delay_ms); |
55 } | 55 } |
| 56 |
| 57 virtual bool PostTask(const tracked_objects::Location& from_here, |
| 58 const base::Closure& task) { |
| 59 return BrowserThread::PostTask(id_, from_here, task); |
| 60 } |
| 61 |
| 62 virtual bool PostDelayedTask(const tracked_objects::Location& from_here, |
| 63 const base::Closure& task, int64 delay_ms) { |
| 64 return BrowserThread::PostDelayedTask(id_, from_here, task, delay_ms); |
| 65 } |
| 66 |
| 67 virtual bool PostNonNestableTask(const tracked_objects::Location& from_here, |
| 68 const base::Closure& task) { |
| 69 return BrowserThread::PostNonNestableTask(id_, from_here, task); |
| 70 } |
| 71 |
| 72 virtual bool PostNonNestableDelayedTask( |
| 73 const tracked_objects::Location& from_here, |
| 74 const base::Closure& task, |
| 75 int64 delay_ms) { |
| 76 return BrowserThread::PostNonNestableDelayedTask(id_, from_here, task, |
| 77 delay_ms); |
| 78 } |
| 79 |
56 virtual bool BelongsToCurrentThread() { | 80 virtual bool BelongsToCurrentThread() { |
57 return BrowserThread::CurrentlyOn(id_); | 81 return BrowserThread::CurrentlyOn(id_); |
58 } | 82 } |
59 | 83 |
60 private: | 84 private: |
61 BrowserThread::ID id_; | 85 BrowserThread::ID id_; |
62 DISALLOW_COPY_AND_ASSIGN(BrowserThreadMessageLoopProxy); | 86 DISALLOW_COPY_AND_ASSIGN(BrowserThreadMessageLoopProxy); |
63 }; | 87 }; |
64 | 88 |
65 | 89 |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 } else { | 319 } else { |
296 message_loop->PostNonNestableDelayedTask(from_here, task, delay_ms); | 320 message_loop->PostNonNestableDelayedTask(from_here, task, delay_ms); |
297 } | 321 } |
298 } | 322 } |
299 | 323 |
300 if (!guaranteed_to_outlive_target_thread) | 324 if (!guaranteed_to_outlive_target_thread) |
301 lock_.Release(); | 325 lock_.Release(); |
302 | 326 |
303 return !!message_loop; | 327 return !!message_loop; |
304 } | 328 } |
OLD | NEW |