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

Unified Diff: core/fxcodec/codec/fx_codec_flate.cpp

Issue 2618863004: Remove CFX_ArrayTemplate from fpdftext and fxcodec. (Closed)
Patch Set: unused Created 3 years, 11 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
« no previous file with comments | « core/fpdftext/cpdf_textpage.cpp ('k') | core/fxcodec/codec/fx_codec_gif.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fxcodec/codec/fx_codec_flate.cpp
diff --git a/core/fxcodec/codec/fx_codec_flate.cpp b/core/fxcodec/codec/fx_codec_flate.cpp
index d01b40f3181fed77fdd151721ddb67278218bc4b..3cffc0b7cf3023b9af3f1f589db6cfc443c166ba 100644
--- a/core/fxcodec/codec/fx_codec_flate.cpp
+++ b/core/fxcodec/codec/fx_codec_flate.cpp
@@ -9,6 +9,7 @@
#include <algorithm>
#include <memory>
#include <utility>
+#include <vector>
#include "core/fxcodec/fx_codec.h"
#include "core/fxcrt/fx_ext.h"
@@ -567,37 +568,36 @@ void FlateUncompress(const uint8_t* src_buf,
}
dest_buf = guess_buf.release();
} else {
- CFX_ArrayTemplate<uint8_t*> result_tmp_bufs;
+ std::vector<uint8_t*> result_tmp_bufs;
uint8_t* cur_buf = guess_buf.release();
while (1) {
int32_t ret = FPDFAPI_FlateOutput(context, cur_buf, buf_size);
int32_t avail_buf_size = FPDFAPI_FlateGetAvailOut(context);
if (ret != Z_OK) {
last_buf_size = buf_size - avail_buf_size;
- result_tmp_bufs.Add(cur_buf);
+ result_tmp_bufs.push_back(cur_buf);
break;
}
if (avail_buf_size != 0) {
last_buf_size = buf_size - avail_buf_size;
- result_tmp_bufs.Add(cur_buf);
+ result_tmp_bufs.push_back(cur_buf);
break;
}
-
- result_tmp_bufs.Add(cur_buf);
+ result_tmp_bufs.push_back(cur_buf);
cur_buf = FX_Alloc(uint8_t, buf_size + 1);
cur_buf[buf_size] = '\0';
}
dest_size = FPDFAPI_FlateGetTotalOut(context);
offset = FPDFAPI_FlateGetTotalIn(context);
- if (result_tmp_bufs.GetSize() == 1) {
+ if (result_tmp_bufs.size() == 1) {
dest_buf = result_tmp_bufs[0];
} else {
uint8_t* result_buf = FX_Alloc(uint8_t, dest_size);
uint32_t result_pos = 0;
- for (int32_t i = 0; i < result_tmp_bufs.GetSize(); i++) {
+ for (size_t i = 0; i < result_tmp_bufs.size(); i++) {
uint8_t* tmp_buf = result_tmp_bufs[i];
uint32_t tmp_buf_size = buf_size;
- if (i == result_tmp_bufs.GetSize() - 1) {
+ if (i == result_tmp_bufs.size() - 1) {
tmp_buf_size = last_buf_size;
}
FXSYS_memcpy(result_buf + result_pos, tmp_buf, tmp_buf_size);
« no previous file with comments | « core/fpdftext/cpdf_textpage.cpp ('k') | core/fxcodec/codec/fx_codec_gif.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698