b=629472 revert to using NP_GetValue instead of NPPluginFuncs::getvalue for NPPVpluginDescriptionString when testing for Flash r=cjones

--HG--
extra : transplant_source : %FBW%24%E0%DD%03%82%3E%EDA5%A0.%F8%1A%0A%AF%C9%9E%15
This commit is contained in:
Karl Tomlinson 2011-05-02 08:33:16 +12:00
Родитель 1e810a8749
Коммит e3dc04b1c2
3 изменённых файлов: 25 добавлений и 24 удалений

Просмотреть файл

@ -169,20 +169,6 @@ PluginInstanceChild::PluginInstanceChild(const NPPluginFuncs* aPluginIface)
#if defined(OS_WIN)
InitPopupMenuHook();
#endif // OS_WIN
#ifdef MOZ_X11
// Maemo flash can render plugin with any provided rectangle and not require this quirk.
#ifndef MOZ_PLATFORM_MAEMO
const char *description = NULL;
mPluginIface->getvalue(GetNPP(), NPPVpluginDescriptionString,
&description);
if (description) {
NS_NAMED_LITERAL_CSTRING(flash10Head, "Shockwave Flash 10.");
if (StringBeginsWith(nsDependentCString(description), flash10Head)) {
PluginModuleChild::current()->AddQuirk(PluginModuleChild::QUIRK_FLASH_EXPOSE_COORD_TRANSLATION);
}
}
#endif
#endif
}
PluginInstanceChild::~PluginInstanceChild()

Просмотреть файл

@ -185,22 +185,37 @@ PluginModuleChild::Init(const std::string& aPluginFilename,
return false;
mPluginFilename = aPluginFilename.c_str();
nsCOMPtr<nsILocalFile> pluginFile;
nsCOMPtr<nsILocalFile> localFile;
NS_NewLocalFile(NS_ConvertUTF8toUTF16(mPluginFilename),
PR_TRUE,
getter_AddRefs(pluginFile));
getter_AddRefs(localFile));
PRBool exists;
pluginFile->Exists(&exists);
localFile->Exists(&exists);
NS_ASSERTION(exists, "plugin file ain't there");
nsCOMPtr<nsIFile> pluginIfile;
pluginIfile = do_QueryInterface(pluginFile);
nsPluginFile pluginFile(localFile);
nsPluginFile lib(pluginIfile);
nsresult rv;
// Maemo flash can render with any provided rectangle and so does not
// require this quirk.
#if defined(MOZ_X11) && !defined(MOZ_PLATFORM_MAEMO)
nsPluginInfo info = nsPluginInfo();
rv = pluginFile.GetPluginInfo(info, &mLibrary);
if (NS_FAILED(rv))
return false;
nsresult rv = lib.LoadPlugin(&mLibrary);
NS_ASSERTION(NS_OK == rv, "trouble with mPluginFile");
NS_NAMED_LITERAL_CSTRING(flash10Head, "Shockwave Flash 10.");
if (StringBeginsWith(nsDependentCString(info.fDescription), flash10Head)) {
AddQuirk(QUIRK_FLASH_EXPOSE_COORD_TRANSLATION);
}
if (!mLibrary)
#endif
{
rv = pluginFile.LoadPlugin(&mLibrary);
NS_ASSERTION(NS_OK == rv, "trouble with mPluginFile");
}
NS_ASSERTION(mLibrary, "couldn't open shared object");
if (!Open(aChannel, aParentProcessHandle, aIOLoop))

Просмотреть файл

@ -256,13 +256,13 @@ public:
};
int GetQuirks() { return mQuirks; }
private:
void AddQuirk(PluginQuirks quirk) {
if (mQuirks == QUIRKS_NOT_INITIALIZED)
mQuirks = 0;
mQuirks |= quirk;
}
private:
void InitQuirksModes(const nsCString& aMimeType);
bool InitGraphics();
void DeinitGraphics();