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 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #include "nsISupports.idl" |
michael@0 | 7 | |
michael@0 | 8 | interface nsIBFCacheEntry; |
michael@0 | 9 | interface nsISHEntry; |
michael@0 | 10 | interface nsISHistoryListener; |
michael@0 | 11 | interface nsISHTransaction; |
michael@0 | 12 | interface nsIDocShell; |
michael@0 | 13 | interface nsIURI; |
michael@0 | 14 | |
michael@0 | 15 | %{C++ |
michael@0 | 16 | #define NS_SHISTORY_INTERNAL_CID \ |
michael@0 | 17 | { 0x9c47c121, 0x1c6e, 0x4d8f, \ |
michael@0 | 18 | { 0xb9, 0x04, 0x3a, 0xc9, 0x68, 0x11, 0x6e, 0x88 } } |
michael@0 | 19 | |
michael@0 | 20 | #define NS_SHISTORY_INTERNAL_CONTRACTID "@mozilla.org/browser/shistory-internal;1" |
michael@0 | 21 | |
michael@0 | 22 | #include "nsTArrayForwardDeclare.h" |
michael@0 | 23 | %} |
michael@0 | 24 | |
michael@0 | 25 | [ref] native nsDocshellIDArray(nsTArray<uint64_t>); |
michael@0 | 26 | |
michael@0 | 27 | [scriptable, uuid(f9348014-0239-11e2-b029-3d38e719eb2d)] |
michael@0 | 28 | interface nsISHistoryInternal: nsISupports |
michael@0 | 29 | { |
michael@0 | 30 | /** |
michael@0 | 31 | * Add a new Entry to the History List |
michael@0 | 32 | * @param aEntry - The entry to add |
michael@0 | 33 | * @param aPersist - If true this specifies that the entry should persist |
michael@0 | 34 | * in the list. If false, this means that when new entries are added |
michael@0 | 35 | * this element will not appear in the session history list. |
michael@0 | 36 | */ |
michael@0 | 37 | void addEntry(in nsISHEntry aEntry, in boolean aPersist); |
michael@0 | 38 | |
michael@0 | 39 | /** |
michael@0 | 40 | * Get the root transaction |
michael@0 | 41 | */ |
michael@0 | 42 | readonly attribute nsISHTransaction rootTransaction; |
michael@0 | 43 | |
michael@0 | 44 | /** |
michael@0 | 45 | * The toplevel docshell object to which this SHistory object belongs to. |
michael@0 | 46 | */ |
michael@0 | 47 | attribute nsIDocShell rootDocShell; |
michael@0 | 48 | |
michael@0 | 49 | /** |
michael@0 | 50 | * Update the index maintained by sessionHistory |
michael@0 | 51 | */ |
michael@0 | 52 | void updateIndex(); |
michael@0 | 53 | |
michael@0 | 54 | /** |
michael@0 | 55 | * Replace the nsISHEntry at a particular index |
michael@0 | 56 | * @param aIndex - The index at which the entry should be replaced |
michael@0 | 57 | * @param aReplaceEntry - The replacement entry for the index. |
michael@0 | 58 | */ |
michael@0 | 59 | void replaceEntry(in long aIndex, in nsISHEntry aReplaceEntry); |
michael@0 | 60 | |
michael@0 | 61 | /** |
michael@0 | 62 | * Notifies all registered session history listeners about an impending |
michael@0 | 63 | * reload. |
michael@0 | 64 | * |
michael@0 | 65 | * @param aReloadURI The URI of the document to be reloaded. |
michael@0 | 66 | * @param aReloadFlags Flags that indicate how the document is to be |
michael@0 | 67 | * refreshed. See constants on the nsIWebNavigation |
michael@0 | 68 | * interface. |
michael@0 | 69 | * @return Whether the operation can proceed. |
michael@0 | 70 | */ |
michael@0 | 71 | boolean notifyOnHistoryReload(in nsIURI aReloadURI, in unsigned long aReloadFlags); |
michael@0 | 72 | |
michael@0 | 73 | /** |
michael@0 | 74 | * Evict content viewers which don't lie in the "safe" range around aIndex. |
michael@0 | 75 | * In practice, this should leave us with no more than gHistoryMaxViewers |
michael@0 | 76 | * viewers associated with this SHistory object. |
michael@0 | 77 | * |
michael@0 | 78 | * Also make sure that the total number of content viewers in all windows is |
michael@0 | 79 | * not greater than our global max; if it is, evict viewers as appropriate. |
michael@0 | 80 | * |
michael@0 | 81 | * @param aIndex - The index around which the "safe" range is centered. In |
michael@0 | 82 | * general, if you just navigated the history, aIndex should be the index |
michael@0 | 83 | * history was navigated to. |
michael@0 | 84 | */ |
michael@0 | 85 | void evictOutOfRangeContentViewers(in long aIndex); |
michael@0 | 86 | |
michael@0 | 87 | /** |
michael@0 | 88 | * Evict the content viewer associated with a bfcache entry |
michael@0 | 89 | * that has timed out. |
michael@0 | 90 | */ |
michael@0 | 91 | void evictExpiredContentViewerForEntry(in nsIBFCacheEntry aEntry); |
michael@0 | 92 | |
michael@0 | 93 | /** |
michael@0 | 94 | * Evict all the content viewers in this session history |
michael@0 | 95 | */ |
michael@0 | 96 | void evictAllContentViewers(); |
michael@0 | 97 | |
michael@0 | 98 | /** |
michael@0 | 99 | * Removes entries from the history if their docshellID is in |
michael@0 | 100 | * aIDs array. |
michael@0 | 101 | */ |
michael@0 | 102 | [noscript, notxpcom] void RemoveEntries(in nsDocshellIDArray aIDs, |
michael@0 | 103 | in long aStartIndex); |
michael@0 | 104 | }; |