other-licenses/7zstub/src/7zip/Archive/7z/7zDecode.h

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 // 7zDecode.h
     3 #ifndef __7Z_DECODE_H
     4 #define __7Z_DECODE_H
     6 #include "../../IStream.h"
     7 #include "../../IPassword.h"
     9 #include "../Common/CoderMixer2.h"
    10 #include "../Common/CoderMixer2MT.h"
    11 #ifdef _ST_MODE
    12 #include "../Common/CoderMixer2ST.h"
    13 #endif
    14 #ifndef EXCLUDE_COM
    15 #include "../Common/CoderLoader.h"
    16 #endif
    18 #include "7zItem.h"
    20 namespace NArchive {
    21 namespace N7z {
    23 struct CBindInfoEx: public NCoderMixer2::CBindInfo
    24 {
    25   CRecordVector<CMethodID> CoderMethodIDs;
    26   void Clear()
    27   {
    28     CBindInfo::Clear();
    29     CoderMethodIDs.Clear();
    30   }
    31 };
    33 class CDecoder
    34 {
    35   #ifndef EXCLUDE_COM
    36   CCoderLibraries _libraries;
    37   #endif
    39   bool _bindInfoExPrevIsDefinded;
    40   CBindInfoEx _bindInfoExPrev;
    42   bool _multiThread;
    43   #ifdef _ST_MODE
    44   NCoderMixer2::CCoderMixer2ST *_mixerCoderSTSpec;
    45   #endif
    46   NCoderMixer2::CCoderMixer2MT *_mixerCoderMTSpec;
    47   NCoderMixer2::CCoderMixer2 *_mixerCoderCommon;
    49   CMyComPtr<ICompressCoder2> _mixerCoder;
    50   CObjectVector<CMyComPtr<IUnknown> > _decoders;
    51   // CObjectVector<CMyComPtr<ICompressCoder2> > _decoders2;
    52 public:
    53   CDecoder(bool multiThread);
    54   HRESULT Decode(IInStream *inStream,
    55       UInt64 startPos,
    56       const UInt64 *packSizes,
    57       const CFolder &folder, 
    58       ISequentialOutStream *outStream,
    59       ICompressProgressInfo *compressProgress
    60       #ifndef _NO_CRYPTO
    61       , ICryptoGetTextPassword *getTextPasswordSpec
    62       #endif
    63       #ifdef COMPRESS_MT
    64       , bool mtMode, UInt32 numThreads
    65       #endif
    66       );
    67 };
    69 }}
    71 #endif

mercurial