Closed
Bug 325726
Opened 19 years ago
Closed 18 years ago
some calIObserver impls are missing methods, which causes exceptions
Categories
(Calendar :: Internal Components, defect)
Calendar
Internal Components
Tracking
(Not tracked)
VERIFIED
FIXED
People
(Reporter: dbo, Assigned: dbo)
Details
Attachments
(1 file, 2 obsolete files)
9.51 KB,
patch
|
dmosedale
:
first-review+
|
Details | Diff | Splinter Review |
This avoids XPConnect exceptions when notifying (although those are currently caught and ignored).
Assignee | ||
Comment 1•19 years ago
|
||
Additionally, the patch fixes two leftovers a la "addObserver(observer, 0)", which don't hurt in JS, but are superfluous.
Attachment #210572 -
Flags: first-review?(dmose)
Assignee | ||
Updated•19 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•19 years ago
|
||
Comment on attachment 210572 [details] [diff] [review] implemting QueryInterface() + two minor cleanups does not fix all problems, will create a new one.
Attachment #210572 -
Attachment is obsolete: true
Attachment #210572 -
Flags: first-review?(dmose)
Assignee | ||
Comment 3•19 years ago
|
||
Attachment #210597 -
Flags: first-review?(dmose)
Comment 4•18 years ago
|
||
I always though xpconnect was smart, so that it did some kind of auto QI. Can you show the problem this patch is fixing?
Assignee | ||
Comment 5•18 years ago
|
||
One of the fixes in the patch (I don't remember which one) fixed a js error that has been annoying for me more than once... so I started to investigate, grepped over for all observer occurrences, fixing. Concerning QI, IMO it doesn't matter whether js can cope with calling; this is more about the future when the client code in no js. I know, this is currently not the case (for observers), but will may lead to issues in the future.
Comment 6•18 years ago
|
||
XPConnect's auto-implementation of QI for certain cases is on behalf of the callee, not the caller. So if the caller someday moves to C++, there's no issue. If these JS objects move to C++, the right time to implement QI would be then, as implementing now only bloats the code and provides no advantage.
Comment 7•18 years ago
|
||
(This couldn't possibly be overlooked at port-from-JS-to-C++ time, because attempting to port this code without adding the nsISupports method won't compile.)
Assignee | ||
Comment 8•18 years ago
|
||
@mvl/dmose: Yes, you are right, js QI can be omitted if just one interface is implemented and the wrapped js object is passed to native using the correct interface (which is most often enforced by the signature of the called method). [Whether this bloats code is IMO more a matter of taste, for me QI also clearly documents that XPCOM interface(s) are implemented, and which ones, so I commonly just code QI.] Please keep on reviewing the rest, though.
Comment 9•18 years ago
|
||
Comment on attachment 210597 [details] [diff] [review] adding lots of missing QueryInterface() functions, adding missing calIObserver methods The QIs are bloat in the sense that they will compile to JS bytecodes, so that even when just that bytecode is loaded via fastload, it'll occupy memory space but never actually be executed. You have a good point about documentation/clarify, however. How about just adding a comment that describes what interface is being implemented and points out that XPConnect will take care of the QI in that case? /cygdrive/d/pim/mozilla/mozilla_ref/calendar/resources/content/unifinder.js mozilla/calendar/resources/content/unifinder.js >--- /cygdrive/d/pim/mozilla/mozilla_ref/calendar/resources/content/unifinder.js 2006-02-03 14:48:30.197044000 +0100 >+++ mozilla/calendar/resources/content/unifinder.js 2006-02-03 14:49:02.964161600 +0100 >@@ -165,17 +165,17 @@ var unifinderObserver = { > if (!this.mInBatch) > refreshEventTree(); > }, > onDeleteItem: function(aDeletedItem) { > if (!this.mInBatch) > refreshEventTree(); > }, > onAlarm: function(aAlarmItem) {}, >- onError: function(aMessage) {}, >+ onError: function(errno, aMessage) {}, How about using aErrNo here and in unifinderToDo.js for consistency with the surrounding code? r=dmose with that tweak, and with the QIs replaced by comments as suggested above.
Attachment #210597 -
Flags: first-review?(dmose) → first-review+
Assignee | ||
Updated•18 years ago
|
Attachment #210597 -
Attachment is obsolete: true
Assignee | ||
Comment 10•18 years ago
|
||
Attachment #215387 -
Flags: first-review?(dmose)
Comment 11•18 years ago
|
||
Comment on attachment 215387 [details] [diff] [review] reworked patch r=dmose; thanks for the patch!
Attachment #215387 -
Flags: first-review?(dmose) → first-review+
Comment 12•18 years ago
|
||
Fix landed with cross-commit on both trunk and branch.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Summary: calCalendarManager.errorAnnouncer.observer needs to implement QueryInterface() → some calIObserver impls are missing methods, which causes exceptions
Comment 13•18 years ago
|
||
The bugspam monkeys have been set free and are feeding on Calendar :: Internal Components. Be afraid for your sanity!
QA Contact: general → base
Assignee | ||
Updated•17 years ago
|
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•