Bumping manifests a=b2g-bump
[gecko.git] / dom / base / nsDOMWindowList.h
blobe6af9f18c99e99764cdf3bee699cf3b2fd7a5933
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
18 public:
19 explicit nsDOMWindowList(nsIDocShell* aDocShell);
21 NS_DECL_ISUPPORTS
22 NS_DECL_NSIDOMWINDOWCOLLECTION
24 uint32_t GetLength();
25 already_AddRefed<nsIDOMWindow> IndexedGetter(uint32_t aIndex, bool& aFound);
27 //local methods
28 NS_IMETHOD SetDocShell(nsIDocShell* aDocShell);
29 already_AddRefed<nsIDocShellTreeItem> GetDocShellTreeItemAt(uint32_t aIndex)
31 EnsureFresh();
32 nsCOMPtr<nsIDocShellTreeItem> item;
33 if (mDocShellNode) {
34 mDocShellNode->GetChildAt(aIndex, getter_AddRefs(item));
36 return item.forget();
39 protected:
40 virtual ~nsDOMWindowList();
42 // Note: this function may flush and cause mDocShellNode to become null.
43 void EnsureFresh();
45 nsIDocShell* mDocShellNode; //Weak Reference
48 #endif // nsDOMWindowList_h___