nsCOMPtr<nsIRDFDataSource> dataSource; nsISupports *supports = NS_STATIC_CAST(nsISupports*, data); dataSource = do_QueryInterface(supports, &rv);
nsCOMPtr<nsIRDFDataSource> dataSource = do_QueryInterface(supports, &rv);
NS_IMETHODIMP nsChromeRegistry::GetOverlayDataSource(nsIURI *aChromeURL, nsIRDFDataSource **aResult){  *aResult = nsnull;  nsresult rv;  if (!mDataSourceTable)    return NS_OK;  // Obtain the package, provider and remaining from the URL  nsXPIDLCString package, provider, remaining;#if 0 // This change happens when we switch to using chrome://skin@global/foo..  rv = aChromeURL->GetHost(getter_Copies(package));  if (NS_FAILED(rv)) return rv;  rv = aChromeURL->GetPreHost(getter_Copies(provider));  if (NS_FAILED(rv)) return rv;  rv = aChromeURL->GetPath(getter_Copies(remaining));  if (NS_FAILED(rv)) return rv;#else // For now however...  rv = aChromeURL->GetHost(getter_Copies(package));  if (NS_FAILED(rv)) return rv;  nsXPIDLCString tempPath;  rv = aChromeURL->GetPath(getter_Copies(tempPath));  if (NS_FAILED(rv)) return rv;  BreakProviderAndRemainingFromPath(      (const char*)tempPath,       getter_Copies(provider),       getter_Copies(remaining));#endif  nsCAutoString overlayFile;  // Retrieve the mInner data source.  overlayFile = "resource:/chrome/";  overlayFile += package;  overlayFile += provider; // provider already has a / in the front of it  overlayFile += "/";  overlayFile += "overlays.rdf";  nsStringKey skey(overlayFile);  void *data = mDataSourceTable->Get(&skey);  if (data)  {    nsCOMPtr<nsIRDFDataSource> dataSource;    nsISupports *supports = NS_STATIC_CAST(nsISupports*, data);    dataSource = do_QueryInterface(supports, &rv);    if (NS_SUCCEEDED(rv))    {      *aResult = dataSource;      NS_ADDREF(*aResult);    }  }  return NS_OK;}