From f1b71c1fe815788e3071df8deac5ad5f32247813 Mon Sep 17 00:00:00 2001 From: "alex%croczilla.com" Date: Tue, 9 Jan 2007 14:21:51 +0000 Subject: [PATCH] Switch jssh to frozen linkage. Not part of default builds. --- extensions/jssh/Makefile.in | 12 +++--------- extensions/jssh/nsJSSh.cpp | 30 ++++++++++++++++++------------ extensions/jssh/nsJSSh.h | 2 +- extensions/jssh/nsJSShServer.cpp | 1 + extensions/jssh/nsJSShServer.h | 2 +- 5 files changed, 24 insertions(+), 23 deletions(-) diff --git a/extensions/jssh/Makefile.in b/extensions/jssh/Makefile.in index 73d3e7a6c888..48249072cde0 100644 --- a/extensions/jssh/Makefile.in +++ b/extensions/jssh/Makefile.in @@ -8,11 +8,9 @@ include $(DEPTH)/config/autoconf.mk MODULE = jssh XPIDL_MODULE = jssh LIBRARY_NAME = jssh -# EXPORT_LIBRARY = 1 -FORCE_SHARED_LIB= 1 +EXPORT_LIBRARY = 1 IS_COMPONENT = 1 -MODULE_NAME = nsJSShServerModule -MOZILLA_INTERNAL_API = 1 +MODULE_NAME = nsJSShModule REQUIRES = \ xpcom \ @@ -35,10 +33,9 @@ XPIDLSRCS = nsIJSShServer.idl \ $(NULL) EXTRA_DSO_LDOPTS = \ - $(XPCOM_GLUE_LIBS) \ + $(XPCOM_GLUE_LDOPTS) \ $(NSPR_LIBS) \ $(MOZ_JS_LIBS) \ - $(XPCOM_LIBS) \ $(NULL) EXTRA_COMPONENTS = nsJSShStarter.js @@ -47,9 +44,6 @@ include $(topsrcdir)/config/rules.mk DEFINES += -DJS_THREADSAFE -# XXX this doesn't work anymore; possibly because of bsmedberg's checkin for bug#2888370 or thereabouts -#DEFINES += -DXPCOM_GLUE - XPI_FILE = jssh-$(shell date +%Y%m%d)-$(OS_ARCH).xpi xpi:: diff --git a/extensions/jssh/nsJSSh.cpp b/extensions/jssh/nsJSSh.cpp index df3dd8cfb7ba..25d82ab521f1 100644 --- a/extensions/jssh/nsJSSh.cpp +++ b/extensions/jssh/nsJSSh.cpp @@ -42,11 +42,13 @@ #include "nsIXPConnect.h" #include "nsIProxyObjectManager.h" #include "nsIScriptSecurityManager.h" -#include "nsDependentString.h" #include "nsIIOService.h" #include "nsNetCID.h" #include "nsIChannel.h" #include "nsThreadUtils.h" +#include "nsServiceManagerUtils.h" +#include "nsXPCOMCIDInternal.h" +#include "nsMemory.h" //********************************************************************** // Javascript Environment @@ -463,11 +465,13 @@ NS_IMETHODIMP nsJSSh::Run() { nsCOMPtr proxied_shell; if (!NS_IsMainThread()) { - NS_GetProxyForObject(NS_PROXY_TO_MAIN_THREAD, - NS_GET_IID(nsIJSSh), - (nsIJSSh*)this, - NS_PROXY_SYNC, - getter_AddRefs(proxied_shell)); + nsCOMPtr pom = do_GetService(NS_XPCOMPROXY_CONTRACTID); + NS_ASSERTION(pom, "uh-oh, no proxy object manager!"); + pom->GetProxyForObject(NS_PROXY_TO_MAIN_THREAD, + NS_GET_IID(nsIJSSh), + (nsIJSSh*)this, + NS_PROXY_SYNC, + getter_AddRefs(proxied_shell)); } else { #ifdef DEBUG @@ -480,7 +484,7 @@ NS_IMETHODIMP nsJSSh::Run() if (mInput) { // read-eval-print loop PRUint32 bytesWritten; - if (mOutput && mProtocol != NS_LITERAL_CSTRING("plain")) + if (mOutput && !mProtocol.Equals(NS_LITERAL_CSTRING("plain"))) mOutput->Write(gWelcome, strlen(gWelcome), &bytesWritten); while (!mQuit) { @@ -522,11 +526,13 @@ NS_IMETHODIMP nsJSSh::Run() // Shutdown the current thread, which must be done from the main thread. nsCOMPtr thread = do_GetCurrentThread(); nsCOMPtr proxied_thread; - NS_GetProxyForObject(NS_PROXY_TO_MAIN_THREAD, - NS_GET_IID(nsIThread), - thread.get(), - NS_PROXY_ASYNC, - getter_AddRefs(proxied_thread)); + nsCOMPtr pom = do_GetService(NS_XPCOMPROXY_CONTRACTID); + NS_ASSERTION(pom, "uh-oh, no proxy object manager!"); + pom->GetProxyForObject(NS_PROXY_TO_MAIN_THREAD, + NS_GET_IID(nsIThread), + thread.get(), + NS_PROXY_ASYNC, + getter_AddRefs(proxied_thread)); if (proxied_thread) proxied_thread->Shutdown(); } diff --git a/extensions/jssh/nsJSSh.h b/extensions/jssh/nsJSSh.h index 6fcd97aa2474..e865986d88c2 100644 --- a/extensions/jssh/nsJSSh.h +++ b/extensions/jssh/nsJSSh.h @@ -47,7 +47,7 @@ #include "nsIJSSh.h" #include "nsIJSContextStack.h" #include "nsIPrincipal.h" -#include "nsString.h" +#include "nsStringAPI.h" #include "nsIScriptObjectPrincipal.h" #include "nsIXPCScriptable.h" diff --git a/extensions/jssh/nsJSShServer.cpp b/extensions/jssh/nsJSShServer.cpp index 8e49c46530c6..1a0d80d5fced 100644 --- a/extensions/jssh/nsJSShServer.cpp +++ b/extensions/jssh/nsJSShServer.cpp @@ -44,6 +44,7 @@ #include "nsIOutputStream.h" #include "nsThreadUtils.h" #include "nsJSSh.h" +#include "nsComponentManagerUtils.h" //********************************************************************** // ConnectionListener helper class diff --git a/extensions/jssh/nsJSShServer.h b/extensions/jssh/nsJSShServer.h index bddc2e20f70b..5af09c59d9e7 100644 --- a/extensions/jssh/nsJSShServer.h +++ b/extensions/jssh/nsJSShServer.h @@ -42,7 +42,7 @@ #include "nsIJSShServer.h" #include "nsCOMPtr.h" #include "nsIServerSocket.h" -#include "nsString.h" +#include "nsStringAPI.h" class nsJSShServer : public nsIJSShServer {