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

Side by Side Diff: third_party/lzma/v4_65/files/CPP/7zip/Archive/Common/InStreamWithCRC.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 // InStreamWithCRC.cpp
2
3 #include "StdAfx.h"
4
5 #include "InStreamWithCRC.h"
6
7 STDMETHODIMP CSequentialInStreamWithCRC::Read(void *data, UInt32 size, UInt32 *p rocessedSize)
8 {
9 UInt32 realProcessedSize;
10 HRESULT result = _stream->Read(data, size, &realProcessedSize);
11 _size += realProcessedSize;
12 if (size > 0 && realProcessedSize == 0)
13 _wasFinished = true;
14 _crc = CrcUpdate(_crc, data, realProcessedSize);
15 if(processedSize != NULL)
16 *processedSize = realProcessedSize;
17 return result;
18 }
19
20 STDMETHODIMP CInStreamWithCRC::Read(void *data, UInt32 size, UInt32 *processedSi ze)
21 {
22 UInt32 realProcessedSize;
23 HRESULT result = _stream->Read(data, size, &realProcessedSize);
24 if (size > 0 && realProcessedSize == 0)
25 _wasFinished = true;
26 _size += realProcessedSize;
27 _crc = CrcUpdate(_crc, data, realProcessedSize);
28 if(processedSize != NULL)
29 *processedSize = realProcessedSize;
30 return result;
31 }
32
33 STDMETHODIMP CInStreamWithCRC::Seek(Int64 offset, UInt32 seekOrigin, UInt64 *new Position)
34 {
35 if (seekOrigin != STREAM_SEEK_SET || offset != 0)
36 return E_FAIL;
37 _size = 0;
38 _crc = CRC_INIT_VAL;
39 return _stream->Seek(offset, seekOrigin, newPosition);
40 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698