Bug 406541 - Followup - Handle failed URI creation, fix typo. r=bzbarsky

This commit is contained in:
John Schoenick 2012-03-02 14:13:10 -08:00
Родитель ed3ba69ec8
Коммит 41d567cf1f
2 изменённых файлов: 13 добавлений и 4 удалений

Просмотреть файл

@ -86,7 +86,7 @@ interface nsIObjectLoadingContent : nsISupports
* account. The MIME type is required as some plugins (java) calculate
* this differently.
*/
nsIURI GetObjectBaseURI(in ACString aMimeType);
nsIURI getObjectBaseURI(in ACString aMimeType);
/**
* Returns the plugin instance if it has already been instantiated. This

Просмотреть файл

@ -1871,9 +1871,18 @@ nsObjectLoadingContent::GetObjectBaseURI(const nsACString & aMimeType, nsIURI**
codebase.AssignLiteral("/");
}
nsContentUtils::NewURIWithDocumentCharset(aURI, codebase,
thisContent->OwnerDoc(),
baseURI);
if (!codebase.IsEmpty()) {
nsresult rv = nsContentUtils::NewURIWithDocumentCharset(aURI, codebase,
thisContent->OwnerDoc(),
baseURI);
if (NS_SUCCEEDED(rv))
return rv;
NS_WARNING("GetObjectBaseURI: Could not resolve plugin's codebase to a URI, using baseURI instead");
}
// Codebase empty or build URI failed, just use baseURI
*aURI = NULL;
baseURI.swap(*aURI);
return NS_OK;
}