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 | // 7zCompressionMode.h |
michael@0 | 2 | |
michael@0 | 3 | #ifndef __7Z_COMPRESSION_MODE_H |
michael@0 | 4 | #define __7Z_COMPRESSION_MODE_H |
michael@0 | 5 | |
michael@0 | 6 | #include "../../../Windows/PropVariant.h" |
michael@0 | 7 | |
michael@0 | 8 | #include "7zMethodID.h" |
michael@0 | 9 | |
michael@0 | 10 | namespace NArchive { |
michael@0 | 11 | namespace N7z { |
michael@0 | 12 | |
michael@0 | 13 | struct CProperty |
michael@0 | 14 | { |
michael@0 | 15 | PROPID PropID; |
michael@0 | 16 | NWindows::NCOM::CPropVariant Value; |
michael@0 | 17 | }; |
michael@0 | 18 | |
michael@0 | 19 | struct CMethodFull |
michael@0 | 20 | { |
michael@0 | 21 | CMethodID MethodID; |
michael@0 | 22 | UInt32 NumInStreams; |
michael@0 | 23 | UInt32 NumOutStreams; |
michael@0 | 24 | bool IsSimpleCoder() const |
michael@0 | 25 | { return (NumInStreams == 1) && (NumOutStreams == 1); } |
michael@0 | 26 | |
michael@0 | 27 | #ifdef EXCLUDE_COM |
michael@0 | 28 | #else |
michael@0 | 29 | CLSID EncoderClassID; |
michael@0 | 30 | CSysString FilePath; |
michael@0 | 31 | #endif |
michael@0 | 32 | |
michael@0 | 33 | CObjectVector<CProperty> CoderProperties; |
michael@0 | 34 | }; |
michael@0 | 35 | |
michael@0 | 36 | struct CBind |
michael@0 | 37 | { |
michael@0 | 38 | UInt32 InCoder; |
michael@0 | 39 | UInt32 InStream; |
michael@0 | 40 | UInt32 OutCoder; |
michael@0 | 41 | UInt32 OutStream; |
michael@0 | 42 | }; |
michael@0 | 43 | |
michael@0 | 44 | struct CCompressionMethodMode |
michael@0 | 45 | { |
michael@0 | 46 | CObjectVector<CMethodFull> Methods; |
michael@0 | 47 | CRecordVector<CBind> Binds; |
michael@0 | 48 | #ifdef COMPRESS_MT |
michael@0 | 49 | UInt32 NumThreads; |
michael@0 | 50 | #endif |
michael@0 | 51 | bool PasswordIsDefined; |
michael@0 | 52 | UString Password; |
michael@0 | 53 | |
michael@0 | 54 | bool IsEmpty() const { return (Methods.IsEmpty() && !PasswordIsDefined); } |
michael@0 | 55 | CCompressionMethodMode(): PasswordIsDefined(false) |
michael@0 | 56 | #ifdef COMPRESS_MT |
michael@0 | 57 | , NumThreads(1) |
michael@0 | 58 | #endif |
michael@0 | 59 | {} |
michael@0 | 60 | }; |
michael@0 | 61 | |
michael@0 | 62 | }} |
michael@0 | 63 | |
michael@0 | 64 | #endif |