All users were logged out of Bugzilla on October 13th, 2018

Expose imgRequestProxy

RESOLVED FIXED in mozilla20

Status

()

RESOLVED FIXED
6 years ago
5 years ago

People

(Reporter: jrmuizel, Assigned: jrmuizel)

Tracking

unspecified
mozilla20
x86
Mac OS X
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

6 years ago
Created attachment 670916 [details] [diff] [review]
Expose imgRequestProxy

This lets us get an imgRequestProxy from LoadImage().
Attachment #670916 - Flags: review?(joe)
Comment on attachment 670916 [details] [diff] [review]
Expose imgRequestProxy

Review of attachment 670916 [details] [diff] [review]:
-----------------------------------------------------------------

It would be nice if the imgLoader::GetInstance() changes were split out into their own patch.

::: image/public/imgILoader.idl
@@ +65,5 @@
> +                              in nsISupports aCX,
> +                              in nsLoadFlags aLoadFlags,
> +                              in nsISupports cacheKey,
> +                              in imgIRequest aRequest,
> +                              in nsIChannelPolicy channelPolicy);

make sure this is correctly indented

@@ +89,3 @@
>                          in imgIDecoderObserver aObserver,
>                          in nsISupports cx,
>                          out nsIStreamListener aListener);

indent correctly please

::: image/src/imgRequestProxy.cpp
@@ -492,4 @@
>  
>    return NS_OK;
>  }
> -

don't delete this blank line

@@ +495,2 @@
>  NS_IMETHODIMP imgRequestProxy::Clone(imgIDecoderObserver* aObserver,
>                                       imgIRequest** aClone)

Shouldn't Clone and GetStaticRequest be renamed CloneXPCOM and GetStaticRequestXPCOM?

@@ +498,5 @@
> +    nsresult result;
> +    imgRequestProxy* proxy;
> +    result = Clone(aObserver, &proxy);
> +    *aClone = proxy;
> +    return result;

incorrect indentation

@@ +845,5 @@
>  {
> +    imgRequestProxy *proxy;
> +    nsresult result = GetStaticRequest(&proxy);
> +    *aReturn = proxy;
> +    return result;

incorrect indentation

::: image/test/unit/async_load_tests.js
@@ +45,4 @@
>    // For as long as clone notification is synchronous, we can't test the clone state reliably.
>    var listener = new ImageListener(null, function(foo, bar) { do_test_finished(); } /*getCloneStopCallback(other_listener)*/);
>    listener.synchronous = false;
> +  var clone = aRequest.cloneXPCOM(listener);

...especially considering you go ahead and *use* cloneXPCOM

::: layout/style/nsStyleStruct.h
@@ +34,4 @@
>  #include "gfxRect.h"
>  
>  class nsIFrame;
> +class imgRequestProxy;

ISTM you don't need this forward-declaration after including its header file
Attachment #670916 - Flags: review?(joe) → review+
https://hg.mozilla.org/mozilla-central/rev/82077de3f9bc
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla20

Updated

5 years ago
Depends on: 878037
You need to log in before you can comment on or make changes to this bug.