Tue, 06 Jan 2015 21:39:09 +0100
Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
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 | /* |
michael@0 | 9 | * The nsITransaction interface. |
michael@0 | 10 | * <P> |
michael@0 | 11 | * This interface is implemented by an object that needs to |
michael@0 | 12 | * execute some behavior that must be tracked by the transaction manager. |
michael@0 | 13 | */ |
michael@0 | 14 | [scriptable, uuid(58e330c1-7b48-11d2-98b9-00805f297d89)] |
michael@0 | 15 | interface nsITransaction : nsISupports |
michael@0 | 16 | { |
michael@0 | 17 | /** |
michael@0 | 18 | * Executes the transaction. |
michael@0 | 19 | */ |
michael@0 | 20 | void doTransaction(); |
michael@0 | 21 | |
michael@0 | 22 | /** |
michael@0 | 23 | * Restores the state to what it was before the transaction was executed. |
michael@0 | 24 | */ |
michael@0 | 25 | void undoTransaction(); |
michael@0 | 26 | |
michael@0 | 27 | /** |
michael@0 | 28 | * Executes the transaction again. Can only be called on a transaction that |
michael@0 | 29 | * was previously undone. |
michael@0 | 30 | * <P> |
michael@0 | 31 | * In most cases, the redoTransaction() method will actually call the |
michael@0 | 32 | * doTransaction() method to execute the transaction again. |
michael@0 | 33 | */ |
michael@0 | 34 | void redoTransaction(); |
michael@0 | 35 | |
michael@0 | 36 | /** |
michael@0 | 37 | * The transaction's transient state. This attribute is checked by |
michael@0 | 38 | * the transaction manager after the transaction's Execute() method is called. |
michael@0 | 39 | * If the transient state is false, a reference to the transaction is |
michael@0 | 40 | * held by the transaction manager so that the transactions' undoTransaction() |
michael@0 | 41 | * and redoTransaction() methods can be called. If the transient state is |
michael@0 | 42 | * true, the transaction manager returns immediately after the transaction's |
michael@0 | 43 | * doTransaction() method is called, no references to the transaction are |
michael@0 | 44 | * maintained. Transient transactions cannot be undone or redone by the |
michael@0 | 45 | * transaction manager. |
michael@0 | 46 | */ |
michael@0 | 47 | readonly attribute boolean isTransient; |
michael@0 | 48 | |
michael@0 | 49 | /** |
michael@0 | 50 | * Attempts to merge a transaction into "this" transaction. Both transactions |
michael@0 | 51 | * must be in their undo state, doTransaction() methods already called. The |
michael@0 | 52 | * transaction manager calls this method to coalesce a new transaction with |
michael@0 | 53 | * the transaction on the top of the undo stack. |
michael@0 | 54 | * This method returns a boolean value that indicates the merge result. |
michael@0 | 55 | * A true value indicates that the transactions were merged successfully, |
michael@0 | 56 | * a false value if the merge was not possible or failed. If true, |
michael@0 | 57 | * the transaction manager will Release() the new transacton instead of |
michael@0 | 58 | * pushing it on the undo stack. |
michael@0 | 59 | * @param aTransaction the previously executed transaction to merge. |
michael@0 | 60 | */ |
michael@0 | 61 | boolean merge(in nsITransaction aTransaction); |
michael@0 | 62 | }; |
michael@0 | 63 |