Closed Bug 231892 Opened 21 years ago Closed 20 years ago

gPrintPreviewObs.QueryInterface should not throw NS_NOINTERFACE for nsISupports

Categories

(SeaMonkey :: UI Design, defect)

x86
Windows XP
defect
Not set
trivial

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: timeless, Assigned: bugzilla-mozilla-20000923)

Details

(Keywords: helpwanted, Whiteboard: [good first bug])

Attachments

(1 file)

Exception ``2147500034'' thrown from function anonymous(iid=XPComponent:{7}) in
<chrome://navigator/content/browser.js> line 189.
Stopped for thrown exception.

#0: function anonymous(iid=XPComponent:{7}) in
<chrome://navigator/content/browser.js> line 189

     QueryInterface : function(iid)
    185     {
 -  186      if (iid.equals(Components.interfaces.nsIObserver) ||
iid.equals(Components.interfaces.nsISupportsWeakReference))
 -  187       return this;
    188      
 -  189      throw Components.results.NS_NOINTERFACE;
    190     }

0001: iid.number
$[1] = [string] "{00000000-0000-0000-c000-000000000046}"
Keywords: helpwanted
Whiteboard: [good first bug]
Assignee: guifeatures → Stefan.Borggraefe
I don't really know what needs to be done here (/me feels embarrassed by [good
first bug] in the status whiteboard ;-) ).

Timeless suggested to reassign this bug to you, Silver. I hope you don't mind.
Assignee: Stefan.Borggraefe → silver
Since this is a [good first bug], I'll explain what it's about for future reference.

XPCOM objects support interfaces to describe what they do, and at the base of
this is nsISupports (very like IUnknown in MS COM). Every interface decends from it.

This means you should be able to QI any XPCOM object to the nsISupports
interface, and that includes JavaScript-implemented objects. So the change
needed here is simply adding an extra case that returns |this|, for nsISupports.
Attachment #153395 - Flags: superreview?(neil.parkwaycc.co.uk)
Attachment #153395 - Flags: review?(caillon)
Comment on attachment 153395 [details] [diff] [review]
Allow QI to nsISupports

Nit: That doesn't appear to be the prevailing brace style.

Is there a bug for fixing printPreviewProgress.js?
Attachment #153395 - Flags: superreview?(neil.parkwaycc.co.uk)
Attachment #153395 - Flags: superreview+
Attachment #153395 - Flags: review?(caillon)
Attachment #153395 - Flags: review+
Product: Core → Mozilla Application Suite
Silver, does this need to be checked in?  If not, then what's left in this bug?
It needs to be checked in.
Want me to do it?  Or is it under control?
Checked in --> FIXED.

Sorry for taking so long, sort of got lost. :)
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Component: XP Apps: GUI Features → UI Design
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: