зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1276304 - Remove unused getHiddenWindowAndJSContext function. r=bzbarsky
This commit is contained in:
Родитель
1d9c7716f5
Коммит
f8242da2fc
|
@ -29,10 +29,6 @@
|
|||
#include "nsIRequestObserver.h"
|
||||
#include "nsIEmbeddingSiteWindow.h"
|
||||
|
||||
/* For implementing GetHiddenWindowAndJSContext */
|
||||
#include "nsIScriptGlobalObject.h"
|
||||
#include "nsIScriptContext.h"
|
||||
|
||||
#include "nsAppShellService.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsThreadUtils.h"
|
||||
|
@ -857,56 +853,6 @@ nsAppShellService::GetHasHiddenPrivateWindow(bool* aHasPrivateWindow)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAppShellService::GetHiddenWindowAndJSContext(mozIDOMWindowProxy **aWindow,
|
||||
JSContext **aJSContext)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
if ( aWindow && aJSContext ) {
|
||||
*aWindow = nullptr;
|
||||
*aJSContext = nullptr;
|
||||
|
||||
if ( mHiddenWindow ) {
|
||||
// Convert hidden window to nsIDOMWindow and extract its JSContext.
|
||||
do {
|
||||
// 1. Get doc for hidden window.
|
||||
nsCOMPtr<nsIDocShell> docShell;
|
||||
rv = mHiddenWindow->GetDocShell(getter_AddRefs(docShell));
|
||||
if (NS_FAILED(rv)) break;
|
||||
if (!docShell) {
|
||||
break;
|
||||
}
|
||||
|
||||
// 2. Convert that to an nsPIDOMWindowOuter.
|
||||
nsCOMPtr<nsPIDOMWindowOuter> hiddenDOMWindow(docShell->GetWindow());
|
||||
if(!hiddenDOMWindow) break;
|
||||
|
||||
// 3. Get script global object for the window.
|
||||
nsCOMPtr<nsIScriptGlobalObject> sgo = docShell->GetScriptGlobalObject();
|
||||
if (!sgo) { rv = NS_ERROR_FAILURE; break; }
|
||||
|
||||
// 4. Get script context from that.
|
||||
nsIScriptContext *scriptContext = sgo->GetContext();
|
||||
if (!scriptContext) { rv = NS_ERROR_FAILURE; break; }
|
||||
|
||||
// 5. Get JSContext from the script context.
|
||||
JSContext *jsContext = scriptContext->GetNativeContext();
|
||||
if (!jsContext) { rv = NS_ERROR_FAILURE; break; }
|
||||
|
||||
// Now, give results to caller.
|
||||
*aWindow = hiddenDOMWindow.get();
|
||||
NS_IF_ADDREF( *aWindow );
|
||||
*aJSContext = jsContext;
|
||||
} while (0);
|
||||
} else {
|
||||
rv = NS_ERROR_FAILURE;
|
||||
}
|
||||
} else {
|
||||
rv = NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAppShellService::GetApplicationProvidedHiddenWindow(bool* aAPHW)
|
||||
{
|
||||
|
|
|
@ -104,17 +104,6 @@ interface nsIAppShellService : nsISupports
|
|||
*/
|
||||
readonly attribute mozIDOMWindowProxy hiddenPrivateDOMWindow;
|
||||
|
||||
/**
|
||||
* Return the (singleton) application hidden window as an nsIDOMWindow,
|
||||
* and, the corresponding JavaScript context pointer. This is useful
|
||||
* if you'd like to subsequently call OpenDialog on the hidden window.
|
||||
* @aHiddenDOMWindow the hidden window QI'd to type nsIDOMWindow
|
||||
* @aJSContext the corresponding JavaScript context
|
||||
*/
|
||||
[noscript]
|
||||
void getHiddenWindowAndJSContext(out mozIDOMWindowProxy aHiddenDOMWindow,
|
||||
out JSContext aJSContext);
|
||||
|
||||
/**
|
||||
* Return true if the application hidden window was provided by the
|
||||
* application. If it wasn't, the default hidden window was used. This will
|
||||
|
|
Загрузка…
Ссылка в новой задаче