Chromium Code Reviews| 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 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 473 library_ = library; | 473 library_ = library; |
| 474 return true; | 474 return true; |
| 475 } | 475 } |
| 476 | 476 |
| 477 void PluginModule::InitAsProxied( | 477 void PluginModule::InitAsProxied( |
| 478 PluginDelegate::OutOfProcessProxy* out_of_process_proxy) { | 478 PluginDelegate::OutOfProcessProxy* out_of_process_proxy) { |
| 479 DCHECK(!out_of_process_proxy_.get()); | 479 DCHECK(!out_of_process_proxy_.get()); |
| 480 out_of_process_proxy_.reset(out_of_process_proxy); | 480 out_of_process_proxy_.reset(out_of_process_proxy); |
| 481 } | 481 } |
| 482 | 482 |
| 483 scoped_refptr<PluginModule> PluginModule::CreateModuleForNaClInstance() { | 483 scoped_refptr<PluginModule> |
| 484 PluginModule::CreateModuleForExternalPluginInstance() { | |
| 484 // Create a new module, but don't set the lifetime delegate. This isn't a | 485 // Create a new module, but don't set the lifetime delegate. This isn't a |
| 485 // plugin in the usual sense, so it isn't tracked by the browser. | 486 // plugin in the usual sense, so it isn't tracked by the browser. |
| 486 scoped_refptr<PluginModule> nacl_module( | 487 scoped_refptr<PluginModule> external_plugin_module( |
| 487 new PluginModule(name_, | 488 new PluginModule(name_, |
| 488 path_, | 489 path_, |
| 489 NULL, // no lifetime_delegate | 490 NULL, // no lifetime_delegate |
| 490 permissions_)); | 491 permissions_)); |
| 491 return nacl_module; | 492 return external_plugin_module; |
| 492 } | 493 } |
| 493 | 494 |
| 494 PP_NaClResult PluginModule::InitAsProxiedNaCl(PluginInstance* instance) { | 495 PP_ExternalPluginResult PluginModule::InitAsProxiedExternalPlugin( |
| 496 PluginInstance* instance) { | |
| 495 DCHECK(out_of_process_proxy_.get()); | 497 DCHECK(out_of_process_proxy_.get()); |
| 496 // InitAsProxied (for the trusted/out-of-process case) initializes only the | 498 // InitAsProxied (for the trusted/out-of-process case) initializes only the |
| 497 // module, and one or more instances are added later. In this case, the | 499 // module, and one or more instances are added later. In this case, the |
| 498 // PluginInstance was already created as in-process, so we missed the proxy | 500 // PluginInstance was already created as in-process, so we missed the proxy |
| 499 // AddInstance step and must do it now. | 501 // AddInstance step and must do it now. |
| 500 out_of_process_proxy_->AddInstance(instance->pp_instance()); | 502 out_of_process_proxy_->AddInstance(instance->pp_instance()); |
| 501 // In NaCl, we need to tell the instance to reset itself as proxied. This will | 503 // In NaCl, we need to tell the instance to reset itself as proxied. This will |
|
bbudge
2013/07/23 23:59:58
s/In NaCl/For external plugins/
jam
2013/07/24 05:07:39
Done.
| |
| 502 // clear cached interface pointers and send DidCreate (etc) to the plugin | 504 // clear cached interface pointers and send DidCreate (etc) to the plugin |
| 503 // side of the proxy. | 505 // side of the proxy. |
| 504 return instance->ResetAsProxied(this); | 506 return instance->ResetAsProxied(this); |
| 505 } | 507 } |
| 506 | 508 |
| 507 bool PluginModule::IsProxied() const { | 509 bool PluginModule::IsProxied() const { |
| 508 return !!out_of_process_proxy_; | 510 return !!out_of_process_proxy_; |
| 509 } | 511 } |
| 510 | 512 |
| 511 base::ProcessId PluginModule::GetPeerProcessId() { | 513 base::ProcessId PluginModule::GetPeerProcessId() { |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 628 int retval = entry_points.initialize_module(pp_module(), &GetInterface); | 630 int retval = entry_points.initialize_module(pp_module(), &GetInterface); |
| 629 if (retval != 0) { | 631 if (retval != 0) { |
| 630 LOG(WARNING) << "PPP_InitializeModule returned failure " << retval; | 632 LOG(WARNING) << "PPP_InitializeModule returned failure " << retval; |
| 631 return false; | 633 return false; |
| 632 } | 634 } |
| 633 return true; | 635 return true; |
| 634 } | 636 } |
| 635 | 637 |
| 636 } // namespace ppapi | 638 } // namespace ppapi |
| 637 } // namespace webkit | 639 } // namespace webkit |
| OLD | NEW |