Index: webkit/plugins/ppapi/plugin_module.cc |
=================================================================== |
--- webkit/plugins/ppapi/plugin_module.cc (revision 91570) |
+++ webkit/plugins/ppapi/plugin_module.cc (working copy) |
@@ -422,6 +422,7 @@ |
name_(name), |
path_(path), |
reserve_instance_id_(NULL) { |
+ memset(&entry_points_, 0, sizeof(entry_points_)); |
pp_module_ = ResourceTracker::Get()->AddModule(this); |
GetMainThreadMessageLoop(); // Initialize the main thread message loop. |
GetLivePluginSet()->insert(this); |
@@ -451,8 +452,11 @@ |
} |
bool PluginModule::InitAsInternalPlugin(const EntryPoints& entry_points) { |
- entry_points_ = entry_points; |
- return InitializeModule(); |
+ if (InitializeModule(entry_points)) { |
+ entry_points_ = entry_points; |
+ return true; |
+ } |
+ return false; |
} |
bool PluginModule::InitAsLibrary(const FilePath& path) { |
@@ -460,12 +464,14 @@ |
if (!library) |
return false; |
- if (!LoadEntryPointsFromLibrary(library, &entry_points_) || |
- !InitializeModule()) { |
+ EntryPoints entry_points; |
+ |
+ if (!LoadEntryPointsFromLibrary(library, &entry_points) || |
+ !InitializeModule(entry_points)) { |
base::UnloadNativeLibrary(library); |
return false; |
} |
- |
+ entry_points_ = entry_points; |
library_ = library; |
return true; |
} |
@@ -576,9 +582,10 @@ |
return webkit_forwarding_.get(); |
} |
-bool PluginModule::InitializeModule() { |
+bool PluginModule::InitializeModule(const EntryPoints& entry_points) { |
DCHECK(!out_of_process_proxy_.get()) << "Don't call for proxied modules."; |
- int retval = entry_points_.initialize_module(pp_module(), &GetInterface); |
+ DCHECK(entry_points.initialize_module != NULL); |
+ int retval = entry_points.initialize_module(pp_module(), &GetInterface); |
if (retval != 0) { |
LOG(WARNING) << "PPP_InitializeModule returned failure " << retval; |
return false; |