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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
190 return false; // Can't be current if there's nothing in the slot. | 190 return false; // Can't be current if there's nothing in the slot. |
191 return static_cast<const void*>(globals->msg_loop_slot()->Get()) == | 191 return static_cast<const void*>(globals->msg_loop_slot()->Get()) == |
192 static_cast<const void*>(this); | 192 static_cast<const void*>(this); |
193 } | 193 } |
194 | 194 |
195 void MessageLoopResource::PostClosure( | 195 void MessageLoopResource::PostClosure( |
196 const tracked_objects::Location& from_here, | 196 const tracked_objects::Location& from_here, |
197 const base::Closure& closure, | 197 const base::Closure& closure, |
198 int64 delay_ms) { | 198 int64 delay_ms) { |
199 if (loop_.get()) { | 199 if (loop_.get()) { |
200 loop_->PostDelayedTask( | 200 loop_->PostDelayedTask(from_here, |
201 from_here, closure, base::TimeDelta::FromMilliseconds(delay_ms)); | 201 RunWhileLocked(closure), |
brettw
2012/02/13 20:52:34
Isn't this closure into user code, where we would
dmichael (off chromium)
2012/02/13 21:15:33
Yes, thank you, nice catch. I added a comment to P
| |
202 base::TimeDelta::FromMilliseconds(delay_ms)); | |
202 } else { | 203 } else { |
203 TaskInfo info; | 204 TaskInfo info; |
204 info.from_here = FROM_HERE; | 205 info.from_here = FROM_HERE; |
205 info.closure = closure; | 206 info.closure = closure; |
206 info.delay_ms = delay_ms; | 207 info.delay_ms = delay_ms; |
207 pending_tasks_.push_back(info); | 208 pending_tasks_.push_back(info); |
208 } | 209 } |
209 } | 210 } |
210 | 211 |
211 // static | 212 // static |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
286 PPB_MessageLoop_Proxy::~PPB_MessageLoop_Proxy() { | 287 PPB_MessageLoop_Proxy::~PPB_MessageLoop_Proxy() { |
287 } | 288 } |
288 | 289 |
289 // static | 290 // static |
290 const PPB_MessageLoop_Dev_0_1* PPB_MessageLoop_Proxy::GetInterface() { | 291 const PPB_MessageLoop_Dev_0_1* PPB_MessageLoop_Proxy::GetInterface() { |
291 return &ppb_message_loop_interface; | 292 return &ppb_message_loop_interface; |
292 } | 293 } |
293 | 294 |
294 } // namespace proxy | 295 } // namespace proxy |
295 } // namespace ppapi | 296 } // namespace ppapi |
OLD | NEW |