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 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 lifetime_delegate_->PluginModuleDead(this); | 488 lifetime_delegate_->PluginModuleDead(this); |
489 } | 489 } |
490 | 490 |
491 // Don't add stuff here, the two notifications that the module object has | 491 // Don't add stuff here, the two notifications that the module object has |
492 // been deleted should be last. This allows, for example, | 492 // been deleted should be last. This allows, for example, |
493 // PPB_Proxy.IsInModuleDestructor to map PP_Module to this class during the | 493 // PPB_Proxy.IsInModuleDestructor to map PP_Module to this class during the |
494 // previous parts of the destructor. | 494 // previous parts of the destructor. |
495 } | 495 } |
496 | 496 |
497 bool PluginModule::InitAsInternalPlugin(const EntryPoints& entry_points) { | 497 bool PluginModule::InitAsInternalPlugin(const EntryPoints& entry_points) { |
| 498 #if defined(OS_CHROMEOS) |
| 499 // TODO(oshima): Remove this once crosbug.com/26646 is resolved. |
| 500 LOG(ERROR) << "#### PluginModule::InitAsInternalPlugin name=" << name_; |
| 501 #endif // defined (OS_CHROMEOS) |
| 502 |
498 if (InitializeModule(entry_points)) { | 503 if (InitializeModule(entry_points)) { |
499 entry_points_ = entry_points; | 504 entry_points_ = entry_points; |
500 return true; | 505 return true; |
501 } | 506 } |
502 return false; | 507 return false; |
503 } | 508 } |
504 | 509 |
505 bool PluginModule::InitAsLibrary(const FilePath& path) { | 510 bool PluginModule::InitAsLibrary(const FilePath& path) { |
| 511 #if defined(OS_CHROMEOS) |
| 512 // TODO(oshima): Remove this once crosbug.com/26646 is resolved. |
| 513 LOG(ERROR) << "#### PluginModule::InitAsLibrary name=" << name_; |
| 514 #endif // defined (OS_CHROMEOS) |
| 515 |
506 base::NativeLibrary library = base::LoadNativeLibrary(path, NULL); | 516 base::NativeLibrary library = base::LoadNativeLibrary(path, NULL); |
| 517 #if defined(OS_CHROMEOS) |
| 518 // TODO(oshima): Remove this once crosbug.com/26646 is resolved. |
| 519 LOG(ERROR) << "#### PluginModule::InitAsLibrary loaded"; |
| 520 #endif // defined (OS_CHROMEOS) |
| 521 |
507 if (!library) | 522 if (!library) |
508 return false; | 523 return false; |
509 | 524 |
510 EntryPoints entry_points; | 525 EntryPoints entry_points; |
511 | 526 |
512 if (!LoadEntryPointsFromLibrary(library, &entry_points) || | 527 if (!LoadEntryPointsFromLibrary(library, &entry_points) || |
513 !InitializeModule(entry_points)) { | 528 !InitializeModule(entry_points)) { |
514 base::UnloadNativeLibrary(library); | 529 base::UnloadNativeLibrary(library); |
515 return false; | 530 return false; |
516 } | 531 } |
517 entry_points_ = entry_points; | 532 entry_points_ = entry_points; |
518 library_ = library; | 533 library_ = library; |
519 return true; | 534 return true; |
520 } | 535 } |
521 | 536 |
522 void PluginModule::InitAsProxied( | 537 void PluginModule::InitAsProxied( |
523 PluginDelegate::OutOfProcessProxy* out_of_process_proxy) { | 538 PluginDelegate::OutOfProcessProxy* out_of_process_proxy) { |
| 539 #if defined(OS_CHROMEOS) |
| 540 // TODO(oshima): Remove this once crosbug.com/26646 is resolved. |
| 541 LOG(ERROR) << "#### PluginModule::InitAsProxied name=" << name_; |
| 542 #endif // defined (OS_CHROMEOS) |
| 543 |
524 DCHECK(!out_of_process_proxy_.get()); | 544 DCHECK(!out_of_process_proxy_.get()); |
525 out_of_process_proxy_.reset(out_of_process_proxy); | 545 out_of_process_proxy_.reset(out_of_process_proxy); |
526 } | 546 } |
527 | 547 |
528 // static | 548 // static |
529 const PPB_Core* PluginModule::GetCore() { | 549 const PPB_Core* PluginModule::GetCore() { |
530 return &core_interface; | 550 return &core_interface; |
531 } | 551 } |
532 | 552 |
533 // static | 553 // static |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
614 } | 634 } |
615 | 635 |
616 PluginDelegate::Broker* PluginModule::GetBroker() { | 636 PluginDelegate::Broker* PluginModule::GetBroker() { |
617 return broker_; | 637 return broker_; |
618 } | 638 } |
619 | 639 |
620 bool PluginModule::InitializeModule(const EntryPoints& entry_points) { | 640 bool PluginModule::InitializeModule(const EntryPoints& entry_points) { |
621 DCHECK(!out_of_process_proxy_.get()) << "Don't call for proxied modules."; | 641 DCHECK(!out_of_process_proxy_.get()) << "Don't call for proxied modules."; |
622 DCHECK(entry_points.initialize_module != NULL); | 642 DCHECK(entry_points.initialize_module != NULL); |
623 int retval = entry_points.initialize_module(pp_module(), &GetInterface); | 643 int retval = entry_points.initialize_module(pp_module(), &GetInterface); |
| 644 #if defined(OS_CHROMEOS) |
| 645 // TODO(oshima): Remove this once crosbug.com/26646 is resolved. |
| 646 LOG(ERROR) << "#### PluginModule::InitModule result=" << retval; |
| 647 #endif // defined (OS_CHROMEOS) |
| 648 |
624 if (retval != 0) { | 649 if (retval != 0) { |
625 LOG(WARNING) << "PPP_InitializeModule returned failure " << retval; | 650 LOG(WARNING) << "PPP_InitializeModule returned failure " << retval; |
626 return false; | 651 return false; |
627 } | 652 } |
628 return true; | 653 return true; |
629 } | 654 } |
630 | 655 |
631 } // namespace ppapi | 656 } // namespace ppapi |
632 } // namespace webkit | 657 } // namespace webkit |
OLD | NEW |