Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Protected Attributes
SafeJSContext Class Reference
Collaboration diagram for SafeJSContext:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 SafeJSContext ()
 ~SafeJSContext ()
nsresult Push ()
JSContextget ()
 SafeJSContext ()
 ~SafeJSContext ()
nsresult Push ()
JSContextget ()
 SafeJSContext ()
 ~SafeJSContext ()
nsresult Push ()
JSContextget ()
 SafeJSContext ()
 ~SafeJSContext ()
nsresult Push ()
JSContextget ()

Protected Attributes

nsCOMPtr< nsIThreadJSContextStackmService
JSContextmContext

Detailed Description

Definition at line 1641 of file nsNativeAppSupportOS2.cpp.


Constructor & Destructor Documentation

Definition at line 1654 of file nsNativeAppSupportOS2.cpp.

                             : mContext(nsnull) {
}

Definition at line 1657 of file nsNativeAppSupportOS2.cpp.

                              {
  JSContext *cx;
  nsresult   rv;

  if(mContext) {
    rv = mService->Pop(&cx);
    NS_ASSERTION(NS_SUCCEEDED(rv) && cx == mContext, "JSContext push/pop mismatch");
  }
}

Member Function Documentation

Definition at line 1522 of file nsNativeAppSupportWin.cpp.

{ return mContext; }

Definition at line 1647 of file nsNativeAppSupportOS2.cpp.

{ return mContext; }

Definition at line 2235 of file nsNativeAppSupportOS2.cpp.

{ return mContext; }

Definition at line 2314 of file nsNativeAppSupportWin.cpp.

{ return mContext; }

Definition at line 1667 of file nsNativeAppSupportOS2.cpp.

                             {
  if (mContext) // only once
    return NS_ERROR_FAILURE;

  mService = do_GetService(sJSStackContractID);
  if(mService) {
    JSContext *cx;
    if (NS_SUCCEEDED(mService->GetSafeJSContext(&cx)) &&
        cx &&
        NS_SUCCEEDED(mService->Push(cx))) {
      // Save cx in mContext to indicate need to pop.
      mContext = cx;
    }
  }
  return mContext ? NS_OK : NS_ERROR_FAILURE;
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 1651 of file nsNativeAppSupportOS2.cpp.

Definition at line 1650 of file nsNativeAppSupportOS2.cpp.


The documentation for this class was generated from the following files: