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
Родитель 4dec8c9820
Коммит 70d0ad2434
2 изменённых файлов: 13 добавлений и 4 удалений

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

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

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

@ -1871,9 +1871,18 @@ nsObjectLoadingContent::GetObjectBaseURI(const nsACString & aMimeType, nsIURI**
codebase.AssignLiteral("/"); codebase.AssignLiteral("/");
} }
nsContentUtils::NewURIWithDocumentCharset(aURI, codebase, if (!codebase.IsEmpty()) {
thisContent->OwnerDoc(), nsresult rv = nsContentUtils::NewURIWithDocumentCharset(aURI, codebase,
baseURI); 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; return NS_OK;
} }