From 95ddf98879dd04f068cf4152387b55a274b38bd5 Mon Sep 17 00:00:00 2001 From: "stuartmorgan@chromium.org" Date: Sat, 14 Nov 2009 01:03:03 +0000 Subject: Call np_getentrypoints after np_initialize on the Mac This matches the behavior of other Mac browsers, and QuickTime at least expects the calls in that order or the function list it gives back will be incomplete (NP_GetValue and NP_SetValue missing) BUG=24999 TEST=See testcase in bug; movie should play. Review URL: http://codereview.chromium.org/386036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31980 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/glue/plugins/plugin_lib.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'webkit/glue') diff --git a/webkit/glue/plugins/plugin_lib.cc b/webkit/glue/plugins/plugin_lib.cc index 05c12e9..1ca03ed 100644 --- a/webkit/glue/plugins/plugin_lib.cc +++ b/webkit/glue/plugins/plugin_lib.cc @@ -109,6 +109,13 @@ NPError PluginLib::NP_Initialize() { &plugin_funcs_); #else NPError rv = entry_points_.np_initialize(host->host_functions()); +#if defined(OS_MACOSX) + // On the Mac, we need to get entry points after calling np_initialize to + // match the behavior of other browsers. + if (rv == NPERR_NO_ERROR) { + rv = entry_points_.np_getentrypoints(&plugin_funcs_); + } +#endif // OS_MACOSX #endif LOG(INFO) << "PluginLib::NP_Initialize(" << web_plugin_info_.path.value() << "): result=" << rv; @@ -190,11 +197,11 @@ bool PluginLib::Load() { if (rv) { plugin_funcs_.size = sizeof(plugin_funcs_); plugin_funcs_.version = (NP_VERSION_MAJOR << 8) | NP_VERSION_MINOR; -#if !defined(OS_LINUX) && !defined(OS_FREEBSD) +#if !defined(OS_LINUX) && !defined(OS_FREEBSD) && !defined(OS_MACOSX) if (entry_points_.np_getentrypoints(&plugin_funcs_) != NPERR_NO_ERROR) rv = false; #else - // On Linux, we get the plugin entry points during NP_Initialize. + // On Linux and Mac, we get the plugin entry points during NP_Initialize. #endif } -- cgit v1.1