I'm puzzled about the nsISecurityCheckedComponent vs. nsIDOMClassInfo. Could you elaborate on that one?
(From Alex: Perhaps in a later blog entry. Both need to be documented on DevMo. Drop me an e-mail sometime in the next few days, not today, and I'll see what I can do.)
Posted by Axel Hecht at February 12, 2006 5:18 AM
#ifdef DEBUG
const char* realHash = NS_LossyConvertUTF16toASCII(hashKey).get();
printf("hashKey: '%s'\n", realHash);
#endif
For some strings it may be simpler than this; all the nsC*String classes as far as I know let you get away with this (at least, since 2004 and Darin's string code update):
nsCAutoString foo = NS_LITERAL_CSTRING("foo");
printf("foo: %s\n", foo.get());
Presumably you were working with |PRUnichar| strings far more than with |char| strings and thus this wouldn't have been useful in your case, but the last time I wrote any major code I was working with C strings the entire time and found it invaluable.
Posted by Jeff Walden at February 12, 2006 6:30 AM(By the way, I'm totally unclear why it's happening, but I'm being told I'm a first-time commenter every time I say something here, so all my posts seem to be delayed. Either that message should be changed to be more accurate or the configuration option should be fixed so my comments actually do get posted without delay. And by the way, feel free to remove this comment after dealing with it, if you so choose. :-) )
(From Alex: No, it's quite deliberate, actually. I had to change my blog settings so that I personally approve all comments that show up in public. That blocks the spam from getting through.)
Posted by Jeff Walden at February 12, 2006 6:31 AM>#ifdef DEBUG
>const char* realHash = >NS_LossyConvertUTF16toASCII(hashKey).get();
>printf("hashKey: '%s'\n", realHash);
>#endif
Actually, that's wrong. You need to either not use the temporary ptr, or have the S_LossyConvertUTF16toASCII object live at least as long. As written, the code can crash depending on allocation patterns.
Posted by Boris at February 12, 2006 11:42 AM