Bug 563462 - Remove Photon bits from toolkit/ r=Mossop
authorRob Arnold <robarnold@cmu.edu>
Wed, 12 May 2010 14:31:24 -0400
changeset 42223 d3a42a17157bbd1a492296bbebee28116551a198
parent 42222 b3bae06509be935cb47334d353cb7c3b8e628d0e
child 42224 f666d281adf38bc0b016f1396d4a3288d510ec0d
push idunknown
push userunknown
push dateunknown
reviewersMossop
bugs563462
milestone1.9.3a5pre
Bug 563462 - Remove Photon bits from toolkit/ r=Mossop
toolkit/components/filepicker/Makefile.in
toolkit/components/remote/Makefile.in
toolkit/components/remote/nsPhRemoteService.cpp
toolkit/components/remote/nsPhRemoteService.h
toolkit/content/widgets/browser.xml
toolkit/library/libxul-config.mk
toolkit/library/nsStaticXULComponents.cpp
toolkit/toolkit-makefiles.sh
toolkit/xre/nsAppRunner.cpp
toolkit/xre/nsSigHandlers.cpp
--- a/toolkit/components/filepicker/Makefile.in
+++ b/toolkit/components/filepicker/Makefile.in
@@ -39,15 +39,15 @@
 DEPTH     = ../../..
 topsrcdir = @top_srcdir@
 srcdir    = @srcdir@
 VPATH     = @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 ifdef MOZ_XUL
-ifeq (,$(filter qt beos os2 photon cocoa windows,$(MOZ_WIDGET_TOOLKIT)))
+ifeq (,$(filter qt beos os2 cocoa windows,$(MOZ_WIDGET_TOOLKIT)))
 DIRS = public src
 endif
 endif
 
 include $(topsrcdir)/config/rules.mk
 
--- a/toolkit/components/remote/Makefile.in
+++ b/toolkit/components/remote/Makefile.in
@@ -53,20 +53,16 @@ LIBXUL_LIBRARY = 1
 
 
 XPIDLSRCS = nsIRemoteService.idl
 
 ifneq (,$(filter gtk2,$(MOZ_WIDGET_TOOLKIT)))
 CPPSRCS += nsGTKRemoteService.cpp
 endif
 
-ifeq (photon,$(MOZ_WIDGET_TOOLKIT))
-CPPSRCS += nsPhRemoteService.cpp
-endif
-
 ifeq (qt,$(MOZ_WIDGET_TOOLKIT))
 CPPSRCS += nsQtRemoteService.cpp
 endif
 
 include $(topsrcdir)/config/rules.mk
 
 EXTRA_DSO_LDOPTS += $(MOZ_COMPONENT_LIBS) $(TK_LIBS)
 CXXFLAGS += $(TK_CFLAGS)
