зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
c316c0d9f0
Коммит
b7b30e5a1d
|
@ -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());
|
||||
|
|
Загрузка…
Ссылка в новой задаче