do_GetService("@mozilla.org/plugin/host;1");
do_GetService("@mozilla.org/plugin/manager;1");
StopPluginInstance(PresShell *aShell, nsIContent *aContent){  nsIFrame *frame = aShell->FrameManager()->GetPrimaryFrameFor(aContent);  nsIObjectFrame *objectFrame = nsnull;  if (frame)    CallQueryInterface(frame, &objectFrame);  if (!objectFrame)    return;  nsCOMPtr<nsIPluginInstance> instance;  objectFrame->GetPluginInstance(*getter_AddRefs(instance));  if (!instance)    return;  // Check whether the plugin wants SetWindow to be called before or after  // Stop/Destroy.  This is similar to nsObjectFrame::Destroy(), but we  // don't want to destroy the frame just yet.  PRBool callSetWindowLast = PR_FALSE;  instance->GetValue(nsPluginInstanceVariable_CallSetWindowAfterDestroyBool,                     (void *) &callSetWindowLast);  if (callSetWindowLast) {    instance->Stop();    instance->Destroy();    instance->SetWindow(nsnull);  } else {    instance->Stop();    instance->SetWindow(nsnull);    instance->Destroy();  }  nsCOMPtr<nsIPluginHost> pluginHost =    do_GetService("@mozilla.org/plugin/host;1");  if (pluginHost)    pluginHost->StopPluginInstance(instance);}