deleted file mode 100644
--- a/toolkit/components/remote/nsPhRemoteService.cpp
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * The contents of this file are subject to the Mozilla Public
- * License Version 1.1 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.mozilla.org/MPL/
- * 
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- * 
- * The Original Code is mozilla.org code.
- * 
- * The Initial Developer of the Original Code is Christopher Blizzard.
- * Portions created by Christopher Blizzard are Copyright (C)
- * Christopher Blizzard.  All Rights Reserved.
- * 
- * Contributor(s):
- *   Adrian Mardare <amardare@qnx.com>
- *   Max Feil <mfeil@qnx.com>
- */
-
-#include <stdlib.h>
-#include <nsIWidget.h>
-#include <nsCOMPtr.h>
-#include "nsIGenericFactory.h"
-#include "nsPhRemoteService.h"
-#include "nsIServiceManager.h"
-#include "nsCRT.h"
-
-#include "nsICommandLineRunner.h"
-#include "nsXULAppAPI.h"
-
-#include <Pt.h>
-
-NS_IMPL_QUERY_INTERFACE2(nsPhRemoteService,
-                         nsIRemoteService,
-                         nsIObserver)
-
-NS_IMETHODIMP_(nsrefcnt)
-nsPhRemoteService::AddRef()
-{
-  return 1;
-}
-
-NS_IMETHODIMP_(nsrefcnt)
-nsPhRemoteService::Release()
-{
-  return 1;
-}
-
-NS_IMETHODIMP
-nsPhRemoteService::Startup(const char* aAppName, const char* aProfileName)
-{
-  NS_ASSERTION(aAppName, "Don't pass a null appname!");
-
-  if (mIsInitialized)
-    return NS_ERROR_ALREADY_INITIALIZED;
-
-  mIsInitialized = PR_TRUE;
-  mAppName = aAppName;
-  ToLowerCase(mAppName);
-
-  HandleCommandsFor(nsnull, nsnull);
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsPhRemoteService::RegisterWindow(nsIDOMWindow* aWindow)
-{
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsPhRemoteService::Shutdown()
-{
-  if (!mIsInitialized)
-    return NS_ERROR_NOT_INITIALIZED;
-
-  mIsInitialized = PR_FALSE;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsPhRemoteService::Observe(nsISupports* aSubject,
-                            const char *aTopic,
-                            const PRUnichar *aData)
-{
-  // This can be xpcom-shutdown or quit-application, but it's the same either
-  // way.
-  Shutdown();
-  return NS_OK;
-}
-
-#define MOZ_REMOTE_MSG_TYPE					100
-
-static void const * RemoteMsgHandler( PtConnectionServer_t *connection, void *user_data,
-    		unsigned long type, void const *msg, unsigned len, unsigned *reply_len )
-{
-    nsresult rv;
-
-	if( type != MOZ_REMOTE_MSG_TYPE ) return NULL;
-
-	/* we are given strings and we reply with strings */
-	char *response = NULL;
-
-	// parse the command
-    nsCOMPtr<nsICommandLineRunner> cmdline
-      (do_CreateInstance("@mozilla.org/toolkit/command-line;1", &rv));
-    if (!NS_FAILED(rv)) {
-
-      // 1) Make sure that it looks remotely valid with parens
-      // 2) Treat ping() immediately and specially
-
-      nsCAutoString command((char *)msg);
-      PRInt32 p1, p2;
-      p1 = command.FindChar('(');
-      p2 = command.FindChar(')');
-
-      if (p1 != kNotFound && p2 != kNotFound && p1 != 0 && p2 >= p1) {
-        command.Truncate(p1);
-        command.Trim(" ", PR_TRUE, PR_TRUE);
-        ToLowerCase(command);
-
-        //printf("Processing xremote command: %s\n", command.get());
-
-        if (!command.EqualsLiteral("ping")) {
-          char* argv[3] = {"dummyappname", "-remote", (char *)msg};
-          rv = cmdline->Init(3, argv, nsnull, nsICommandLine::STATE_REMOTE_EXPLICIT);
-          if (!NS_FAILED(rv)) {
-            rv = cmdline->Run();
-            if (NS_ERROR_ABORT == rv)
-              response = "500 command not parseable";
-            if (NS_FAILED(rv))
-              response = "509 internal error";
-	      } else
-            response = "509 internal error";
-        }
-      } else
-        response = "500 command not parseable";
-	} else
-      response = "509 internal error";
-
-	PtConnectionReply( connection, response ? strlen(response) : 0, response );
-
-	return ( void * ) 1; /* return any non NULL value to indicate we handled the message */
-}
-
-static void client_connect( PtConnector_t *cntr, PtConnectionServer_t *csrvr, void *data )
-{
-	static PtConnectionMsgHandler_t handlers[] = { { 0, RemoteMsgHandler } };
-	PtConnectionAddMsgHandlers( csrvr, handlers, sizeof(handlers)/sizeof(handlers[0]) );
-}
-
-
-void
-nsPhRemoteService::HandleCommandsFor( nsIWidget *aWidget, nsIWeakReference* aWindow )
-{
-	static PRBool ConnectorCreated = PR_FALSE;
-
-///* ATENTIE */ printf( "aProgram=%s aProfile=%s aWidget=%p\n", aProgram?aProgram:"NULL", aProfile?aProfile:"NULL", aWidget );
-
-	if( !ConnectorCreated ) {
-		char RemoteServerName[128];
-		sprintf( RemoteServerName, "%s_RemoteServer", (char *) mAppName.get() );
-		/* create a connector for the remote control */
-		PtConnectorCreate( RemoteServerName, client_connect, NULL );
-		ConnectorCreated = PR_TRUE;
-		}
-  return;
-}
-
-// {C0773E90-5799-4eff-AD03-3EBCD85624AC}
-#define NS_REMOTESERVICE_CID \
-  { 0xc0773e90, 0x5799, 0x4eff, { 0xad, 0x3, 0x3e, 0xbc, 0xd8, 0x56, 0x24, 0xac } }
-
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsPhRemoteService)
-
-static const nsModuleComponentInfo components[] =
-{
-  { "Remote Service",
-    NS_REMOTESERVICE_CID,
-    "@mozilla.org/toolkit/remote-service;1",
-    nsPhRemoteServiceConstructor
-  }
-};
-
-NS_IMPL_NSGETMODULE(RemoteServiceModule, components)
deleted file mode 100644
--- a/toolkit/components/remote/nsPhRemoteService.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Christopher Blizzard. Portions created by Christopher Blizzard are Copyright (C) Christopher Blizzard.  All Rights Reserved.
- * Portions created by the Initial Developer are Copyright (C) 2001
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Adrian Mardare <amardare@qnx.com>
- *   Max Feil       <mfeil@qnx.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#ifndef __nsPhRemoteService_h__
-#define __nsPhRemoteService_h__
-
-#include "nsIRemoteService.h"
-#include "nsIObserver.h"
-#include "nsString.h"
-
-class nsIWeakReference;
-
-class nsPhRemoteService : public nsIRemoteService,
-                          public nsIObserver
-{
-public:
-  // We will be a static singleton, so don't use the ordinary methods.
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSIREMOTESERVICE
-  NS_DECL_NSIOBSERVER
-
-  nsPhRemoteService() { mIsInitialized = PR_FALSE; }
-
-private:
-  ~nsPhRemoteService() { }
-
-  void HandleCommandsFor(nsIWidget *aWidget,
-                         nsIWeakReference* aWindow);
-  PRBool mIsInitialized;
-  nsCString mAppName;
-
-};
-
-#endif /* __nsPhRemoteService_h__ */
--- a/toolkit/content/widgets/browser.xml
+++ b/toolkit/content/widgets/browser.xml
@@ -790,17 +790,17 @@
               }
             }
 
             this._autoScrollPopup.addEventListener("popuphidden", this, true);
 
             // we need these attributes so themers don't need to create per-platform packages
             if (screen.colorDepth > 8) { // need high color for transparency
               // Exclude second-rate platforms
-              this._autoScrollPopup.setAttribute("transparent", !/BeOS|OS\/2|Photon/.test(navigator.appVersion));
+              this._autoScrollPopup.setAttribute("transparent", !/BeOS|OS\/2/.test(navigator.appVersion));
               // Enable translucency on Windows and Mac
               this._autoScrollPopup.setAttribute("translucent", /Win|Mac/.test(navigator.platform));
             }
 
             // this is a list of overflow property values that allow scrolling
             const scrollingAllowed = ['scroll', 'auto'];
 
             // go upward in the DOM and find any parent element that has a overflow
