dom/base/nsDOMWindowList.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     5 #ifndef nsDOMWindowList_h___
     6 #define nsDOMWindowList_h___
     8 #include "nsCOMPtr.h"
     9 #include "nsIDOMWindowCollection.h"
    10 #include <stdint.h>
    11 #include "nsIDocShell.h"
    13 class nsIDocShell;
    14 class nsIDOMWindow;
    16 class nsDOMWindowList : public nsIDOMWindowCollection
    17 {
    18 public:
    19   nsDOMWindowList(nsIDocShell *aDocShell);
    20   virtual ~nsDOMWindowList();
    22   NS_DECL_ISUPPORTS
    23   NS_DECL_NSIDOMWINDOWCOLLECTION
    25   uint32_t GetLength();
    26   already_AddRefed<nsIDOMWindow> IndexedGetter(uint32_t aIndex, bool& aFound);
    28   //local methods
    29   NS_IMETHOD SetDocShell(nsIDocShell* aDocShell);
    30   already_AddRefed<nsIDocShellTreeItem> GetDocShellTreeItemAt(uint32_t aIndex)
    31   {
    32     EnsureFresh();
    33     nsCOMPtr<nsIDocShellTreeItem> item;
    34     if (mDocShellNode) {
    35       mDocShellNode->GetChildAt(aIndex, getter_AddRefs(item));
    36     }
    37     return item.forget();
    38   }
    40 protected:
    41   // Note: this function may flush and cause mDocShellNode to become null.
    42   void EnsureFresh();
    44   nsIDocShell* mDocShellNode; //Weak Reference
    45 };
    47 #endif // nsDOMWindowList_h___

mercurial