editor/txmgr/idl/nsITransaction.idl

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

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.

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

mercurial