--- a/toolkit/library/libxul-config.mk
+++ b/toolkit/library/libxul-config.mk
@@ -231,17 +231,17 @@ endif
 
 ifdef MOZ_RDF
 COMPONENT_LIBS += \
 	rdf \
 	windowds \
 	$(NULL)
 endif
 
-ifeq (,$(filter qt beos os2 photon cocoa windows,$(MOZ_WIDGET_TOOLKIT)))
+ifeq (,$(filter qt beos os2 cocoa windows,$(MOZ_WIDGET_TOOLKIT)))
 ifdef MOZ_XUL
 COMPONENT_LIBS += fileview
 DEFINES += -DMOZ_FILEVIEW
 endif
 endif
 
 ifdef MOZ_STORAGE
 COMPONENT_LIBS += storagecomps
@@ -309,20 +309,16 @@ COMPONENT_LIBS += wdgtos2
 endif
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 COMPONENT_LIBS += widget_mac
 endif
 ifeq (qt,$(MOZ_WIDGET_TOOLKIT))
 COMPONENT_LIBS += widget_qt
 endif
 
-ifdef MOZ_ENABLE_PHOTON
-COMPONENT_LIBS += widget_photon
-endif
-
 ifdef ACCESSIBILITY
 COMPONENT_LIBS += accessibility
 endif
 
 ifdef MOZ_ENABLE_XREMOTE
 COMPONENT_LIBS += remoteservice
 endif
 
--- a/toolkit/library/nsStaticXULComponents.cpp
+++ b/toolkit/library/nsStaticXULComponents.cpp
@@ -74,18 +74,16 @@
 #elif defined(XP_MACOSX)
 #  define WIDGET_MODULES MODULE(nsWidgetMacModule)
 #elif defined(XP_BEOS)
 #  define WIDGET_MODULES MODULE(nsWidgetBeOSModule)
 #elif defined(XP_OS2)
 #  define WIDGET_MODULES MODULE(nsWidgetOS2Module)
 #elif defined(MOZ_WIDGET_GTK2)
 #  define WIDGET_MODULES MODULE(nsWidgetGtk2Module)
-#elif defined(MOZ_WIDGET_PHOTON)
-#  define WIDGET_MODULES MODULE(nsWidgetPhModule)
 #elif defined(MOZ_WIDGET_QT)
 #  define WIDGET_MODULES MODULE(nsWidgetQtModule)
 #else
 #  error Unknown widget module.
 #endif
 
 #ifdef ICON_DECODER
 #define ICON_MODULE MODULE(nsIconDecoderModule)
--- a/toolkit/toolkit-makefiles.sh
+++ b/toolkit/toolkit-makefiles.sh
@@ -487,17 +487,16 @@ MAKEFILES_webshell="
 MAKEFILES_widget="
   widget/Makefile
   widget/public/Makefile
   widget/src/Makefile
   widget/src/beos/Makefile
   widget/src/build/Makefile
   widget/src/gtk2/Makefile
   widget/src/gtkxtbin/Makefile
