Back to index

enigmail  1.4.3
Defines | Functions | Variables
nsIPCBuffer.cpp File Reference
#include "ipc.h"
#include "prlog.h"
#include "nsCOMPtr.h"
#include "mozilla/Mutex.h"
#include "nsIInputStream.h"
#include "nsIThread.h"
#include "nsIHttpChannel.h"
#include "nsNetUtil.h"
#include "nsDirectoryServiceUtils.h"
#include "nsDirectoryServiceDefs.h"
#include "nsNetCID.h"
#include "nsStringGlue.h"
#include "nsIPCBuffer.h"

Go to the source code of this file.

Defines

#define FORCE_PR_LOG   /* Allow logging even in release build */
#define ERROR_LOG(args)   PR_LOG(gIPCBufferLog,PR_LOG_ERROR,args)
#define WARNING_LOG(args)   PR_LOG(gIPCBufferLog,PR_LOG_WARNING,args)
#define DEBUG_LOG(args)   PR_LOG(gIPCBufferLog,PR_LOG_DEBUG,args)
#define NS_PIPE_CONSOLE_BUFFER_SIZE   (1024)
#define SAFE_TMP_FILENAME   "nsenig.tmp"

Functions

 NS_IMPL_THREADSAFE_ISUPPORTS6 (nsIPCBuffer, nsIRequestObserver, nsIStreamListener, nsIPipeListener, nsIIPCBuffer, nsIInputStream, nsIRunnable) nsIPCBuffer
PRStatus IPC_CreateInheritablePipe (PRFileDesc **readPipe, PRFileDesc **writePipe, IPCBool readInherit, IPCBool writeInherit)

Variables

static const PRUint32 kCharMax = NS_PIPE_CONSOLE_BUFFER_SIZE

Define Documentation

#define DEBUG_LOG (   args)    PR_LOG(gIPCBufferLog,PR_LOG_DEBUG,args)

Definition at line 59 of file nsIPCBuffer.cpp.

#define ERROR_LOG (   args)    PR_LOG(gIPCBufferLog,PR_LOG_ERROR,args)

Definition at line 57 of file nsIPCBuffer.cpp.

#define FORCE_PR_LOG   /* Allow logging even in release build */

Definition at line 36 of file nsIPCBuffer.cpp.

Definition at line 61 of file nsIPCBuffer.cpp.

#define SAFE_TMP_FILENAME   "nsenig.tmp"

Definition at line 347 of file nsIPCBuffer.cpp.

#define WARNING_LOG (   args)    PR_LOG(gIPCBufferLog,PR_LOG_WARNING,args)

Definition at line 58 of file nsIPCBuffer.cpp.


Function Documentation

PRStatus IPC_CreateInheritablePipe ( PRFileDesc **  readPipe,
PRFileDesc **  writePipe,
IPCBool  readInherit,
IPCBool  writeInherit 
)

Definition at line 1174 of file nsIPCBuffer.cpp.

{
  PRStatus status;

  //status = PR_NewTCPSocketPair(fd);
  status = PR_CreatePipe(readPipe, writePipe);
  if (status != PR_SUCCESS)
    return status;

  // Hack to handle Win32 problem: PR_SetFDInheritable returns error
  // when we try to return off inheritability. However, inheritability is
  // supposed to be off by default, so it shouldn't really matter.
  status = PR_SUCCESS;
#ifdef XP_WIN
  if (readInherit)
#endif
    status = PR_SetFDInheritable(*readPipe, readInherit);
  if (status != PR_SUCCESS)
    return status;

#ifdef XP_WIN
  if (writeInherit)
#endif
    status = PR_SetFDInheritable(*writePipe, writeInherit);
  if (status != PR_SUCCESS)
    return status;

  return PR_SUCCESS;
}

Here is the caller graph for this function:

NS_IMPL_THREADSAFE_ISUPPORTS6 ( nsIPCBuffer  ,
nsIRequestObserver  ,
nsIStreamListener  ,
nsIPipeListener  ,
nsIIPCBuffer  ,
nsIInputStream  ,
nsIRunnable   
)

Definition at line 72 of file nsIPCBuffer.cpp.

                         :
    mFinalized(PR_FALSE),
    mInitialized(PR_FALSE),
    mThreadJoined(PR_FALSE),
    mOverflowed(PR_FALSE),
    mOverflowFile(PR_FALSE),

    mRequestStarted(PR_FALSE),
    mRequestStopped(PR_FALSE),

    mLock("nsIPCBuffer.lock"),
    mMaxBytes(0),
    mByteCount(0),
    mStreamOffset(0),

    mByteBuf(""),

    mPipeWrite(IPC_NULL_HANDLE),
    mPipeRead(IPC_NULL_HANDLE),

    mTempFile(nsnull),
    mTempOutStream(nsnull),
    mTempInStream(nsnull),

    mPipeThread(nsnull),
    mObserver(nsnull),
    mObserverContext(nsnull)
{
#ifdef PR_LOGGING
  if (!gIPCBufferLog) {
    gIPCBufferLog = PR_NewLogModule("nsIPCBuffer");
  }
#endif

#ifdef FORCE_PR_LOG
  nsCOMPtr<nsIThread> myThread;
  IPC_GET_THREAD(myThread);
  DEBUG_LOG(("nsIPCBuffer:: <<<<<<<<< CTOR(%p): myThread=%p\n",
         this, myThread.get()));
#endif
}

Variable Documentation

const PRUint32 kCharMax = NS_PIPE_CONSOLE_BUFFER_SIZE [static]

Definition at line 63 of file nsIPCBuffer.cpp.