Closed Bug 801061 Opened 12 years ago Closed 12 years ago

Expose imgRequestProxy

Categories

(Core :: Graphics: ImageLib, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla20

People

(Reporter: jrmuizel, Assigned: jrmuizel)

References

Details

Attachments

(1 file)

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
Closed: 12 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
Depends on: 878037
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: