other-licenses/7zstub/src/7zip/Common/ProgressUtils.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 // ProgressUtils.h
     3 #ifndef __PROGRESSUTILS_H
     4 #define __PROGRESSUTILS_H
     6 #include "../../Common/MyCom.h"
     8 #include "../ICoder.h"
     9 #include "../IProgress.h"
    11 class CLocalCompressProgressInfo: 
    12   public ICompressProgressInfo,
    13   public CMyUnknownImp
    14 {
    15   CMyComPtr<ICompressProgressInfo> _progress;
    16   bool _inStartValueIsAssigned;
    17   bool _outStartValueIsAssigned;
    18   UInt64 _inStartValue;
    19   UInt64 _outStartValue;
    20 public:
    21   void Init(ICompressProgressInfo *progress, 
    22       const UInt64 *inStartValue, const UInt64 *outStartValue);
    24   MY_UNKNOWN_IMP
    26   STDMETHOD(SetRatioInfo)(const UInt64 *inSize, const UInt64 *outSize);
    27 };
    29 class CLocalProgress: 
    30   public ICompressProgressInfo,
    31   public CMyUnknownImp
    32 {
    33   CMyComPtr<IProgress> _progress;
    34   bool _inSizeIsMain;
    35 public:
    36   void Init(IProgress *progress, bool inSizeIsMain);
    38   MY_UNKNOWN_IMP
    40   STDMETHOD(SetRatioInfo)(const UInt64 *inSize, const UInt64 *outSize);
    41 };
    43 #endif

mercurial