nsIWebProgress.addProgressListener documentation is wrong

RESOLVED FIXED

Status

()

Core
Embedding: APIs
RESOLVED FIXED
14 years ago
14 years ago

People

(Reporter: timeless, Assigned: Darin Fisher)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

14 years ago
The documentation says:
 77                 *          NS_INVALID_ARG - The listener passed in was
either nsnull, 
 78                 *                            or was already registered with
this progress
 79                 *                            interface.

 80                 */

 81 rpotts  1.8    void addProgressListener(in nsIWebProgressListener listener,
 82                                         in unsigned long aNotifyMask);

the code
http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/uriloader/base/nsDocLoader.cpp&rev=3.272&mark=886-887,891-892,897-898#885
does:

 886 rpotts    3.253 nsDocLoaderImpl::AddProgressListener(nsIWebProgressListener
*aListener,
 887                                                      PRUint32 aNotifyMask)

 888 mscott    3.196 {

 889 rpotts    3.206   nsresult rv;

 890 jaggernaut 3.263   nsWeakPtr listener = do_GetWeakReference(aListener);

 891 rpotts     3.253   if (!listener) {
 892                      return NS_ERROR_INVALID_ARG;

 893                    }

 894 valeski    3.224 

 895 rpotts     3.253   nsListenerInfo* info = GetListenerInfo(listener);
 896                    if (info) {

 897                      // The listener is already registered!
 898                      return NS_ERROR_FAILURE;

 899                    }

And note that NS_INVALID_ARG doesn't exist.
further, this should probably be a throws not a return.
(Reporter)

Updated

14 years ago
Blocks: 99639
(Assignee)

Comment 1

14 years ago
this documentation was fixed along with my patch for bug 99639.
Assignee: adamlock → darin
(Assignee)

Comment 2

14 years ago
marking FIXED
Status: NEW → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.