t2p = aPresContext->TwipsToPixels();
aPresContext->GetTwipsToPixels(&t2p);
nsObjectFrame::InstantiatePlugin(nsPresContext* aPresContext,                                 nsHTMLReflowMetrics& aMetrics,                                 const nsHTMLReflowState& aReflowState,                                 nsIPluginHost* aPluginHost,                                  const char* aMimetype,                                 nsIURI* aURI){  nsIView *parentWithView;  nsPoint origin;  nsPluginWindow  *window;  float           t2p;    t2p = aPresContext->TwipsToPixels();  mFullURL = aURI;  // we need to recalculate this now that we have access to the nsPluginInstanceOwner  // and its size info (as set in the tag)  GetDesiredSize(aPresContext, aReflowState, aMetrics);  mInstanceOwner->GetWindow(window);  NS_ENSURE_TRUE(window, NS_ERROR_NULL_POINTER);  GetOffsetFromView(aPresContext, origin, &parentWithView);  window->x = NSTwipsToIntPixels(origin.x, t2p);  window->y = NSTwipsToIntPixels(origin.y, t2p);  window->width = NSTwipsToIntPixels(aMetrics.width, t2p);  window->height = NSTwipsToIntPixels(aMetrics.height, t2p);  // on the Mac we need to set the clipRect to { 0, 0, 0, 0 } for now. This will keep  // us from drawing on screen until the widget is properly positioned, which will not  // happen until we have finished the reflow process.  window->clipRect.top = 0;  window->clipRect.left = 0;#if !(defined(XP_MAC) || defined(XP_MACOSX))  window->clipRect.bottom = NSTwipsToIntPixels(aMetrics.height, t2p);  window->clipRect.right = NSTwipsToIntPixels(aMetrics.width, t2p);#else  window->clipRect.bottom = 0;  window->clipRect.right = 0;#endif  // Check to see if content-policy wants to veto this  if(aURI)  {    nsIDocument *document = aPresContext->PresShell()->GetDocument();    if (! document)      return NS_ERROR_FAILURE;    nsIURI *docURI = document->GetDocumentURI();    //don't care if we can't get the originating URL    PRInt16 shouldLoad = nsIContentPolicy::ACCEPT; // default permit    nsresult rv = NS_CheckContentLoadPolicy(nsIContentPolicy::TYPE_OBJECT,                                            aURI,                                            docURI,                                            mContent,                                            nsDependentCString(aMimetype ? aMimetype : ""),                                            nsnull, //extra                                            &shouldLoad);    if (NS_FAILED(rv) || NS_CP_REJECTED(shouldLoad)) {      return NS_ERROR_CONTENT_BLOCKED_SHOW_ALT;    }  }  nsCOMPtr<nsIDocument> doc;  nsresult rv = mInstanceOwner->GetDocument(getter_AddRefs(doc));  nsCOMPtr<nsIPluginDocument> pDoc (do_QueryInterface(doc));  if (pDoc) {  /* full-page mode */    nsCAutoString spec;    rv = aURI->GetSpec(spec);    if (NS_SUCCEEDED(rv)) {      NS_ConvertUTF8toUCS2 url(spec);      nsCOMPtr<nsIStreamListener> stream;      rv = aPluginHost->InstantiateFullPagePlugin(aMimetype,                                                  url,            /* resulting stream listener */       *getter_AddRefs(stream),                                                  mInstanceOwner);      if (NS_SUCCEEDED(rv))        pDoc->SetStreamListener(stream);    }  } else {   /* embedded mode */    rv = aPluginHost->InstantiateEmbededPlugin(aMimetype,                                               aURI,                                               mInstanceOwner);  }  return rv;}