-  widget/src/photon/Makefile
   widget/src/cocoa/Makefile
   widget/src/os2/Makefile
   widget/src/windows/Makefile
   widget/src/xpwidgets/Makefile
 "
 
 MAKEFILES_xpcom="
   xpcom/string/Makefile
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -170,21 +170,17 @@
 
 #ifdef XP_MACOSX
 #include "nsILocalFileMac.h"
 #include "nsCommandLineServiceMac.h"
 #endif
 
 // for X remote support
 #ifdef MOZ_ENABLE_XREMOTE
-#ifdef MOZ_WIDGET_PHOTON
-#include "PhRemoteClient.h"
-#else
 #include "XRemoteClient.h"
-#endif
 #include "nsIRemoteService.h"
 #endif
 
 #ifdef NS_TRACE_MALLOC
 #include "nsTraceMalloc.h"
 #endif
 
 #if defined(DEBUG) && defined(XP_WIN32)
--- a/toolkit/xre/nsSigHandlers.cpp
+++ b/toolkit/xre/nsSigHandlers.cpp
@@ -74,63 +74,31 @@
 #include <be/app/Application.h>
 #include <string.h>
 #include "nsCOMPtr.h"
 #include "nsIServiceManager.h"
 #include "nsIAppStartup.h"
 #include "nsToolkitCompsCID.h"
 #endif
 
-#ifdef MOZ_WIDGET_PHOTON
-#include <photon/PhProto.h>
-#endif
-
 static char _progname[1024] = "huh?";
 static unsigned int _gdb_sleep_duration = 300;
 
 #ifdef MOZ_IPC
 // NB: keep me up to date with the same variable in
 // ipc/chromium/chrome/common/ipc_channel_posix.cc
 static const int kClientChannelFd = 3;
 #endif
 
 #if defined(LINUX) && defined(DEBUG) && \
       (defined(__i386) || defined(__x86_64) || defined(PPC))
 #define CRAWL_STACK_ON_SIGSEGV
 #endif
 
-#ifdef MOZ_WIDGET_PHOTON
-void abnormal_exit_handler(int signum)
-{
-  /* Free any shared memory that has been allocated */
-  PgShmemCleanup();
-
-#if defined(DEBUG)
-  if (    (signum == SIGSEGV)
-       || (signum == SIGILL)
-       || (signum == SIGABRT)
-       || (signum == SIGFPE)
-     )
-  {
-    printf("prog = %s\npid = %d\nsignal = %s\n", 
-           _progname, getpid(), strsignal(signum));
-
-    printf("Sleeping for %d seconds.\n",_gdb_sleep_duration);
-    printf("Type 'gdb %s %d' to attach your debugger to this thread.\n",
-           _progname, getpid());
-
-    sleep(_gdb_sleep_duration);
-
-    printf("Done sleeping...\n");
-  }
-#endif
-
-  _exit(1);
-}
-#elif defined(CRAWL_STACK_ON_SIGSEGV)
+#if defined(CRAWL_STACK_ON_SIGSEGV)
 
 #include <unistd.h>
 #include "nsISupportsUtils.h"
 #include "nsStackWalk.h"
 
 extern "C" {
 
 static void PrintStackFrame(void *aPC, void *aClosure)
@@ -316,27 +284,17 @@ void InstallSignalHandlers(const char *P
   if (gdbSleep && *gdbSleep)
   {
     unsigned int s;
     if (1 == sscanf(gdbSleep, "%u", &s)) {
       _gdb_sleep_duration = s;
     }
   }
 
-#if defined(MOZ_WIDGET_PHOTON)
- /* Neutrino need this to free shared memory in case of a crash */
-  signal(SIGTERM, abnormal_exit_handler);
-  signal(SIGQUIT, abnormal_exit_handler);
-  signal(SIGINT,  abnormal_exit_handler);
-  signal(SIGHUP,  abnormal_exit_handler);
-  signal(SIGSEGV, abnormal_exit_handler);
-  signal(SIGILL,  abnormal_exit_handler);
-  signal(SIGABRT, abnormal_exit_handler);
-
-#elif defined(CRAWL_STACK_ON_SIGSEGV)
+#if defined(CRAWL_STACK_ON_SIGSEGV)
   if (!getenv("XRE_NO_WINDOWS_CRASH_DIALOG")) {
     void (*crap_handler)(int) =
 #ifdef MOZ_IPC
       GeckoProcessType_Default != XRE_GetProcessType() ?
           child_ah_crap_handler :
 #endif
           ah_crap_handler;
     signal(SIGSEGV, crap_handler);