mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-26 23:13:18 +00:00
39a4e30ae8
- pointer style (db52d9c32) - Bug 1158407 - Stop using this one weird allocation fallback for MCreateThisWithTemplate. (r=terrence) (5b489cd5d) - Bug 1170124 - Remove unnecessary type monitoring in jit::InvokeFunction. r=bhackett (1603ee063) - Bug 1141865 - Part 2: Plumb new.target on the stack and make it accessible to JSNatives. (r=jorendorff, r=jandem, r=shu) (25cfa92ec) - Bug 1129795 - Convert rest of docshell/ to Gecko style. r=mccr8 (20acc2d82) - Bug 1162309 - Part 1: Remove instances of #ifdef PR_LOGGING in uriloader. r=froydnj (8768f60c0) - Bug 1162309 - Part 2: Remove instances of #ifdef PR_LOGGING in docshell. r=froydnj (e9de046f3) - Bug 1096908 - forward network security messages to the content process; r=hurley (69b38e624) - Bug 1156493 - e10s: move .cacheKey to nsICacheInfoChannel so child channels can get/set it, r=jduell (507efbe2b) - Bug 1017758 - Use infallible getters for appId/isInBrowserElement/unknownAppId; r=bz (8021f0ae8)
108 lines
2.9 KiB
C++
108 lines
2.9 KiB
C++
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
#ifndef nsDocShellEnumerator_h___
|
|
#define nsDocShellEnumerator_h___
|
|
|
|
#include "nsISimpleEnumerator.h"
|
|
#include "nsTArray.h"
|
|
#include "nsIWeakReferenceUtils.h"
|
|
|
|
class nsIDocShellTreeItem;
|
|
|
|
/*
|
|
// {13cbc281-35ae-11d5-be5b-bde0edece43c}
|
|
#define NS_DOCSHELL_FORWARDS_ENUMERATOR_CID \
|
|
{ 0x13cbc281, 0x35ae, 0x11d5, { 0xbe, 0x5b, 0xbd, 0xe0, 0xed, 0xec, 0xe4, 0x3c } }
|
|
|
|
#define NS_DOCSHELL_FORWARDS_ENUMERATOR_CONTRACTID \
|
|
"@mozilla.org/docshell/enumerator-forwards;1"
|
|
|
|
// {13cbc282-35ae-11d5-be5b-bde0edece43c}
|
|
#define NS_DOCSHELL_BACKWARDS_ENUMERATOR_CID \
|
|
{ 0x13cbc282, 0x35ae, 0x11d5, { 0xbe, 0x5b, 0xbd, 0xe0, 0xed, 0xec, 0xe4, 0x3c } }
|
|
|
|
#define NS_DOCSHELL_BACKWARDS_ENUMERATOR_CONTRACTID \
|
|
"@mozilla.org/docshell/enumerator-backwards;1"
|
|
*/
|
|
|
|
class nsDocShellEnumerator : public nsISimpleEnumerator
|
|
{
|
|
protected:
|
|
enum
|
|
{
|
|
enumerateForwards,
|
|
enumerateBackwards
|
|
};
|
|
|
|
virtual ~nsDocShellEnumerator();
|
|
|
|
public:
|
|
explicit nsDocShellEnumerator(int32_t aEnumerationDirection);
|
|
|
|
// nsISupports
|
|
NS_DECL_ISUPPORTS
|
|
|
|
// nsISimpleEnumerator
|
|
NS_DECL_NSISIMPLEENUMERATOR
|
|
|
|
public:
|
|
nsresult GetEnumerationRootItem(nsIDocShellTreeItem** aEnumerationRootItem);
|
|
nsresult SetEnumerationRootItem(nsIDocShellTreeItem* aEnumerationRootItem);
|
|
|
|
nsresult GetEnumDocShellType(int32_t* aEnumerationItemType);
|
|
nsresult SetEnumDocShellType(int32_t aEnumerationItemType);
|
|
|
|
nsresult First();
|
|
|
|
protected:
|
|
nsresult EnsureDocShellArray();
|
|
nsresult ClearState();
|
|
|
|
nsresult BuildDocShellArray(nsTArray<nsWeakPtr>& aItemArray);
|
|
virtual nsresult BuildArrayRecursive(nsIDocShellTreeItem* aItem,
|
|
nsTArray<nsWeakPtr>& aItemArray) = 0;
|
|
|
|
protected:
|
|
nsWeakPtr mRootItem; // weak ref!
|
|
|
|
nsTArray<nsWeakPtr> mItemArray; // flattened list of items with matching type
|
|
uint32_t mCurIndex;
|
|
|
|
int32_t mDocShellType; // only want shells of this type
|
|
bool mArrayValid; // is mItemArray up to date?
|
|
|
|
const int8_t mEnumerationDirection;
|
|
};
|
|
|
|
class nsDocShellForwardsEnumerator : public nsDocShellEnumerator
|
|
{
|
|
public:
|
|
nsDocShellForwardsEnumerator()
|
|
: nsDocShellEnumerator(enumerateForwards)
|
|
{
|
|
}
|
|
|
|
protected:
|
|
virtual nsresult BuildArrayRecursive(nsIDocShellTreeItem* aItem,
|
|
nsTArray<nsWeakPtr>& aItemArray);
|
|
};
|
|
|
|
class nsDocShellBackwardsEnumerator : public nsDocShellEnumerator
|
|
{
|
|
public:
|
|
nsDocShellBackwardsEnumerator()
|
|
: nsDocShellEnumerator(enumerateBackwards)
|
|
{
|
|
}
|
|
|
|
protected:
|
|
virtual nsresult BuildArrayRecursive(nsIDocShellTreeItem* aItem,
|
|
nsTArray<nsWeakPtr>& aItemArray);
|
|
};
|
|
|
|
#endif // nsDocShellEnumerator_h___
|