From 4105ebb6ed85aaffec5e4469a939945fb9eea066 Mon Sep 17 00:00:00 2001 From: athenian200 Date: Tue, 1 Oct 2019 18:28:10 -0500 Subject: MoonchildProductions#1251 - Part 4: Core build system changes, lots of libevent/IPC junk. This is mostly ifdefs, but as you can see, Solaris is actually a lot like Linux. They're both more SysV than BSD at core, and most of the differences have more to do with Solaris not using glibc than anything else. I still need to audit a lot of these changes and understand why they're needed and what the alternative approaches are. After this patch, most of the core functionality needed to build Solaris is here. --- ipc/glue/BrowserProcessSubThread.cpp | 4 ++-- ipc/glue/BrowserProcessSubThread.h | 2 +- ipc/glue/GeckoChildProcessHost.cpp | 4 ++-- ipc/glue/MessageLink.cpp | 18 +++++++++++++++++- 4 files changed, 22 insertions(+), 6 deletions(-) (limited to 'ipc/glue') diff --git a/ipc/glue/BrowserProcessSubThread.cpp b/ipc/glue/BrowserProcessSubThread.cpp index 7618dc934..589f20003 100644 --- a/ipc/glue/BrowserProcessSubThread.cpp +++ b/ipc/glue/BrowserProcessSubThread.cpp @@ -23,7 +23,7 @@ static const char* kBrowserThreadNames[BrowserProcessSubThread::ID_COUNT] = { // "Chrome_FileThread", // FILE // "Chrome_DBThread", // DB // "Chrome_HistoryThread", // HISTORY -#if defined(OS_LINUX) +#if defined(OS_LINUX) || defined(OS_SOLARIS) "Gecko_Background_X11Thread", // BACKGROUND_X11 #endif }; @@ -34,7 +34,7 @@ BrowserProcessSubThread* BrowserProcessSubThread::sBrowserThreads[ID_COUNT] = { // nullptr, // FILE // nullptr, // DB // nullptr, // HISTORY -#if defined(OS_LINUX) +#if defined(OS_LINUX) || defined(OS_SOLARIS) nullptr, // BACKGROUND_X11 #endif }; diff --git a/ipc/glue/BrowserProcessSubThread.h b/ipc/glue/BrowserProcessSubThread.h index e1b4aef46..cc9051412 100644 --- a/ipc/glue/BrowserProcessSubThread.h +++ b/ipc/glue/BrowserProcessSubThread.h @@ -25,7 +25,7 @@ public: //FILE, //DB, //HISTORY, -#if defined(OS_LINUX) +#if defined(OS_LINUX) || defined(OS_SOLARIS) // This thread has a second connection to the X server and is used // to process UI requests when routing the request to the UI // thread would risk deadlock. diff --git a/ipc/glue/GeckoChildProcessHost.cpp b/ipc/glue/GeckoChildProcessHost.cpp index fee429238..ea76f85f0 100644 --- a/ipc/glue/GeckoChildProcessHost.cpp +++ b/ipc/glue/GeckoChildProcessHost.cpp @@ -599,7 +599,7 @@ GeckoChildProcessHost::PerformAsyncLaunchInternal(std::vector& aExt // and passing wstrings from one config to the other is unsafe. So // we split the logic here. -#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_BSD) +#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_BSD) || defined(OS_SOLARIS) base::environment_map newEnvVars; ChildPrivileges privs = mPrivileges; if (privs == base::PRIVILEGES_DEFAULT) { @@ -744,7 +744,7 @@ GeckoChildProcessHost::PerformAsyncLaunchInternal(std::vector& aExt childArgv.push_back(childProcessType); base::LaunchApp(childArgv, mFileMap, -#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_BSD) +#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_BSD) || defined(OS_SOLARIS) newEnvVars, privs, #endif false, &process, arch); diff --git a/ipc/glue/MessageLink.cpp b/ipc/glue/MessageLink.cpp index a66fbbb32..8c6d9b890 100644 --- a/ipc/glue/MessageLink.cpp +++ b/ipc/glue/MessageLink.cpp @@ -16,6 +16,9 @@ #include "nsDebug.h" #include "nsISupportsImpl.h" #include "nsXULAppAPI.h" +#if defined(__sun__) || defined(__sun) +#include +#endif using namespace mozilla; using namespace std; @@ -267,9 +270,19 @@ ProcessLink::OnChannelOpened() MonitorAutoLock lock(*mChan->mMonitor); mExistingListener = mTransport->set_listener(this); + +// The queue we want here is defined in the namespace 'std' on Solaris, which +// also has another function called queue in a different namespace. Need to +// determine whether queue is defined in 'std' on other supported platforms +// before possibly removing ifdefs. + #ifdef DEBUG if (mExistingListener) { +#if defined(XP_SOLARIS) + std::queue pending; +#else queue pending; +#endif mExistingListener->GetQueuedMessages(pending); MOZ_ASSERT(pending.empty()); } @@ -285,8 +298,11 @@ void ProcessLink::OnTakeConnectedChannel() { AssertIOThread(); - +#if defined(XP_SOLARIS) + std::queue pending; +#else queue pending; +#endif { MonitorAutoLock lock(*mChan->mMonitor); -- cgit v1.2.3