From 78ba24c2dfd0547d32a8dd1f6eef25eb290e54bf Mon Sep 17 00:00:00 2001 From: "danm%netscape.com" Date: Mon, 18 Mar 2002 23:33:49 +0000 Subject: [PATCH] removing unused function InitializeDocshell. bug 130944 r=jst,timeless a=asa git-svn-id: svn://10.0.0.236/trunk@116799 18797224-902f-48f8-a5cc-f745e15eee43 --- .../windowwatcher/src/nsWindowWatcher.cpp | 37 ------------------- .../windowwatcher/src/nsWindowWatcher.h | 2 - .../tests/viewer/nsWebBrowserChrome.cpp | 6 +-- .../xpfe/appshell/src/nsContentTreeOwner.cpp | 6 +-- 4 files changed, 6 insertions(+), 45 deletions(-) diff --git a/mozilla/embedding/components/windowwatcher/src/nsWindowWatcher.cpp b/mozilla/embedding/components/windowwatcher/src/nsWindowWatcher.cpp index b5317b25fa6..b0d83e14bed 100644 --- a/mozilla/embedding/components/windowwatcher/src/nsWindowWatcher.cpp +++ b/mozilla/embedding/components/windowwatcher/src/nsWindowWatcher.cpp @@ -1314,43 +1314,6 @@ nsWindowWatcher::FindItemWithName( return rv; } -/* Force docshell initialization. This will allow, for instance, script - executed immediately following window.open to access the docshell - (which can be something as straightforward as newWindow.document.write, - or something more indirect, such as window.resizeTo.) - This step is not necessary in Mozilla, since its content docshells - are loaded during XUL chrome docshell initialization (though it may - be desirable; to be determined). But this step is important for probably - all embedding apps. */ -/* Note this is not in use at time of writing (7 Nov 01), its functionality - replaced by lazy instantiation of the content viewer in nsDocShell - and by the DOM document in nsGlobalWindow. This method to be removed - when we're quite sure the lazy way will work. */ -nsresult -nsWindowWatcher::InitializeDocshell(nsIWebBrowserChrome *aBrowserChrome) -{ -return NS_OK; - nsCOMPtr docshell; - - // embedded window path: docshell corresponding to the primary content - nsCOMPtr browserWindow(do_GetInterface(aBrowserChrome)); - if (browserWindow) { - nsCOMPtr sgo(do_QueryInterface(browserWindow)); - if (sgo) - sgo->GetDocShell(getter_AddRefs(docshell)); - } - // XUL Window path (should we decide this to be useful) - // XXX: teach nsContentTreeOwner to give up its nsIDocShell - if (!docshell) { - } - - // asking mozilla's docshell for its document will force it to generate one - if (docshell) - nsCOMPtr domdoc(do_GetInterface(docshell)); - - return NS_OK; -} - /* Fetch the nsIDOMWindow corresponding to the given nsIDocShellTreeItem. This forces the creation of a script context, if one has not already been created. Note it also sets the window's opener to the parent, diff --git a/mozilla/embedding/components/windowwatcher/src/nsWindowWatcher.h b/mozilla/embedding/components/windowwatcher/src/nsWindowWatcher.h index db1bb94768a..7a578b35233 100644 --- a/mozilla/embedding/components/windowwatcher/src/nsWindowWatcher.h +++ b/mozilla/embedding/components/windowwatcher/src/nsWindowWatcher.h @@ -90,8 +90,6 @@ private: nsresult FindItemWithName(const PRUnichar *aName, nsIDocShellTreeItem **aFoundItem); - nsresult InitializeDocshell(nsIWebBrowserChrome *aChromeWindow); - static JSContext *GetJSContextFromWindow(nsIDOMWindow *aWindow); static JSContext *GetJSContextFromCallStack(); static nsresult URIfromURL(const char *aURL, diff --git a/mozilla/webshell/tests/viewer/nsWebBrowserChrome.cpp b/mozilla/webshell/tests/viewer/nsWebBrowserChrome.cpp index 59ad27b2394..b846ac7680e 100644 --- a/mozilla/webshell/tests/viewer/nsWebBrowserChrome.cpp +++ b/mozilla/webshell/tests/viewer/nsWebBrowserChrome.cpp @@ -136,9 +136,9 @@ NS_IMETHODIMP nsWebBrowserChrome::SetWebBrowser(nsIWebBrowser* aWebBrowser) NS_IMETHODIMP nsWebBrowserChrome::GetWebBrowser(nsIWebBrowser** aWebBrowser) { // Unimplemented, and probably will remain so; xpfe windows have docshells, - // not webbrowsers. Note that we're relying on this to differentiate - // embedded instances from Mozilla in nsWindowWatcher::InitializeDocshell. - // (Don't let me stop you, but keep that in mind.) + // not webbrowsers. + NS_ENSURE_ARG_POINTER(aWebBrowser); + *aWebBrowser = 0; return NS_ERROR_FAILURE; } diff --git a/mozilla/xpfe/appshell/src/nsContentTreeOwner.cpp b/mozilla/xpfe/appshell/src/nsContentTreeOwner.cpp index 0768453160f..738a983df91 100644 --- a/mozilla/xpfe/appshell/src/nsContentTreeOwner.cpp +++ b/mozilla/xpfe/appshell/src/nsContentTreeOwner.cpp @@ -394,9 +394,9 @@ NS_IMETHODIMP nsContentTreeOwner::SetWebBrowser(nsIWebBrowser* aWebBrowser) NS_IMETHODIMP nsContentTreeOwner::GetWebBrowser(nsIWebBrowser** aWebBrowser) { // Unimplemented, and probably will remain so; xpfe windows have docshells, - // not webbrowsers. Note that we're relying on this to differentiate - // embedded instances from Mozilla in nsWindowWatcher::InitializeDocshell. - // (Don't let me stop you, but keep that in mind.) + // not webbrowsers. + NS_ENSURE_ARG_POINTER(aWebBrowser); + *aWebBrowser = 0; return NS_ERROR_FAILURE; }