2015-05-08 14:37:00 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* 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/. */
|
2011-10-21 19:26:34 +04:00
|
|
|
|
|
|
|
#ifndef nsSHEntryShared_h__
|
|
|
|
#define nsSHEntryShared_h__
|
|
|
|
|
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsAutoPtr.h"
|
|
|
|
#include "nsCOMArray.h"
|
|
|
|
#include "nsIBFCacheEntry.h"
|
|
|
|
#include "nsIMutationObserver.h"
|
|
|
|
#include "nsExpirationTracker.h"
|
|
|
|
#include "nsRect.h"
|
2011-10-28 11:35:45 +04:00
|
|
|
#include "nsString.h"
|
2012-07-11 07:59:52 +04:00
|
|
|
#include "mozilla/Attributes.h"
|
2011-10-21 19:26:34 +04:00
|
|
|
|
|
|
|
class nsSHEntry;
|
|
|
|
class nsISHEntry;
|
|
|
|
class nsIDocument;
|
|
|
|
class nsIContentViewer;
|
|
|
|
class nsIDocShellTreeItem;
|
|
|
|
class nsILayoutHistoryState;
|
|
|
|
class nsDocShellEditorData;
|
2016-10-10 21:36:41 +03:00
|
|
|
class nsIMutableArray;
|
2011-10-21 19:26:34 +04:00
|
|
|
|
|
|
|
// A document may have multiple SHEntries, either due to hash navigations or
|
|
|
|
// calls to history.pushState. SHEntries corresponding to the same document
|
|
|
|
// share many members; in particular, they share state related to the
|
|
|
|
// back/forward cache.
|
|
|
|
//
|
|
|
|
// nsSHEntryShared is the vehicle for this sharing.
|
2015-05-06 20:57:23 +03:00
|
|
|
class nsSHEntryShared final
|
|
|
|
: public nsIBFCacheEntry
|
|
|
|
, public nsIMutationObserver
|
2011-10-21 19:26:34 +04:00
|
|
|
{
|
2015-05-06 20:57:23 +03:00
|
|
|
public:
|
|
|
|
static void EnsureHistoryTracker();
|
|
|
|
static void Shutdown();
|
|
|
|
|
|
|
|
nsSHEntryShared();
|
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIMUTATIONOBSERVER
|
|
|
|
NS_DECL_NSIBFCACHEENTRY
|
|
|
|
|
2017-03-29 22:48:47 +03:00
|
|
|
nsExpirationState *GetExpirationState() { return &mExpirationState; }
|
|
|
|
|
2015-05-06 20:57:23 +03:00
|
|
|
private:
|
|
|
|
~nsSHEntryShared();
|
|
|
|
|
|
|
|
friend class nsSHEntry;
|
|
|
|
|
|
|
|
friend class HistoryTracker;
|
|
|
|
|
|
|
|
static already_AddRefed<nsSHEntryShared> Duplicate(nsSHEntryShared* aEntry);
|
|
|
|
|
|
|
|
void RemoveFromExpirationTracker();
|
|
|
|
void Expire();
|
|
|
|
nsresult SyncPresentationState();
|
|
|
|
void DropPresentationState();
|
|
|
|
|
|
|
|
nsresult SetContentViewer(nsIContentViewer* aViewer);
|
|
|
|
|
|
|
|
// See nsISHEntry.idl for an explanation of these members.
|
|
|
|
|
|
|
|
// These members are copied by nsSHEntryShared::Duplicate(). If you add a
|
|
|
|
// member here, be sure to update the Duplicate() implementation.
|
2016-11-17 00:42:35 +03:00
|
|
|
nsID mDocShellID;
|
2015-05-06 20:57:23 +03:00
|
|
|
nsCOMArray<nsIDocShellTreeItem> mChildShells;
|
2016-07-28 10:20:41 +03:00
|
|
|
nsCOMPtr<nsIPrincipal> mTriggeringPrincipal;
|
2016-09-20 09:36:25 +03:00
|
|
|
nsCOMPtr<nsIPrincipal> mPrincipalToInherit;
|
2015-05-06 20:57:23 +03:00
|
|
|
nsCString mContentType;
|
|
|
|
bool mIsFrameNavigation;
|
|
|
|
bool mSaveLayoutState;
|
|
|
|
bool mSticky;
|
|
|
|
bool mDynamicallyCreated;
|
|
|
|
nsCOMPtr<nsISupports> mCacheKey;
|
|
|
|
uint32_t mLastTouched;
|
|
|
|
|
|
|
|
// These members aren't copied by nsSHEntryShared::Duplicate() because
|
|
|
|
// they're specific to a particular content viewer.
|
|
|
|
uint64_t mID;
|
|
|
|
nsCOMPtr<nsIContentViewer> mContentViewer;
|
|
|
|
nsCOMPtr<nsIDocument> mDocument;
|
|
|
|
nsCOMPtr<nsILayoutHistoryState> mLayoutHistoryState;
|
|
|
|
bool mExpired;
|
|
|
|
nsCOMPtr<nsISupports> mWindowState;
|
|
|
|
nsIntRect mViewerBounds;
|
2016-10-10 21:36:41 +03:00
|
|
|
nsCOMPtr<nsIMutableArray> mRefreshURIList;
|
2015-05-06 20:57:23 +03:00
|
|
|
nsExpirationState mExpirationState;
|
|
|
|
nsAutoPtr<nsDocShellEditorData> mEditorData;
|
2011-10-21 19:26:34 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|