Last Comment Bug 688238 - Move Init() arguments into the constructor
: Move Init() arguments into the constructor
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: ImageLib (show other bugs)
: unspecified
: x86 Mac OS X
: -- normal (vote)
: mozilla10
Assigned To: Jeff Muizelaar [:jrmuizel]
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-09-21 12:02 PDT by Jeff Muizelaar [:jrmuizel]
Modified: 2011-09-29 09:20 PDT (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Move Init() arguments into the constructor (16.74 KB, patch)
2011-09-21 12:02 PDT, Jeff Muizelaar [:jrmuizel]
joe: review+
Details | Diff | Review

Description Jeff Muizelaar [:jrmuizel] 2011-09-21 12:02:57 PDT
Created attachment 561535 [details] [diff] [review]
Move Init() arguments into the constructor

This makes the lifetime of the arguments more clear. i.e. that they stay the same for the lifetime of the decoder.
Comment 1 Joe Drew (not getting mail) 2011-09-22 13:41:20 PDT
Comment on attachment 561535 [details] [diff] [review]
Move Init() arguments into the constructor

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

::: modules/libpr0n/decoders/nsBMPDecoder.cpp
@@ +63,5 @@
>  #define LINE(row) ((mBIH.height < 0) ? (-mBIH.height - (row)) : ((row) - 1))
>  #define PIXEL_OFFSET(row, col) (LINE(row) * mBIH.width + col)
>  
> +nsBMPDecoder::nsBMPDecoder(RasterImage *aImage, imgIDecoderObserver* aObserver) :
> +    Decoder(aImage, aObserver)

: on the same line as Decoder(. Do this throughout.

::: modules/libpr0n/src/Decoder.h
@@ +56,5 @@
>    /**
>     * Initialize an image decoder. Decoders may not be re-initialized.
>     *
>     * @param aContainer The image container to decode to.
>     * @param aObserver The observer for decode notification events.

This documentation needs to be moved to the constructor.

@@ +68,5 @@
>     * Initializes a decoder whose aImage and aObserver is already being used by a
>     * parent decoder. Decoders may not be re-initialized.
>     *
>     * @param aContainer The image container to decode to.
>     * @param aObserver The observer for decode notification events.

Ditto.
Comment 2 Michael Wu [:mwu] 2011-09-29 01:27:09 PDT
https://hg.mozilla.org/mozilla-central/rev/cd9a14388367

Note You need to log in before you can comment on or make changes to this bug.