Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | #ifndef nsSHEntryShared_h__ |
michael@0 | 6 | #define nsSHEntryShared_h__ |
michael@0 | 7 | |
michael@0 | 8 | #include "nsCOMPtr.h" |
michael@0 | 9 | #include "nsAutoPtr.h" |
michael@0 | 10 | #include "nsCOMArray.h" |
michael@0 | 11 | #include "nsIBFCacheEntry.h" |
michael@0 | 12 | #include "nsIMutationObserver.h" |
michael@0 | 13 | #include "nsExpirationTracker.h" |
michael@0 | 14 | #include "nsRect.h" |
michael@0 | 15 | #include "nsString.h" |
michael@0 | 16 | #include "mozilla/Attributes.h" |
michael@0 | 17 | |
michael@0 | 18 | class nsSHEntry; |
michael@0 | 19 | class nsISHEntry; |
michael@0 | 20 | class nsIDocument; |
michael@0 | 21 | class nsIContentViewer; |
michael@0 | 22 | class nsIDocShellTreeItem; |
michael@0 | 23 | class nsILayoutHistoryState; |
michael@0 | 24 | class nsDocShellEditorData; |
michael@0 | 25 | class nsISupportsArray; |
michael@0 | 26 | |
michael@0 | 27 | // A document may have multiple SHEntries, either due to hash navigations or |
michael@0 | 28 | // calls to history.pushState. SHEntries corresponding to the same document |
michael@0 | 29 | // share many members; in particular, they share state related to the |
michael@0 | 30 | // back/forward cache. |
michael@0 | 31 | // |
michael@0 | 32 | // nsSHEntryShared is the vehicle for this sharing. |
michael@0 | 33 | class nsSHEntryShared MOZ_FINAL : public nsIBFCacheEntry, |
michael@0 | 34 | public nsIMutationObserver |
michael@0 | 35 | { |
michael@0 | 36 | public: |
michael@0 | 37 | static void Startup(); |
michael@0 | 38 | static void Shutdown(); |
michael@0 | 39 | |
michael@0 | 40 | nsSHEntryShared(); |
michael@0 | 41 | ~nsSHEntryShared(); |
michael@0 | 42 | |
michael@0 | 43 | NS_DECL_ISUPPORTS |
michael@0 | 44 | NS_DECL_NSIMUTATIONOBSERVER |
michael@0 | 45 | NS_DECL_NSIBFCACHEENTRY |
michael@0 | 46 | |
michael@0 | 47 | private: |
michael@0 | 48 | friend class nsSHEntry; |
michael@0 | 49 | |
michael@0 | 50 | friend class HistoryTracker; |
michael@0 | 51 | friend class nsExpirationTracker<nsSHEntryShared, 3>; |
michael@0 | 52 | nsExpirationState *GetExpirationState() { return &mExpirationState; } |
michael@0 | 53 | |
michael@0 | 54 | static already_AddRefed<nsSHEntryShared> Duplicate(nsSHEntryShared *aEntry); |
michael@0 | 55 | |
michael@0 | 56 | void RemoveFromExpirationTracker(); |
michael@0 | 57 | void Expire(); |
michael@0 | 58 | nsresult SyncPresentationState(); |
michael@0 | 59 | void DropPresentationState(); |
michael@0 | 60 | |
michael@0 | 61 | nsresult SetContentViewer(nsIContentViewer *aViewer); |
michael@0 | 62 | |
michael@0 | 63 | // See nsISHEntry.idl for an explanation of these members. |
michael@0 | 64 | |
michael@0 | 65 | // These members are copied by nsSHEntryShared::Duplicate(). If you add a |
michael@0 | 66 | // member here, be sure to update the Duplicate() implementation. |
michael@0 | 67 | uint64_t mDocShellID; |
michael@0 | 68 | nsCOMArray<nsIDocShellTreeItem> mChildShells; |
michael@0 | 69 | nsCOMPtr<nsISupports> mOwner; |
michael@0 | 70 | nsCString mContentType; |
michael@0 | 71 | bool mIsFrameNavigation; |
michael@0 | 72 | bool mSaveLayoutState; |
michael@0 | 73 | bool mSticky; |
michael@0 | 74 | bool mDynamicallyCreated; |
michael@0 | 75 | nsCOMPtr<nsISupports> mCacheKey; |
michael@0 | 76 | uint32_t mLastTouched; |
michael@0 | 77 | |
michael@0 | 78 | // These members aren't copied by nsSHEntryShared::Duplicate() because |
michael@0 | 79 | // they're specific to a particular content viewer. |
michael@0 | 80 | uint64_t mID; |
michael@0 | 81 | nsCOMPtr<nsIContentViewer> mContentViewer; |
michael@0 | 82 | nsCOMPtr<nsIDocument> mDocument; |
michael@0 | 83 | nsCOMPtr<nsILayoutHistoryState> mLayoutHistoryState; |
michael@0 | 84 | bool mExpired; |
michael@0 | 85 | nsCOMPtr<nsISupports> mWindowState; |
michael@0 | 86 | nsIntRect mViewerBounds; |
michael@0 | 87 | nsCOMPtr<nsISupportsArray> mRefreshURIList; |
michael@0 | 88 | nsExpirationState mExpirationState; |
michael@0 | 89 | nsAutoPtr<nsDocShellEditorData> mEditorData; |
michael@0 | 90 | }; |
michael@0 | 91 | |
michael@0 | 92 | #endif |