Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends
nsBrowserInstance Class Reference

#include <nsBrowserInstance.h>

Collaboration diagram for nsBrowserInstance:
Collaboration graph

List of all members.

Public Member Functions

 nsBrowserInstance ()
virtual ~nsBrowserInstance ()

Protected Member Functions

nsresult LoadUrl (const PRUnichar *urlToLoad)
nsresult GetContentAreaDocShell (nsIDocShell **outDocShell)
void ReinitializeContentVariables ()

Protected Attributes

PRBool mIsClosed
nsWeakPtr mContentAreaDocShellWeak

Static Protected Attributes

static PRBool sCmdLineURLUsed = PR_FALSE


class PageCycler

Detailed Description

Definition at line 64 of file nsBrowserInstance.h.

Constructor & Destructor Documentation

Definition at line 406 of file nsBrowserInstance.cpp.


Member Function Documentation

Definition at line 439 of file nsBrowserInstance.cpp.

  nsCOMPtr<nsIDocShell> docShell(do_QueryReferent(mContentAreaDocShellWeak));
  if (!mIsClosed && docShell) {
    // we're still alive and the docshell still exists. but has it been destroyed?
    nsCOMPtr<nsIBaseWindow> hack = do_QueryInterface(docShell);
    if (hack) {
      nsCOMPtr<nsIWidget> parent;
      if (!parent)
        // it's a zombie. a new one is in place. set up to use it.
        docShell = 0;
  if (!mIsClosed && !docShell)

  docShell = do_QueryReferent(mContentAreaDocShellWeak);
  *outDocShell = docShell;
  return NS_OK;

Here is the call graph for this function:

Definition at line 480 of file nsBrowserInstance.cpp.

  nsresult rv = NS_OK;

  nsCOMPtr<nsIDocShell> docShell;

  /* Ask nsWebShell to load the URl */
  nsCOMPtr<nsIWebNavigation> webNav(do_QueryInterface(docShell));
  // Normal browser.
  rv = webNav->LoadURI( urlToLoad,                          // URI string
                        nsIWebNavigation::LOAD_FLAGS_NONE,  // Load flags
                        nsnull,                             // Referring URI
                        nsnull,                             // Post data
                        nsnull );                           // Extra headers

  return rv;

Here is the call graph for this function:

Definition at line 412 of file nsBrowserInstance.cpp.

  NS_ASSERTION(mDOMWindow,"Reinitializing Content Variables without a window will cause a crash. see Bugzilla Bug 46454");
  if (!mDOMWindow)

  nsCOMPtr<nsIDOMWindow> contentWindow;

  nsCOMPtr<nsIScriptGlobalObject> globalObj(do_QueryInterface(contentWindow));

  if (globalObj) {
    nsIDocShell *docShell = globalObj->GetDocShell();

    mContentAreaDocShellWeak = do_GetWeakReference(docShell); // Weak reference

    if (APP_DEBUG) {
      nsCOMPtr<nsIDocShellTreeItem> docShellAsItem(do_QueryInterface(docShell));
      if (docShellAsItem) {
        nsXPIDLString name;
        printf("Attaching to Content WebShell [%s]\n", NS_LossyConvertUCS2toASCII(name).get());

Here is the call graph for this function:

Here is the caller graph for this function:

Friends And Related Function Documentation

friend class PageCycler [friend]

Definition at line 68 of file nsBrowserInstance.h.

Member Data Documentation

Definition at line 90 of file nsBrowserInstance.h.

Definition at line 92 of file nsBrowserInstance.h.

Definition at line 87 of file nsBrowserInstance.h.

Definition at line 88 of file nsBrowserInstance.h.

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