Closed Bug 471981 Opened 14 years ago Closed 14 years ago

clean up window mediator initialization

Categories

(Core :: General, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jaas, Assigned: jaas)

Details

Attachments

(2 files, 1 obsolete file)

nsWindowMediator has a strange initialization system, we should clean it up to use a standard Init process for xpcom services. Same goes for the class nsAbout.
Attached patch fix v1.0 (obsolete) — Splinter Review
Attachment #355228 - Flags: review?(neil)
Comment on attachment 355228 [details] [diff] [review]
fix v1.0

I wasn't actually sure that some of the changes belong in this bug. Also I couldn't get the patch to apply locally.

>+0x1f1ce501, 0x663a, 0x11d3, { 0xb7, 0xa0, 0xbe, 0x42, 0x6e, 0x4e, 0x69, 0xbc } \

>-0x1f1ce501, 0x663a, 0x11d3, { 0xb7, 0xa0, 0xbe, 0x42, 0x6e, 0x4e, 0x69, 0xbc } \
[I wondered why this line moved]

>-#endif // nsAboutBlank_h__
>+#endif // nsAboutBlank_h_
[Actually the #define is nsAbout_h_]

>-PRInt32 nsWindowMediator::gRefCnt = 0;
You didn't remove the declaration.

>-    return enumerator->QueryInterface(NS_GET_IID(nsISimpleEnumerator), (void**) _retval);
>+    return enumerator->QueryInterface(NS_GET_IID(nsISimpleEnumerator), (void**)_retval);
[return CallQueryInterface(enumerator, _retval);]
Attachment #355228 - Flags: review?(neil)
You probably can't apply the patch because I modified this file a day ago and your source isn't new enough. New patch coming up.
Attached patch fix v1.1Splinter Review
Attachment #355228 - Attachment is obsolete: true
Attachment #355236 - Flags: review?(neil)
Attached patch fix v1.2Splinter Review
I don't see anything that actually uses nsAbout, so this patch just removes it altogether instead of fixing it up.
Attachment #355236 - Attachment is obsolete: true
Attachment #355256 - Flags: review?(neil)
Attachment #355236 - Flags: review?(neil)
Comment on attachment 355256 [details] [diff] [review]
fix v1.2

about: uses it...
Attachment #355256 - Flags: review?(neil) → review-
Comment on attachment 355236 [details] [diff] [review]
fix v1.1

>+  while (mOldestWindow)
>+    UnregisterWindow(mOldestWindow);
>+  
Nit: spaces crept on to this blank line

>   nsAppShellWindowEnumerator *enumerator;
>   if (aFrontToBack)
>     enumerator = new nsASDOMWindowFrontToBackEnumerator(aWindowType, *this);
>   else
>     enumerator = new nsASDOMWindowBackToFrontEnumerator(aWindowType, *this);
>   if (enumerator)
>-    return enumerator->QueryInterface(NS_GET_IID(nsISimpleEnumerator), (void**) _retval);
>+    return CallQueryInterface(enumerator, _retval);
> 
>   return NS_ERROR_OUT_OF_MEMORY;
Hmm... there's more than one way to return an enumerator, and the original code was pretty crummy anyway, and I should have noticed that before ;-)
Attachment #355236 - Attachment is obsolete: false
Attachment #355236 - Flags: review+
You're right, that URL does use nsAbout - but how? I don't see any references to that class, and Gecko compiles fine without it.
Attachment #355236 - Flags: superreview?(roc)
The about: protocol handler loads it by contract ID.
Attachment #355236 - Flags: superreview?(roc) → superreview+
pushed to trunk

http://hg.mozilla.org/mozilla-central/rev/3800877d845a
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.