Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(163)

Side by Side Diff: third_party/lzma/v4_65/files/CPP/7zip/Common/ProgressUtils.cpp

Issue 624713003: Keep only base/extractor.[cc|h]. (Closed) Base URL: https://chromium.googlesource.com/external/omaha.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // ProgressUtils.h
2
3 #include "StdAfx.h"
4
5 #include "ProgressUtils.h"
6
7 CLocalProgress::CLocalProgress()
8 {
9 ProgressOffset = InSize = OutSize = 0;
10 SendRatio = SendProgress = true;
11 }
12
13 void CLocalProgress::Init(IProgress *progress, bool inSizeIsMain)
14 {
15 _ratioProgress.Release();
16 _progress = progress;
17 _progress.QueryInterface(IID_ICompressProgressInfo, &_ratioProgress);
18 _inSizeIsMain = inSizeIsMain;
19 }
20
21 STDMETHODIMP CLocalProgress::SetRatioInfo(const UInt64 *inSize, const UInt64 *ou tSize)
22 {
23 UInt64 inSizeNew = InSize, outSizeNew = OutSize;
24 if (inSize)
25 inSizeNew += (*inSize);
26 if (outSize)
27 outSizeNew += (*outSize);
28 if (SendRatio && _ratioProgress)
29 {
30 RINOK(_ratioProgress->SetRatioInfo(&inSizeNew, &outSizeNew));
31 }
32 inSizeNew += ProgressOffset;
33 outSizeNew += ProgressOffset;
34 if (SendProgress)
35 return _progress->SetCompleted(_inSizeIsMain ? &inSizeNew : &outSizeNew);
36 return S_OK;
37 }
38
39 HRESULT CLocalProgress::SetCur()
40 {
41 return SetRatioInfo(NULL, NULL);
42 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698