зеркало из https://github.com/mozilla/pjs.git
make windows build compile.
This commit is contained in:
Родитель
1159431d9f
Коммит
2897ded59e
|
@ -39,6 +39,13 @@
|
|||
#define ipcProto_h__
|
||||
|
||||
#if defined(XP_WIN)
|
||||
|
||||
#define IPC_WINDOW_CLASS "Mozilla:IPCWindowClass"
|
||||
#define IPC_WINDOW_NAME "Mozilla:IPCWindow"
|
||||
#define IPC_DAEMON_APP_NAME "mozipcd.exe"
|
||||
#define IPC_PATH_SEP_CHAR '\\'
|
||||
|
||||
#if 0
|
||||
//
|
||||
// XXX since win9x/me doesn't support named pipes, we resort to using a
|
||||
// localhost TCP/IP socket (for now). this is not a great solution for
|
||||
|
@ -61,6 +68,8 @@
|
|||
#define IPC_PATH_SEP_CHAR '\\'
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#else
|
||||
//
|
||||
// use UNIX domain socket
|
||||
|
|
|
@ -61,6 +61,7 @@ CPPSRCS = \
|
|||
$(NULL)
|
||||
|
||||
ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
|
||||
CPPSRCS += ipcTransportWin.cpp
|
||||
else
|
||||
CPPSRCS += ipcTransportUnix.cpp
|
||||
CPPSRCS += ipcSocketProviderUnix.cpp
|
||||
|
|
|
@ -155,8 +155,10 @@ ipcService::Init()
|
|||
|
||||
// get socket path from directory service
|
||||
nsCAutoString socketPath;
|
||||
#ifdef XP_UNIX
|
||||
if (NS_FAILED(GetSocketPath(socketPath)))
|
||||
socketPath = NS_LITERAL_CSTRING(IPC_DEFAULT_SOCKET_PATH);
|
||||
#endif
|
||||
|
||||
rv = mTransport->Init(appName, socketPath, this);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
@ -197,6 +199,7 @@ ipcService::HandleQueryResult(const ipcMessage *rawMsg, PRBool succeeded)
|
|||
mQueryQ.DeleteFirst();
|
||||
}
|
||||
|
||||
#ifdef XP_UNIX
|
||||
nsresult
|
||||
ipcService::GetSocketPath(nsACString &socketPath)
|
||||
{
|
||||
|
@ -204,7 +207,6 @@ ipcService::GetSocketPath(nsACString &socketPath)
|
|||
NS_GetSpecialDirectory(NS_OS_TEMP_DIR, getter_AddRefs(file));
|
||||
if (!file)
|
||||
return NS_ERROR_FAILURE;
|
||||
#ifdef XP_UNIX
|
||||
// XXX may want to use getpwuid_r when available
|
||||
struct passwd *pw = getpwuid(geteuid());
|
||||
if (!pw)
|
||||
|
@ -213,11 +215,11 @@ ipcService::GetSocketPath(nsACString &socketPath)
|
|||
leaf = NS_LITERAL_CSTRING(".mozilla-ipc-")
|
||||
+ nsDependentCString(pw->pw_name);
|
||||
file->AppendNative(leaf);
|
||||
#endif
|
||||
file->AppendNative(NS_LITERAL_CSTRING("ipcd"));
|
||||
file->GetNativePath(socketPath);
|
||||
return NS_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// interface impl
|
||||
|
|
|
@ -153,8 +153,12 @@ ipcTransport::SpawnDaemon()
|
|||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
PRUint32 pid;
|
||||
#ifdef XP_UNIX
|
||||
const char *args[] = { mSocketPath.get() };
|
||||
return proc->Run(PR_FALSE, args, 1, &pid);
|
||||
#else
|
||||
return proc->Run(PR_FALSE, NULL, 0, &pid);
|
||||
#endif
|
||||
}
|
||||
|
||||
NS_IMPL_THREADSAFE_ISUPPORTS0(ipcTransport)
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
#include "ipcConfig.h"
|
||||
#include "ipcLog.h"
|
||||
#include "ipcTransport.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// windows specific ipcTransport impl
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
nsresult
|
||||
ipcTransport::Shutdown()
|
||||
{
|
||||
LOG(("ipcTransport::Shutdown\n"));
|
||||
|
||||
mHaveConnection = PR_FALSE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
ipcTransport::Connect()
|
||||
{
|
||||
LOG(("ipcTransport::Connect\n"));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
ipcTransport::SendMsg_Internal(ipcMessage *msg)
|
||||
{
|
||||
LOG(("ipcTransport::SendMsg_Internal\n"));
|
||||
return NS_OK;
|
||||
}
|
||||
|
Загрузка…
Ссылка в новой задаче