summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2010-10-11 22:07:16 -0500
committerNorbert Thiebaud <nthiebaud@gmail.com>2010-10-25 19:55:33 -0500
commite00037f4dd92a03bd3544291e5cf1f5a4c9bccc8 (patch)
treecfa9a525b1d01845f66f6f92af35696886ee8f4f /desktop
parent300c90d630edcfef8699058148177889bfd5a8a6 (diff)
merge vosremoval-pipe.diff
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/app/officeipcthread.cxx49
-rw-r--r--desktop/source/app/officeipcthread.hxx6
2 files changed, 26 insertions, 29 deletions
diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx
index 263a965b12..6315b25068 100644
--- a/desktop/source/app/officeipcthread.cxx
+++ b/desktop/source/app/officeipcthread.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -49,12 +49,10 @@
#include <rtl/bootstrap.hxx>
#include <rtl/strbuf.hxx>
#include <comphelper/processfactory.hxx>
-#include "osl/file.hxx"
+#include <osl/file.hxx>
#include "rtl/process.h"
#include "tools/getprocessworkingdir.hxx"
-#include "osl/file.hxx"
-using namespace vos;
using namespace rtl;
using namespace desktop;
using namespace ::com::sun::star::uno;
@@ -461,7 +459,7 @@ OfficeIPCThread::Status OfficeIPCThread::EnableOfficeIPCThread()
// and connectPipe!!
OUString aIniName;
-
+
aInfo.getExecutableFile( aIniName );
sal_uInt32 lastIndex = aIniName.lastIndexOf('/');
if ( lastIndex > 0 )
@@ -474,12 +472,12 @@ OfficeIPCThread::Status OfficeIPCThread::EnableOfficeIPCThread()
aIniName += OUString( RTL_CONSTASCII_USTRINGPARAM( "rc" ));
#endif
}
-
+
::rtl::Bootstrap aPerfTuneIniFile( aIniName );
-
+
OUString aDefault( RTL_CONSTASCII_USTRINGPARAM( "0" ));
OUString aPreloadData;
-
+
aPerfTuneIniFile.getFrom( OUString( RTL_CONSTASCII_USTRINGPARAM( "FastPipeCommunication" )), aPreloadData, aDefault );
@@ -493,7 +491,7 @@ OfficeIPCThread::Status OfficeIPCThread::EnableOfficeIPCThread()
}
else
aUserInstallPathHashCode = CreateMD5FromString( aDummy );
-
+
// Check result to create a hash code from the user install path
if ( aUserInstallPathHashCode.getLength() == 0 )
@@ -506,20 +504,20 @@ OfficeIPCThread::Status OfficeIPCThread::EnableOfficeIPCThread()
{
osl::Security &rSecurity = Security::get();
// Try to create pipe
- if ( pThread->maPipe.create( pThread->maPipeIdent.getStr(), OPipe::TOption_Create, rSecurity ))
+ if ( pThread->maPipe.create( pThread->maPipeIdent.getStr(), osl_Pipe_CREATE, rSecurity ))
{
// Pipe created
nPipeMode = PIPEMODE_CREATED;
}
- else if( pThread->maPipe.create( pThread->maPipeIdent.getStr(), OPipe::TOption_Open, rSecurity )) // Creation not successfull, now we try to connect
+ else if( pThread->maPipe.create( pThread->maPipeIdent.getStr(), osl_Pipe_OPEN, rSecurity )) // Creation not successfull, now we try to connect
{
// Pipe connected to first office
nPipeMode = PIPEMODE_CONNECTED;
}
else
{
- OPipe::TPipeError eReason = pThread->maPipe.getError();
- if ((eReason == OPipe::E_ConnectionRefused) || (eReason == OPipe::E_invalidError))
+ oslPipeError eReason = pThread->maPipe.getError();
+ if ((eReason == osl_Pipe_E_ConnectionRefused) || (eReason == osl_Pipe_E_invalidError))
return IPC_STATUS_BOOTSTRAP_ERROR;
// Wait for second office to be ready
@@ -540,7 +538,7 @@ OfficeIPCThread::Status OfficeIPCThread::EnableOfficeIPCThread()
else
{
// Seems another office is running. Pipe arguments to it and self terminate
- pThread->maStreamPipe = pThread->maPipe;
+ osl::StreamPipe aStreamPipe(pThread->maPipe.getHandle());
sal_Bool bWaitBeforeClose = sal_False;
ByteString aArguments(RTL_CONSTASCII_STRINGPARAM(ARGUMENT_PREFIX));
@@ -563,13 +561,13 @@ OfficeIPCThread::Status OfficeIPCThread::EnableOfficeIPCThread()
}
}
// finaly, write the string onto the pipe
- pThread->maStreamPipe.write( aArguments.GetBuffer(), aArguments.Len() );
- pThread->maStreamPipe.write( "\0", 1 );
+ aStreamPipe.write( aArguments.GetBuffer(), aArguments.Len() );
+ aStreamPipe.write( "\0", 1 );
// wait for confirmation #95361# #95425#
ByteString aToken(sc_aConfirmationSequence);
char *aReceiveBuffer = new char[aToken.Len()+1];
- int n = pThread->maStreamPipe.read( aReceiveBuffer, aToken.Len() );
+ int n = aStreamPipe.read( aReceiveBuffer, aToken.Len() );
aReceiveBuffer[n]='\0';
delete pThread;
@@ -598,15 +596,15 @@ void OfficeIPCThread::DisableOfficeIPCThread()
// send thread a termination message
// this is done so the subsequent join will not hang
// because the thread hangs in accept of pipe
- OPipe Pipe( pOfficeIPCThread->maPipeIdent, OPipe::TOption_Open, Security::get() );
+ osl::StreamPipe aPipe ( pOfficeIPCThread->maPipeIdent, osl_Pipe_OPEN, Security::get() );
//Pipe.send( TERMINATION_SEQUENCE, TERMINATION_LENGTH );
- if (Pipe.isValid())
+ if (aPipe.is())
{
- Pipe.send( sc_aTerminationSequence, sc_nTSeqLength+1 ); // also send 0-byte
+ aPipe.send( sc_aTerminationSequence, sc_nTSeqLength+1 ); // also send 0-byte
// close the pipe so that the streampipe on the other
// side produces EOF
- Pipe.close();
+ aPipe.close();
}
// release mutex to avoid deadlocks
@@ -661,11 +659,10 @@ void SAL_CALL OfficeIPCThread::run()
{
do
{
- OPipe::TPipeError
- nError = maPipe.accept( maStreamPipe );
+ oslPipeError nError = maPipe.accept( maStreamPipe );
- if( nError == OStreamPipe::E_None )
+ if( nError == osl_Pipe_E_None )
{
// #111143# and others:
@@ -1030,7 +1027,7 @@ sal_Bool OfficeIPCThread::ExecuteCmdLineRequests( ProcessDocumentsRequest& aRequ
{
if( ! pGlobalOfficeIPCThread->AreRequestsEnabled() )
return bShutdown;
-
+
pGlobalOfficeIPCThread->mnPendingRequests += aDispatchList.size();
if ( !pGlobalOfficeIPCThread->mpDispatchWatcher )
{
@@ -1041,7 +1038,7 @@ sal_Bool OfficeIPCThread::ExecuteCmdLineRequests( ProcessDocumentsRequest& aRequ
// copy for execute
DispatchWatcher::DispatchList aTempList( aDispatchList );
aDispatchList.clear();
-
+
aGuard.clear();
// Execute dispatch requests
diff --git a/desktop/source/app/officeipcthread.hxx b/desktop/source/app/officeipcthread.hxx
index 98371a488d..9ae424810c 100644
--- a/desktop/source/app/officeipcthread.hxx
+++ b/desktop/source/app/officeipcthread.hxx
@@ -30,7 +30,7 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/frame/XTerminateListener.hpp>
-#include <vos/pipe.hxx>
+#include <osl/pipe.hxx>
#include <osl/security.hxx>
#include <osl/signal.h>
#include <rtl/ustring.hxx>
@@ -75,8 +75,8 @@ class OfficeIPCThread : public osl::Thread
static OfficeIPCThread* pGlobalOfficeIPCThread;
static ::osl::Mutex* pOfficeIPCThreadMutex;
- vos::OPipe maPipe;
- vos::OStreamPipe maStreamPipe;
+ osl::Pipe maPipe;
+ osl::StreamPipe maStreamPipe;
rtl::OUString maPipeIdent;
bool mbDowning;
bool mbRequestsEnabled;