Back to index

lightning-sunbird  0.9+nobinonly
Functions
SizeTest06.cpp File Reference
#include "nsIDOMWindowInternal.h"
#include "nsIScriptGlobalObject.h"
#include "nsIDocShell.h"
#include "nsIBaseWindow.h"
#include "nsCOMPtr.h"

Go to the source code of this file.

Functions

 NS_DEF_PTR (nsIScriptGlobalObject)
 NS_DEF_PTR (nsIBaseWindow)
void Test06_raw (nsIDOMWindowInternal *aDOMWindow, nsIBaseWindow **aBaseWindow)
void Test06_raw_optimized (nsIDOMWindowInternal *aDOMWindow, nsIBaseWindow **aBaseWindow)
void Test06_nsCOMPtr_as_found (nsIDOMWindowInternal *aDOMWindow, nsCOMPtr< nsIBaseWindow > *aBaseWindow)
void Test06_nsCOMPtr00 (nsIDOMWindowInternal *aDOMWindow, nsIBaseWindow **aBaseWindow)
void Test06_nsCOMPtr_optimized (nsIDOMWindowInternal *aDOMWindow, nsCOMPtr< nsIBaseWindow > *aBaseWindow)
void Test06_nsCOMPtr02 (nsIDOMWindowInternal *aDOMWindow, nsIBaseWindow **aBaseWindow)
void Test06_nsCOMPtr03 (nsIDOMWindowInternal *aDOMWindow, nsCOMPtr< nsIBaseWindow > *aBaseWindow)

Function Documentation

void Test06_nsCOMPtr00 ( nsIDOMWindowInternal aDOMWindow,
nsIBaseWindow **  aBaseWindow 
)

Definition at line 88 of file SizeTest06.cpp.

{
//  if (!aDOMWindow)
//    return NS_ERROR_NULL_POINTER;
  nsresult status;
  nsCOMPtr<nsIScriptGlobalObject> scriptGlobalObject = do_QueryInterface(aDOMWindow, &status);
  nsIDocShell* temp0 = 0;
  if (scriptGlobalObject)
    scriptGlobalObject->GetDocShell(&temp0);
  nsCOMPtr<nsIDocShell> docShell = dont_AddRef(temp0);
  (*aBaseWindow) = 0;
//    return status;
}

Here is the call graph for this function:

void Test06_nsCOMPtr02 ( nsIDOMWindowInternal aDOMWindow,
nsIBaseWindow **  aBaseWindow 
)

Definition at line 119 of file SizeTest06.cpp.

{
//    if (!aDOMWindow)
//      return NS_ERROR_NULL_POINTER;
  (*aBaseWindow) = 0;
  nsresult status;
  nsCOMPtr<nsIScriptGlobalObject> scriptGlobalObject = do_QueryInterface(aDOMWindow, &status);
  if (scriptGlobalObject) {
    nsIDocShell* temp0;
    scriptGlobalObject->GetDocShell(&temp0);
  }
//    return status;
}

Here is the call graph for this function:

void Test06_nsCOMPtr03 ( nsIDOMWindowInternal aDOMWindow,
nsCOMPtr< nsIBaseWindow > *  aBaseWindow 
)

Definition at line 135 of file SizeTest06.cpp.

{
//    if (!aDOMWindow)
//      return NS_ERROR_NULL_POINTER;
  (*aBaseWindow) = 0;
  nsresult status;
  nsCOMPtr<nsIScriptGlobalObject> scriptGlobalObject = do_QueryInterface(aDOMWindow, &status);
  if (scriptGlobalObject) {
    nsIDocShell* temp0;
    scriptGlobalObject->GetDocShell(&temp0);
    nsCOMPtr<nsIDocShell> docShell = dont_AddRef(temp0);
    if (docShell) {
    }
  }
//    return status;
}

Here is the call graph for this function:

void Test06_nsCOMPtr_as_found ( nsIDOMWindowInternal aDOMWindow,
nsCOMPtr< nsIBaseWindow > *  aBaseWindow 
)

Definition at line 76 of file SizeTest06.cpp.

{
//  if (!aDOMWindow)
//    return;
  nsCOMPtr<nsIScriptGlobalObject> scriptGlobalObject = do_QueryInterface(aDOMWindow);
  nsCOMPtr<nsIDocShell> docShell;
  if (scriptGlobalObject)
    scriptGlobalObject->GetDocShell(getter_AddRefs(docShell));  
}

Here is the call graph for this function:

void Test06_nsCOMPtr_optimized ( nsIDOMWindowInternal aDOMWindow,
nsCOMPtr< nsIBaseWindow > *  aBaseWindow 
)

Definition at line 104 of file SizeTest06.cpp.

{
//    if (!aDOMWindow)
//      return NS_ERROR_NULL_POINTER;
  nsresult status;
  nsCOMPtr<nsIScriptGlobalObject> scriptGlobalObject = do_QueryInterface(aDOMWindow, &status);
  nsIDocShell* temp0 = 0;
  if (scriptGlobalObject)
    scriptGlobalObject->GetDocShell(&temp0);
  (*aBaseWindow) = do_QueryInterface(nsnull, &status);
//    return status;
}

Here is the call graph for this function:

void Test06_raw ( nsIDOMWindowInternal aDOMWindow,
nsIBaseWindow **  aBaseWindow 
)

Definition at line 38 of file SizeTest06.cpp.

{
//  if (!aDOMWindow)
//    return NS_ERROR_NULL_POINTER;
  nsIScriptGlobalObject* scriptGlobalObject = 0;
  nsresult status = aDOMWindow->QueryInterface(NS_GET_IID(nsIScriptGlobalObject), (void**)&scriptGlobalObject);
  nsIDocShell* docShell = 0;
  if (scriptGlobalObject)
    scriptGlobalObject->GetDocShell(&docShell);
  nsIWebShell* rootWebShell = 0;
  NS_IF_RELEASE(rootWebShell);
  NS_IF_RELEASE(docShell);
  NS_IF_RELEASE(scriptGlobalObject);
//    return status;
}
void Test06_raw_optimized ( nsIDOMWindowInternal aDOMWindow,
nsIBaseWindow **  aBaseWindow 
)

Definition at line 56 of file SizeTest06.cpp.

{
//  if (!aDOMWindow)
//    return NS_ERROR_NULL_POINTER;
  (*aBaseWindow) = 0;
  nsIScriptGlobalObject* scriptGlobalObject;
  nsresult status = aDOMWindow->QueryInterface(NS_GET_IID(nsIScriptGlobalObject), (void**)&scriptGlobalObject);
  if (NS_SUCCEEDED(status)) {
    nsIDocShell* docShell = 0;
    scriptGlobalObject->GetDocShell(&docShell);
    if (docShell) {
      NS_RELEASE(docShell);
    }
    NS_RELEASE(scriptGlobalObject);
  }
//  return status;
}