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