Chromium Code Reviews| 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/plugin_module.h" | 5 #include "webkit/plugins/ppapi/plugin_module.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 451 return InitializeModule(); | 451 return InitializeModule(); |
| 452 } | 452 } |
| 453 | 453 |
| 454 bool PluginModule::InitAsLibrary(const FilePath& path) { | 454 bool PluginModule::InitAsLibrary(const FilePath& path) { |
| 455 base::NativeLibrary library = base::LoadNativeLibrary(path, NULL); | 455 base::NativeLibrary library = base::LoadNativeLibrary(path, NULL); |
| 456 if (!library) | 456 if (!library) |
| 457 return false; | 457 return false; |
| 458 | 458 |
| 459 if (!LoadEntryPointsFromLibrary(library, &entry_points_) || | 459 if (!LoadEntryPointsFromLibrary(library, &entry_points_) || |
| 460 !InitializeModule()) { | 460 !InitializeModule()) { |
| 461 memset(&entry_points_, 0, sizeof(entry_points_)); | |
|
brettw
2011/07/06 18:27:54
Can we do this in the constructor instead?
ananta
2011/07/06 18:41:53
I moved the memset to the constructor. However the
| |
| 461 base::UnloadNativeLibrary(library); | 462 base::UnloadNativeLibrary(library); |
| 462 return false; | 463 return false; |
| 463 } | 464 } |
| 464 | 465 |
| 465 library_ = library; | 466 library_ = library; |
| 466 return true; | 467 return true; |
| 467 } | 468 } |
| 468 | 469 |
| 469 void PluginModule::InitAsProxied( | 470 void PluginModule::InitAsProxied( |
| 470 PluginDelegate::OutOfProcessProxy* out_of_process_proxy) { | 471 PluginDelegate::OutOfProcessProxy* out_of_process_proxy) { |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 577 int retval = entry_points_.initialize_module(pp_module(), &GetInterface); | 578 int retval = entry_points_.initialize_module(pp_module(), &GetInterface); |
| 578 if (retval != 0) { | 579 if (retval != 0) { |
| 579 LOG(WARNING) << "PPP_InitializeModule returned failure " << retval; | 580 LOG(WARNING) << "PPP_InitializeModule returned failure " << retval; |
| 580 return false; | 581 return false; |
| 581 } | 582 } |
| 582 return true; | 583 return true; |
| 583 } | 584 } |
| 584 | 585 |
| 585 } // namespace ppapi | 586 } // namespace ppapi |
| 586 } // namespace webkit | 587 } // namespace webkit |
| OLD | NEW |