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

Unified Diff: third_party/lzma/v4_65/files/CPP/7zip/Common/StreamUtils.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 side-by-side diff with in-line comments
Download patch
Index: third_party/lzma/v4_65/files/CPP/7zip/Common/StreamUtils.cpp
diff --git a/third_party/lzma/v4_65/files/CPP/7zip/Common/StreamUtils.cpp b/third_party/lzma/v4_65/files/CPP/7zip/Common/StreamUtils.cpp
deleted file mode 100644
index 049e4aa1754454329203d0ec1bb4127947df6c26..0000000000000000000000000000000000000000
--- a/third_party/lzma/v4_65/files/CPP/7zip/Common/StreamUtils.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-// StreamUtils.cpp
-
-#include "StdAfx.h"
-
-#include "StreamUtils.h"
-
-static const UInt32 kBlockSize = ((UInt32)1 << 31);
-
-HRESULT ReadStream(ISequentialInStream *stream, void *data, size_t *processedSize)
-{
- size_t size = *processedSize;
- *processedSize = 0;
- while (size != 0)
- {
- UInt32 curSize = (size < kBlockSize) ? (UInt32)size : kBlockSize;
- UInt32 processedSizeLoc;
- HRESULT res = stream->Read(data, curSize, &processedSizeLoc);
- *processedSize += processedSizeLoc;
- data = (void *)((Byte *)data + processedSizeLoc);
- size -= processedSizeLoc;
- RINOK(res);
- if (processedSizeLoc == 0)
- return S_OK;
- }
- return S_OK;
-}
-
-HRESULT ReadStream_FALSE(ISequentialInStream *stream, void *data, size_t size)
-{
- size_t processedSize = size;
- RINOK(ReadStream(stream, data, &processedSize));
- return (size == processedSize) ? S_OK : S_FALSE;
-}
-
-HRESULT ReadStream_FAIL(ISequentialInStream *stream, void *data, size_t size)
-{
- size_t processedSize = size;
- RINOK(ReadStream(stream, data, &processedSize));
- return (size == processedSize) ? S_OK : E_FAIL;
-}
-
-HRESULT WriteStream(ISequentialOutStream *stream, const void *data, size_t size)
-{
- while (size != 0)
- {
- UInt32 curSize = (size < kBlockSize) ? (UInt32)size : kBlockSize;
- UInt32 processedSizeLoc;
- HRESULT res = stream->Write(data, curSize, &processedSizeLoc);
- data = (const void *)((const Byte *)data + processedSizeLoc);
- size -= processedSizeLoc;
- RINOK(res);
- if (processedSizeLoc == 0)
- return E_FAIL;
- }
- return S_OK;
-}
« no previous file with comments | « third_party/lzma/v4_65/files/CPP/7zip/Common/StreamUtils.h ('k') | third_party/lzma/v4_65/files/CPP/7zip/Common/VirtThread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698