Bug 680528 - Make use of the cached UserAgent string in PluginModuleChild. r=bent

This commit is contained in:
Jim Mathies 2011-08-19 15:25:09 -05:00
parent 8693754aaa
commit 764b581511

View File

@ -129,6 +129,7 @@ PluginModuleChild::PluginModuleChild()
memset(&mFunctions, 0, sizeof(mFunctions));
memset(&mSavedData, 0, sizeof(mSavedData));
gInstance = this;
mUserAgent.SetIsVoid(PR_TRUE);
#ifdef XP_MACOSX
mac_plugin_interposing::child::SetUpCocoaInterposing();
#endif
@ -729,7 +730,7 @@ PluginModuleChild::CleanUp()
const char*
PluginModuleChild::GetUserAgent()
{
if (!CallNPN_UserAgent(&mUserAgent))
if (mUserAgent.IsVoid() && !CallNPN_UserAgent(&mUserAgent))
return NULL;
return NullableStringGet(mUserAgent);