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 // An implementation of WebThread in terms of base::MessageLoop and | 5 // An implementation of WebThread in terms of base::MessageLoop and |
6 // base::Thread | 6 // base::Thread |
7 | 7 |
8 #include "webkit/glue/webthread_impl.h" | 8 #include "webkit/glue/webthread_impl.h" |
9 | 9 |
10 #include "base/task.h" | 10 #include "base/task.h" |
(...skipping 28 matching lines...) Expand all Loading... | |
39 Task* task, int64 delay_ms) { | 39 Task* task, int64 delay_ms) { |
40 #endif | 40 #endif |
41 thread_->message_loop()->PostDelayedTask( | 41 thread_->message_loop()->PostDelayedTask( |
42 FROM_HERE, new TaskAdapter(task), delay_ms); | 42 FROM_HERE, new TaskAdapter(task), delay_ms); |
43 } | 43 } |
44 | 44 |
45 WebThreadImpl::~WebThreadImpl() { | 45 WebThreadImpl::~WebThreadImpl() { |
46 thread_->Stop(); | 46 thread_->Stop(); |
47 } | 47 } |
48 | 48 |
49 WebThreadImplForMessageLoop::WebThreadImplForMessageLoop( | |
50 base::MessageLoopProxy* message_loop) | |
51 : message_loop_(message_loop) { | |
49 } | 52 } |
53 | |
54 void WebThreadImplForMessageLoop::postTask(Task* task) { | |
55 message_loop_->PostTask(FROM_HERE, new TaskAdapter(task)); | |
56 } | |
57 | |
58 #ifdef WEBTHREAD_HAS_LONGLONG_CHANGE | |
darin (slow to review)
2011/10/12 04:42:20
i think this #ifdef was just a temporary guard to
piman
2011/10/12 19:53:52
Done. I removed it from existing code in this file
| |
59 void WebThreadImplForMessageLoop::postDelayedTask( | |
60 Task* task, long long delay_ms) { | |
61 #else | |
62 void WebThreadImplForMessageLoop::postDelayedTask( | |
63 Task* task, int64 delay_ms) { | |
64 #endif | |
65 message_loop_->PostDelayedTask(FROM_HERE, new TaskAdapter(task), delay_ms); | |
66 } | |
67 | |
68 WebThreadImplForMessageLoop::~WebThreadImplForMessageLoop() { | |
69 } | |
70 | |
71 } | |
OLD | NEW |