Permalink
Browse files

Make docshell inherit from docloader; clean up related code, move toward

eliminating the nsIWebShell, nsIWebShellContainer, nsIDocumentLoader
interfaces and clarifying the other docshell-related interfaces.
r=darin, biesi, sr=jst
  • Loading branch information...
1 parent dfe254a commit 55ab8dd1191a8d0a4cb929d505910c8213bb45d1 bzbarsky%mit.edu committed Dec 8, 2004
@@ -43,6 +43,7 @@
#include "nsXPIDLString.h"
#include "nsIServiceManager.h"
#include "nsIDOMWindowInternal.h"
+#include "nsAutoPtr.h"
//*****************************************************************************
//*** nsDSURIContentListener: Object Management
@@ -209,13 +210,20 @@ nsDSURIContentListener::CanHandleContent(const char* aContentType,
NS_IMETHODIMP
nsDSURIContentListener::GetLoadCookie(nsISupports ** aLoadCookie)
{
- return mDocShell->GetLoadCookie(aLoadCookie);
+ NS_ADDREF(*aLoadCookie = NS_STATIC_CAST(nsIDocumentLoader*, mDocShell));
+ return NS_OK;
}
NS_IMETHODIMP
nsDSURIContentListener::SetLoadCookie(nsISupports * aLoadCookie)
{
- return mDocShell->SetLoadCookie(aLoadCookie);
+#ifdef DEBUG
+ nsRefPtr<nsDocLoader> cookieAsDocLoader =
+ nsDocLoader::GetAsDocLoader(aLoadCookie);
+ NS_ASSERTION(cookieAsDocLoader && cookieAsDocLoader == mDocShell,
+ "Invalid load cookie being set!");
+#endif
+ return NS_OK;
}
NS_IMETHODIMP
Oops, something went wrong.

0 comments on commit 55ab8dd

Please sign in to comment.