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 "webkit/plugins/ppapi/plugin_module.h" | 5 #include "webkit/plugins/ppapi/plugin_module.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 // plugin in the usual sense, so it isn't tracked by the browser. | 505 // plugin in the usual sense, so it isn't tracked by the browser. |
506 scoped_refptr<PluginModule> nacl_module( | 506 scoped_refptr<PluginModule> nacl_module( |
507 new PluginModule(name_, | 507 new PluginModule(name_, |
508 path_, | 508 path_, |
509 NULL, // no lifetime_delegate | 509 NULL, // no lifetime_delegate |
510 permissions_)); | 510 permissions_)); |
511 return nacl_module; | 511 return nacl_module; |
512 } | 512 } |
513 | 513 |
514 void PluginModule::InitAsProxiedNaCl( | 514 void PluginModule::InitAsProxiedNaCl( |
515 scoped_ptr<PluginDelegate::OutOfProcessProxy> out_of_process_proxy, | 515 PluginDelegate::OutOfProcessProxy* out_of_process_proxy, |
516 PP_Instance instance) { | 516 PluginInstance* plugin_instance) { |
517 InitAsProxied(out_of_process_proxy.release()); | 517 InitAsProxied(out_of_process_proxy); |
518 // InitAsProxied (for the trusted/out-of-process case) initializes only the | 518 // InitAsProxied (for the trusted/out-of-process case) initializes only the |
519 // module, and one or more instances are added later. In this case, the | 519 // module, and one or more instances are added later. In this case, the |
520 // PluginInstance was already created as in-process, so we missed the proxy | 520 // PluginInstance was already created as in-process, so we missed the proxy |
521 // AddInstance step and must do it now. | 521 // AddInstance step and must do it now. |
522 out_of_process_proxy_->AddInstance(instance); | 522 out_of_process_proxy_->AddInstance(plugin_instance->pp_instance()); |
523 // In NaCl, we need to tell the instance to reset itself as proxied. This will | 523 // In NaCl, we need to tell the instance to reset itself as proxied. This will |
524 // clear cached interface pointers and send DidCreate (etc) to the plugin | 524 // clear cached interface pointers and send DidCreate (etc) to the plugin |
525 // side of the proxy. | 525 // side of the proxy. |
526 PluginInstance* plugin_instance = host_globals->GetInstance(instance); | |
527 if (!plugin_instance) | |
528 return; | |
529 plugin_instance->ResetAsProxied(this); | 526 plugin_instance->ResetAsProxied(this); |
530 } | 527 } |
531 | 528 |
532 // static | 529 // static |
533 const PPB_Core* PluginModule::GetCore() { | 530 const PPB_Core* PluginModule::GetCore() { |
534 return &core_interface; | 531 return &core_interface; |
535 } | 532 } |
536 | 533 |
537 // static | 534 // static |
538 PluginModule::GetInterfaceFunc PluginModule::GetLocalGetInterfaceFunc() { | 535 PluginModule::GetInterfaceFunc PluginModule::GetLocalGetInterfaceFunc() { |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
626 int retval = entry_points.initialize_module(pp_module(), &GetInterface); | 623 int retval = entry_points.initialize_module(pp_module(), &GetInterface); |
627 if (retval != 0) { | 624 if (retval != 0) { |
628 LOG(WARNING) << "PPP_InitializeModule returned failure " << retval; | 625 LOG(WARNING) << "PPP_InitializeModule returned failure " << retval; |
629 return false; | 626 return false; |
630 } | 627 } |
631 return true; | 628 return true; |
632 } | 629 } |
633 | 630 |
634 } // namespace ppapi | 631 } // namespace ppapi |
635 } // namespace webkit | 632 } // namespace webkit |
OLD | NEW |