Bug 1136379. Clean up the nsPluginHost API a bit. r=bzbarsky

This commit is contained in:
John Schoenick
2015-02-25 11:36:39 -05:00
parent 0903355916
commit d4c7392c8a
12 changed files with 379 additions and 323 deletions

View File

@@ -277,7 +277,7 @@ nsNPAPIPluginInstance::StopTime()
return mStopTime;
}
nsresult nsNPAPIPluginInstance::Initialize(nsNPAPIPlugin *aPlugin, nsPluginInstanceOwner* aOwner, const char* aMIMEType)
nsresult nsNPAPIPluginInstance::Initialize(nsNPAPIPlugin *aPlugin, nsPluginInstanceOwner* aOwner, const nsACString& aMIMEType)
{
PLUGIN_LOG(PLUGIN_LOG_NORMAL, ("nsNPAPIPluginInstance::Initialize this=%p\n",this));
@@ -287,11 +287,8 @@ nsresult nsNPAPIPluginInstance::Initialize(nsNPAPIPlugin *aPlugin, nsPluginInsta
mPlugin = aPlugin;
mOwner = aOwner;
if (aMIMEType) {
mMIMEType = (char*)PR_Malloc(strlen(aMIMEType) + 1);
if (mMIMEType) {
PL_strcpy(mMIMEType, aMIMEType);
}
if (!aMIMEType.IsEmpty()) {
mMIMEType = ToNewCString(aMIMEType);
}
return Start();