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 "webkit/plugins/ppapi/ppb_flash_impl.h" | 5 #include "webkit/plugins/ppapi/ppb_flash_impl.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 | 8 |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 | 211 |
212 PP_Bool NavigateToURL(PP_Instance pp_instance, | 212 PP_Bool NavigateToURL(PP_Instance pp_instance, |
213 const char* url, | 213 const char* url, |
214 const char* target) { | 214 const char* target) { |
215 PluginInstance* instance = ResourceTracker::Get()->GetInstance(pp_instance); | 215 PluginInstance* instance = ResourceTracker::Get()->GetInstance(pp_instance); |
216 if (!instance) | 216 if (!instance) |
217 return PP_FALSE; | 217 return PP_FALSE; |
218 return BoolToPPBool(instance->NavigateToURL(url, target)); | 218 return BoolToPPBool(instance->NavigateToURL(url, target)); |
219 } | 219 } |
220 | 220 |
221 void RunMessageLoop() { | 221 void RunMessageLoop(PP_Instance instance) { |
222 bool old_state = MessageLoop::current()->NestableTasksAllowed(); | 222 bool old_state = MessageLoop::current()->NestableTasksAllowed(); |
223 MessageLoop::current()->SetNestableTasksAllowed(true); | 223 MessageLoop::current()->SetNestableTasksAllowed(true); |
224 MessageLoop::current()->Run(); | 224 MessageLoop::current()->Run(); |
225 MessageLoop::current()->SetNestableTasksAllowed(old_state); | 225 MessageLoop::current()->SetNestableTasksAllowed(old_state); |
226 } | 226 } |
227 | 227 |
228 void QuitMessageLoop() { | 228 void QuitMessageLoop(PP_Instance instance) { |
229 MessageLoop::current()->QuitNow(); | 229 MessageLoop::current()->QuitNow(); |
230 } | 230 } |
231 | 231 |
232 const PPB_Flash ppb_flash = { | 232 const PPB_Flash ppb_flash = { |
233 &SetInstanceAlwaysOnTop, | 233 &SetInstanceAlwaysOnTop, |
234 &PPB_Flash_Impl::DrawGlyphs, | 234 &PPB_Flash_Impl::DrawGlyphs, |
235 &GetProxyForURL, | 235 &GetProxyForURL, |
236 &OpenModuleLocalFile, | 236 &OpenModuleLocalFile, |
237 &RenameModuleLocalFile, | 237 &RenameModuleLocalFile, |
238 &DeleteModuleLocalFileOrDir, | 238 &DeleteModuleLocalFileOrDir, |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 // Wipe everything else out for safety. | 435 // Wipe everything else out for safety. |
436 socket_out_ = NULL; | 436 socket_out_ = NULL; |
437 local_addr_out_ = NULL; | 437 local_addr_out_ = NULL; |
438 remote_addr_out_ = NULL; | 438 remote_addr_out_ = NULL; |
439 | 439 |
440 callback->Run(rv); // Will complete abortively if necessary. | 440 callback->Run(rv); // Will complete abortively if necessary. |
441 } | 441 } |
442 | 442 |
443 } // namespace ppapi | 443 } // namespace ppapi |
444 } // namespace webkit | 444 } // namespace webkit |
OLD | NEW |