From 0ce696ec8a498151fac467085927e7b3c22a6f24 Mon Sep 17 00:00:00 2001 From: Doug Turner Date: Mon, 26 Jul 2010 14:53:31 -0700 Subject: [PATCH] Bug 561244 - Removes cryto object from e10s builds r=jst --HG-- extra : rebase_source : 0dc950e449866e9e1dd1d75c6bbe214031e15960 --- dom/base/nsGlobalWindow.cpp | 15 +++++++++++---- dom/base/nsGlobalWindow.h | 10 ++++++++-- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index 162bd7276c50..4f82d05da50b 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -103,7 +103,9 @@ #include "nsIHTMLDocument.h" #include "nsIDOMHTMLDocument.h" #include "nsIDOMHTMLElement.h" +#ifndef MOZ_IPC #include "nsIDOMCrypto.h" +#endif #include "nsIDOMDocument.h" #include "nsIDOM3Document.h" #include "nsIDOMNSDocument.h" @@ -388,10 +390,10 @@ static PRBool gDOMWindowDumpEnabled = PR_FALSE; static NS_DEFINE_CID(kXULControllersCID, NS_XULCONTROLLERS_CID); static const char sJSStackContractID[] = "@mozilla.org/js/xpc/ContextStack;1"; - +#ifndef MOZ_IPC static const char kCryptoContractID[] = NS_CRYPTO_CONTRACTID; static const char kPkcs11ContractID[] = NS_PKCS11_CONTRACTID; - +#endif static const char sPopStatePrefStr[] = "browser.history.allowPopState"; static PRBool @@ -1640,12 +1642,12 @@ nsGlobalWindow::SetNewDocument(nsIDocument* aDocument, NS_ENSURE_TRUE(scx, NS_ERROR_NOT_INITIALIZED); JSContext *cx = (JSContext *)scx->GetNativeContext(); - +#ifndef MOZ_IPC // clear smartcard events, our document has gone away. if (mCrypto) { mCrypto->SetEnableSmartCardEvents(PR_FALSE); } - +#endif if (!mDocument) { // First document load. @@ -2944,6 +2946,10 @@ nsGlobalWindow::GetApplicationCache(nsIDOMOfflineResourceList **aApplicationCach NS_IMETHODIMP nsGlobalWindow::GetCrypto(nsIDOMCrypto** aCrypto) { +#ifdef MOZ_IPC + return NS_ERROR_NOT_IMPLEMENTED; +#else + FORWARD_TO_OUTER(GetCrypto, (aCrypto), NS_ERROR_NOT_INITIALIZED); if (!mCrypto) { @@ -2953,6 +2959,7 @@ nsGlobalWindow::GetCrypto(nsIDOMCrypto** aCrypto) NS_IF_ADDREF(*aCrypto = mCrypto); return NS_OK; +#endif } NS_IMETHODIMP diff --git a/dom/base/nsGlobalWindow.h b/dom/base/nsGlobalWindow.h index 15d26d29efc9..55e837a7b491 100644 --- a/dom/base/nsGlobalWindow.h +++ b/dom/base/nsGlobalWindow.h @@ -83,7 +83,9 @@ #include "nsIScriptSecurityManager.h" #include "nsIEventListenerManager.h" #include "nsIDOMDocument.h" +#ifndef MOZ_IPC #include "nsIDOMCrypto.h" +#endif #include "nsIPrincipal.h" #include "nsPluginArray.h" #include "nsMimeTypeArray.h" @@ -131,6 +133,10 @@ class nsRunnable; class nsDOMOfflineResourceList; class nsGeolocation; +#ifdef MOZ_IPC +class nsIDOMCrypto; +#endif + extern nsresult NS_CreateJSTimeoutHandler(nsGlobalWindow *aWindow, PRBool *aIsInterval, @@ -789,9 +795,9 @@ protected: nsString mDefaultStatus; // index 0->language_id 1, so index MAX-1 == language_id MAX nsGlobalWindowObserver* mObserver; - +#ifndef MOZ_IPC nsCOMPtr mCrypto; - +#endif nsCOMPtr mLocalStorage; nsCOMPtr mSessionStorage;