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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 if (!globals->msg_loop_slot()) | 170 if (!globals->msg_loop_slot()) |
171 return false; // Can't be current if there's nothing in the slot. | 171 return false; // Can't be current if there's nothing in the slot. |
172 return static_cast<const void*>(globals->msg_loop_slot()->Get()) == | 172 return static_cast<const void*>(globals->msg_loop_slot()->Get()) == |
173 static_cast<const void*>(this); | 173 static_cast<const void*>(this); |
174 } | 174 } |
175 | 175 |
176 void MessageLoopResource::PostClosure( | 176 void MessageLoopResource::PostClosure( |
177 const tracked_objects::Location& from_here, | 177 const tracked_objects::Location& from_here, |
178 const base::Closure& closure, | 178 const base::Closure& closure, |
179 int64 delay_ms) { | 179 int64 delay_ms) { |
180 if (loop_proxy_) { | 180 if (loop_proxy_.get()) { |
181 loop_proxy_->PostDelayedTask(from_here, | 181 loop_proxy_->PostDelayedTask( |
182 closure, | 182 from_here, closure, base::TimeDelta::FromMilliseconds(delay_ms)); |
183 base::TimeDelta::FromMilliseconds(delay_ms)); | |
184 } else { | 183 } else { |
185 TaskInfo info; | 184 TaskInfo info; |
186 info.from_here = FROM_HERE; | 185 info.from_here = FROM_HERE; |
187 info.closure = closure; | 186 info.closure = closure; |
188 info.delay_ms = delay_ms; | 187 info.delay_ms = delay_ms; |
189 pending_tasks_.push_back(info); | 188 pending_tasks_.push_back(info); |
190 } | 189 } |
191 } | 190 } |
192 | 191 |
193 // static | 192 // static |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 PPB_MessageLoop_Proxy::~PPB_MessageLoop_Proxy() { | 265 PPB_MessageLoop_Proxy::~PPB_MessageLoop_Proxy() { |
267 } | 266 } |
268 | 267 |
269 // static | 268 // static |
270 const PPB_MessageLoop_1_0* PPB_MessageLoop_Proxy::GetInterface() { | 269 const PPB_MessageLoop_1_0* PPB_MessageLoop_Proxy::GetInterface() { |
271 return &ppb_message_loop_interface; | 270 return &ppb_message_loop_interface; |
272 } | 271 } |
273 | 272 |
274 } // namespace proxy | 273 } // namespace proxy |
275 } // namespace ppapi | 274 } // namespace ppapi |
OLD | NEW |