gPrintPreviewObs.QueryInterface should not throw NS_NOINTERFACE for nsISupports

RESOLVED FIXED

Status

--
trivial
RESOLVED FIXED
15 years ago
10 years ago

People

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

Tracking

({helpwanted})

Trunk
x86
Windows XP
helpwanted

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [good first bug])

Attachments

(1 attachment)

(Reporter)

Description

15 years ago
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]
(Reporter)

Updated

14 years ago
Assignee: guifeatures → Stefan.Borggraefe

Comment 1

14 years ago
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
(Assignee)

Comment 2

14 years ago
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.
(Assignee)

Comment 3

14 years ago
Created attachment 153395 [details] [diff] [review]
Allow QI to nsISupports
(Reporter)

Updated

14 years ago
Attachment #153395 - Flags: superreview?(neil.parkwaycc.co.uk)
Attachment #153395 - Flags: review?(caillon)

Comment 4

14 years ago
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?
(Assignee)

Comment 6

14 years ago
It needs to be checked in.
Want me to do it?  Or is it under control?
(Assignee)

Comment 8

14 years ago
Checked in --> FIXED.

Sorry for taking so long, sort of got lost. :)
Status: NEW → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → FIXED
(Reporter)

Updated

10 years ago
Component: XP Apps: GUI Features → UI Design
You need to log in before you can comment on or make changes to this bug.