Bug 1655598 - The imgIRequest uri attribute should be infallible. r=emilio

The implementation of GetURI always returns NS_OK, and therefore the URI can
be marked as infallible.

Differential Revision: https://phabricator.services.mozilla.com/D157009
This commit is contained in:
Dan Robertson 2022-09-25 00:07:55 +00:00
Родитель 098ef6e21d
Коммит 6b7a505d18
4 изменённых файлов: 5 добавлений и 9 удалений

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

@ -384,8 +384,7 @@ void DragDataProducer::CreateLinkText(const nsAString& inURL,
nsresult DragDataProducer::GetImageData(imgIContainer* aImage,
imgIRequest* aRequest) {
nsCOMPtr<nsIURI> imgUri;
aRequest->GetURI(getter_AddRefs(imgUri));
nsCOMPtr<nsIURI> imgUri = aRequest->GetURI();
nsCOMPtr<nsIURL> imgUrl(do_QueryInterface(imgUri));
if (imgUrl) {

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

@ -89,7 +89,7 @@ interface imgIRequest : nsIRequest
* actual URI for the image (e.g. if HTTP redirects happened during the
* load).
*/
readonly attribute nsIURI URI;
[infallible] readonly attribute nsIURI URI;
/**
* The URI of the resource we ended up loading after all redirects, etc.

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

@ -1527,8 +1527,7 @@ void nsRefreshDriver::AddImageRequest(imgIRequest* aRequest) {
EnsureTimerStarted();
if (profiler_thread_is_being_profiled_for_markers()) {
nsCOMPtr<nsIURI> uri;
aRequest->GetURI(getter_AddRefs(uri));
nsCOMPtr<nsIURI> uri = aRequest->GetURI();
nsAutoCString uristr;
uri->GetAsciiSpec(uristr);
@ -1552,8 +1551,7 @@ void nsRefreshDriver::RemoveImageRequest(imgIRequest* aRequest) {
}
if (removed && profiler_thread_is_being_profiled_for_markers()) {
nsCOMPtr<nsIURI> uri;
aRequest->GetURI(getter_AddRefs(uri));
nsCOMPtr<nsIURI> uri = aRequest->GetURI();
nsAutoCString uristr;
uri->GetAsciiSpec(uristr);

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

@ -2629,8 +2629,7 @@ void nsImageFrame::List(FILE* out, const char* aPrefix,
// output the img src url
if (nsCOMPtr<imgIRequest> currentRequest = GetCurrentRequest()) {
nsCOMPtr<nsIURI> uri;
currentRequest->GetURI(getter_AddRefs(uri));
nsCOMPtr<nsIURI> uri = currentRequest->GetURI();
nsAutoCString uristr;
uri->GetAsciiSpec(uristr);
str += nsPrintfCString(" [src=%s]", uristr.get());