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 "ppapi/proxy/ppb_message_loop_proxy.h" | 5 #include "ppapi/proxy/ppb_message_loop_proxy.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 return false; // Can't be current if there's nothing in the slot. | 184 return false; // Can't be current if there's nothing in the slot. |
185 return static_cast<const void*>(tls_slot.Get()) == | 185 return static_cast<const void*>(tls_slot.Get()) == |
186 static_cast<const void*>(this); | 186 static_cast<const void*>(this); |
187 } | 187 } |
188 | 188 |
189 void MessageLoopResource::PostClosure( | 189 void MessageLoopResource::PostClosure( |
190 const tracked_objects::Location& from_here, | 190 const tracked_objects::Location& from_here, |
191 const base::Closure& closure, | 191 const base::Closure& closure, |
192 int64 delay_ms) { | 192 int64 delay_ms) { |
193 if (loop_.get()) { | 193 if (loop_.get()) { |
194 loop_->PostDelayedTask(from_here, closure, delay_ms); | 194 loop_->PostDelayedTask( |
| 195 from_here, closure, base::TimeDelta::FromMilliseconds(delay_ms)); |
195 } else { | 196 } else { |
196 TaskInfo info; | 197 TaskInfo info; |
197 info.from_here = FROM_HERE; | 198 info.from_here = FROM_HERE; |
198 info.closure = closure; | 199 info.closure = closure; |
199 info.delay_ms = delay_ms; | 200 info.delay_ms = delay_ms; |
200 pending_tasks_.push_back(info); | 201 pending_tasks_.push_back(info); |
201 } | 202 } |
202 } | 203 } |
203 | 204 |
204 // static | 205 // static |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 PPB_MessageLoop_Proxy::~PPB_MessageLoop_Proxy() { | 279 PPB_MessageLoop_Proxy::~PPB_MessageLoop_Proxy() { |
279 } | 280 } |
280 | 281 |
281 // static | 282 // static |
282 const PPB_MessageLoop_Dev_0_1* PPB_MessageLoop_Proxy::GetInterface() { | 283 const PPB_MessageLoop_Dev_0_1* PPB_MessageLoop_Proxy::GetInterface() { |
283 return &ppb_message_loop_interface; | 284 return &ppb_message_loop_interface; |
284 } | 285 } |
285 | 286 |
286 } // namespace proxy | 287 } // namespace proxy |
287 } // namespace ppapi | 288 } // namespace ppapi |
OLD | NEW |