If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

nsIDOMWindowInternal::GetPrompter doesn't work

VERIFIED INVALID

Status

()

Core
XUL
VERIFIED INVALID
17 years ago
17 years ago

People

(Reporter: Dan M, Assigned: Dan M)

Tracking

Trunk
mozilla0.9
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Assignee)

Description

17 years ago
nsIDOMWindowInternal::GetPrompter is used in at least half a dozen places by at 
least PSM and Wallet. It's broken.
(Assignee)

Updated

17 years ago
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9
(Assignee)

Comment 1

17 years ago
to fix:

Index: ./docshell/base/nsDocShell.cpp
===================================================================
RCS file: /cvsroot/mozilla/docshell/base/nsDocShell.cpp,v
retrieving revision 1.249
diff -u -r1.249 nsDocShell.cpp
--- nsDocShell.cpp	2001/03/13 06:19:39	1.249
+++ nsDocShell.cpp	2001/03/14 00:08:31
@@ -228,7 +228,10 @@
    }
    else if(aIID.Equals(NS_GET_IID(nsIPrompt)))
    {
-        nsCOMPtr<nsIPrompt> prompter(do_GetInterface(mTreeOwner));
+        nsCOMPtr<nsIPrompt> prompter;
+        nsCOMPtr<nsIInterfaceRequestor> 
treeRequestor(do_GetInterface(mTreeOwner));
+        if (treeRequestor)
+          treeRequestor->GetInterface(NS_GET_IID(nsIPrompt), 
getter_AddRefs(prompter));
         if (prompter)
         {
             *aSink = prompter;
Index: ./dom/src/base/nsGlobalWindow.cpp
===================================================================
RCS file: /cvsroot/mozilla/dom/src/base/nsGlobalWindow.cpp,v
retrieving revision 1.381
diff -u -r1.381 nsGlobalWindow.cpp
--- nsGlobalWindow.cpp	2001/03/13 11:37:06	1.381
+++ nsGlobalWindow.cpp	2001/03/14 00:08:29
@@ -801,14 +801,22 @@
 
 NS_IMETHODIMP GlobalWindowImpl::GetPrompter(nsIPrompt** aPrompt)
 {
+  NS_ENSURE_ARG_POINTER(aPrompt);
+  *aPrompt = nsnull;
   if (!mDocShell)
     return NS_ERROR_FAILURE;
 
-  nsCOMPtr<nsIPrompt> prompter(do_GetInterface(mDocShell));
-  NS_ENSURE_TRUE(prompter, NS_ERROR_NO_INTERFACE);
- 
-  NS_ADDREF(*aPrompt = prompter);
-  return NS_OK;
+  nsCOMPtr<nsIPrompt> prompter;
+  nsCOMPtr<nsIInterfaceRequestor> docRequest(do_GetInterface(mDocShell));
+  if (docRequest)
+    docRequest->GetInterface(NS_GET_IID(nsIPrompt), getter_AddRefs(prompter));
+ 
+  if (prompter) {
+    *aPrompt = prompter;
+    NS_ADDREF(*aPrompt);
+    return NS_OK;
+  }
+  return NS_ERROR_NO_INTERFACE;
 }
 
 NS_IMETHODIMP GlobalWindowImpl::GetMenubar(nsIDOMBarProp** aMenubar)
(Assignee)

Comment 2

17 years ago
Momentary (well, weeks long) lapse of reason.
Status: ASSIGNED → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → INVALID

Comment 3

17 years ago
Okeley-dokely
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.