Closed Bug 68187 Opened 19 years ago Closed 19 years ago

nsIWebBrowser::AddBrowserListener() needs to take an nsIWeakReference

Categories

(Core Graveyard :: Embedding: APIs, defect, P1, major)

x86
Windows 2000

Tracking

(Not tracked)

VERIFIED FIXED
mozilla0.9

People

(Reporter: jud, Assigned: jud)

Details

Attachments

(6 files)

right now we have the impl requirement that the listener impl nsIWeakReference. 
this should be reflected by replacing nsISupports w/ nsIWeakReference in the 
method signature.
Severity: normal → major
Priority: -- → P1
Target Milestone: --- → mozilla0.9
Blocks: 64833
This all looks good, except that you should prefer direct-initialization over
copy-initialization, that is, prefer constructions

  nsCOMPtr<nsIWeakReference> listener(do_QueryInterface(...));
  // ...
  nsCOMPtr<nsIWeakReference> thisListener(do_QueryInterface(listener));

over the form with '='.  After you fix that, sr=scc.

I've updated the patches as the direct QI to a nsIWeakReference was failing. I 
needed to be using NS_GetWeakReference (which I now am). I've also added a patch 
to viewer so it can use the new mechanism as well.
More evidence, I guess, that I really need to provide a |do_GetWeakReference|.
This still isn't right.  To get a weak reference you need to say

  nsCOMPtr<nsIWeakReference> weakling( dont_AddRef(NS_GetWeakReference(...)) );
Now I buy it.  One of us should file a bug, though, that |do_GetWeakReference|
is wanted.  sr=scc
The patch to CBrowserShell.cpp in patch id=25206 didn't quite compile - now it does.
thanks for the mac check conrad. these changes (including conrad's mods) are in.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
No longer blocks: 64833
Correction: Changing QA contact for the Embed API bugs to David Epstein.
QA Contact: mdunn → depstein
in nsIWebBrowser.idl, we see that the listener accepts a weak reference:
void addWebBrowserListener(in nsIWeakReference aListener, in nsIIDRef aIID);
Status: RESOLVED → VERIFIED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.