Closed
Bug 260865
Opened 20 years ago
Closed 20 years ago
Remove nsIAlertListener
Categories
(SeaMonkey :: General, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: csthomas, Assigned: csthomas)
References
()
Details
Attachments
(1 file, 3 obsolete files)
17.77 KB,
patch
|
Details | Diff | Splinter Review |
Assignee | ||
Comment 1•20 years ago
|
||
Comment 2•20 years ago
|
||
do you want to fix other issues in this interface? things that come to mind: <biesi> 1. can the listener be null <biesi> 2. can I put up an alert when a previous one is up <biesi> 3. what happens if I try 2 comments should use doxygen-style
unless there's some real reason for the listener interface, i'd rather it just use nsIObserver "put up" should be "post" or something... "has gone away" should probably be "goes away" or something...
Assignee | ||
Updated•20 years ago
|
Whiteboard: active
Assignee | ||
Updated•20 years ago
|
Summary: grammar fix → Remove nsIAlertListener
Assignee | ||
Updated•20 years ago
|
Attachment #159635 -
Attachment is obsolete: true
Assignee | ||
Comment 4•20 years ago
|
||
Doesn't touch toolkit. I'll do that in a separate patch.
Assignee | ||
Updated•20 years ago
|
Attachment #163060 -
Flags: superreview?(jag)
Attachment #163060 -
Flags: review?(neil.parkwaycc.co.uk)
Assignee | ||
Updated•20 years ago
|
Attachment #163060 -
Flags: superreview?(jag) → superreview?(dmose)
Assignee | ||
Updated•20 years ago
|
Status: NEW → ASSIGNED
Comment 5•20 years ago
|
||
I'll take a look at this later. My first nit to pick would be that I think we usually define uuids in IDL in all uppercase.
Comment 6•20 years ago
|
||
Comment on attachment 163060 [details] [diff] [review] Patch >-[scriptable, uuid(7E8B76C6-A70C-4075-81AA-D48B6152E1B4)] >+[scriptable, uuid(3a3c2953-01ee-4d9c-a102-5aa0d7bd444c)] Good catch, jag! >+ gAlertListener = window.arguments[5].QueryInterface(Components.interfaces.nsIObserver); Nit: This QI shouldn't be necessary because the argument was stored in an interface pointer which will tell the window watcher what type it is. >@@ -978,18 +978,24 @@ nsDownload::Observe(nsISupports* aSubjec > nsCAutoString path; > nsresult rv = GetFilePathUTF8(mTarget, path); > // XXX why can't nsDownload cancel itself without help from the dl manager? > if (NS_SUCCEEDED(rv)) > mDownloadManager->CancelDownload(path); > // Ignoring return value; this function will get called twice, > // and bad things happen if we return a failure code the second time. > } > >+ if (strcmp(aTopic, "alertclickcallback") == 0) { >+ // show the download manager >+ mDownloadManager->Open(nsnull, this); >+ return NS_OK; >+ } else if? (also in nsMessengerWinIntegration.cpp)
Assignee | ||
Comment 7•20 years ago
|
||
(In reply to comment #6) > (From update of attachment 163060 [details] [diff] [review]) > >-[scriptable, uuid(7E8B76C6-A70C-4075-81AA-D48B6152E1B4)] > >+[scriptable, uuid(3a3c2953-01ee-4d9c-a102-5aa0d7bd444c)] > Good catch, jag! Fixed > >+ gAlertListener = window.arguments[5].QueryInterface(Components.interfaces.nsIObserver); > Nit: This QI shouldn't be necessary because the argument was stored in an > interface pointer which will tell the window watcher what type it is. I removed the if. Since we no longer do a QI, if the argument is null, there's no problem. > > >@@ -978,18 +978,24 @@ nsDownload::Observe(nsISupports* aSubjec > > nsCAutoString path; > > nsresult rv = GetFilePathUTF8(mTarget, path); > > // XXX why can't nsDownload cancel itself without help from the dl manager? > > if (NS_SUCCEEDED(rv)) > > mDownloadManager->CancelDownload(path); > > // Ignoring return value; this function will get called twice, > > // and bad things happen if we return a failure code the second time. > > } > > > >+ if (strcmp(aTopic, "alertclickcallback") == 0) { > >+ // show the download manager > >+ mDownloadManager->Open(nsnull, this); > >+ return NS_OK; > >+ } > else if? (also in nsMessengerWinIntegration.cpp) All the ifs return (I added a return statement to the if that was missing one), and the old code didn't use else if.
Assignee | ||
Updated•20 years ago
|
Attachment #163060 -
Attachment is obsolete: true
Assignee | ||
Updated•20 years ago
|
Attachment #163060 -
Flags: superreview?(dmose)
Attachment #163060 -
Flags: superreview?
Attachment #163060 -
Flags: review?(neil.parkwaycc.co.uk)
Attachment #163060 -
Flags: review?
Assignee | ||
Updated•20 years ago
|
Attachment #163232 -
Flags: superreview?(dmose)
Attachment #163232 -
Flags: review?(neil.parkwaycc.co.uk)
Assignee | ||
Updated•20 years ago
|
Attachment #163060 -
Flags: superreview?
Attachment #163060 -
Flags: review?
Comment 8•20 years ago
|
||
Comment on attachment 163232 [details] [diff] [review] Revised patch This looks ok to me. It'd be mighty nice if you could kill those (pre-existing) tabs in nsIAlertsService.idl while you're poking around in there, and realign the arguments on the third and fourth line of showAlertNotification. No need for a new patch for that. r=jag, requesting sr= from Neil
Attachment #163232 -
Flags: superreview?(neil.parkwaycc.co.uk)
Attachment #163232 -
Flags: superreview?(dmose)
Attachment #163232 -
Flags: review?(neil.parkwaycc.co.uk)
Attachment #163232 -
Flags: review+
Comment 9•20 years ago
|
||
Comment on attachment 163232 [details] [diff] [review] Revised patch > mDownloadManager->CancelDownload(path); > // Ignoring return value; this function will get called twice, > // and bad things happen if we return a failure code the second time. >+ >+ return NS_OK; Kill that blank line, as the comment refers to the return NS_OK. I crashed this several times during testing before discovering that the parameters to showAlertNotification aren't null-checked :-( Someone should convert the w?strings to AStrings...
Attachment #163232 -
Flags: superreview?(neil.parkwaycc.co.uk) → superreview+
Assignee | ||
Comment 10•20 years ago
|
||
Attachment #163232 -
Attachment is obsolete: true
Comment 11•20 years ago
|
||
could you file a new bug about comment 2?
Updated•20 years ago
|
Comment 12•20 years ago
|
||
filed Bug 267034.
Assignee | ||
Updated•20 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 13•20 years ago
|
||
Filed bug 267089 for toolkit.
Assignee | ||
Updated•20 years ago
|
Whiteboard: active
Updated•20 years ago
|
Product: Browser → Seamonkey
You need to log in
before you can comment on or make changes to this bug.
Description
•