Freeze nsIArray

RESOLVED FIXED in mozilla1.9alpha1

Status

()

P2
normal
RESOLVED FIXED
14 years ago
13 years ago

People

(Reporter: jhpedemonte, Assigned: benjamin)

Tracking

Trunk
mozilla1.9alpha1
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

14 years ago
Freeze nsIArray.

According to http://www.mozilla.org/projects/embedding/HowToFreeze.html, we
should have only one interface per IDL file.  So this needs to be split into
nsIArray.idl and nsIMutableArray.
(Reporter)

Updated

14 years ago
Blocks: 268520
(Assignee)

Updated

13 years ago
Assignee: darin → benjamin
Priority: -- → P2
Target Milestone: --- → mozilla1.9alpha
(Assignee)

Comment 1

13 years ago
Created attachment 218099 [details] [diff] [review]
Separate nsIMutableArray.idl and cleanup, rev. 1

This separates nsIMutableArray into its own IDL; moves the comptr-helpers to the glue; removes the NS_NewArray internal methods which are either poorly used or easy to replace using createinstance; fixes up treewide #includes and usage of NS_NewArray.
Attachment #218099 - Flags: review?(darin)

Comment 2

13 years ago
Comment on attachment 218099 [details] [diff] [review]
Separate nsIMutableArray.idl and cleanup, rev. 1

>Index: gfx/src/x11shared/nsFT2FontCatalog.cpp

>+  nsCOMPtr<nsIMutableArray> entries =
>+    do_CreateInstance(NS_ARRAY_CONTRACTID);
>   if (!entries)
>     return NS_ERROR_OUT_OF_MEMORY;

Well, that's not exactly true.  I see several other cases where
do_CreateInstance failure is treated as an OOM condition.


>Index: mailnews/base/src/nsMsgFolderDataSource.cpp

>   nsresult rv;
> 
>   nsCOMPtr<nsIMsgFolder> folder(do_QueryInterface(source, &rv));
>   if (NS_FAILED(rv)) return rv;
> 
>-  nsCOMPtr<nsIMutableArray> cmds;
>-  NS_NewArray(getter_AddRefs(cmds));
>+  nsCOMPtr<nsIMutableArray> cmds =
>+    do_CreateInstance(NS_ARRAY_CONTRACTID);
>   if (!cmds) return rv;

This seems to return a success code if it cannot instantiate the array.
Hmm...


>Index: modules/oji/src/nsJVMConfigManagerUnix.cpp

>+    nsCOMPtr<nsIMutableArray> array =
>+        do_CreateInstance(NS_ARRAY_CONTRACTID);
>+    NS_ENSURE_TRUE(array, NS_ERROR_OUT_OF_MEMORY);

OOM, really?

NS_ENSURE_STATE(array) might be better.


>Index: xpcom/ds/nsIMutableArray.idl

>+ */
>+
>+[scriptable, uuid(af059da0-c85b-40ec-af07-ae4bfdc192cc)]

Please kill the gap here.  It causes doxygen trouble.


r=darin
Attachment #218099 - Flags: review?(darin) → review+
(Assignee)

Comment 3

13 years ago
Fixed on trunk, with a couple additional platform- or configuration-specific bustage fixes.
Status: NEW → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → FIXED
This checkin broke XULRunner on Windows (at least). I know our tinderbox (solaria) has been busted for a while but you can see that the reason for the bustage switched right after this was checked in.

From http://tinderbox.mozilla.org/showlog.cgi?log=XULRunner/1144862700.16448.gz -

c:/builds/tinderbox/XR-Trunk/WINNT_5.2_Depend/mozilla/toolkit/library/dlldeps.cpp(61) : fatal error C1083: Cannot open include file: 'nsArray.h': No such file or directory

I'm also seeing this on my machine.

P.S. What's the deal with solaria being busted for so long? Is that a cairo thing?

Comment 6

13 years ago
I believe this checkin also broke the spatial navigation extension, please see bug 333873.
You need to log in before you can comment on or make changes to this bug.