summaryrefslogtreecommitdiff
path: root/core/src/fxcodec/codec
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-12-24 19:13:32 -0800
committerLei Zhang <thestig@chromium.org>2015-12-24 19:13:32 -0800
commitaa8bf7e42b8c73a9bc07ed6781364ba05f5a9776 (patch)
treea5a435608eb527db39e2c9324737bd230e762030 /core/src/fxcodec/codec
parent25ae22692cdd5b4ae4783ecb27eba79b3c794b2c (diff)
downloadpdfium-aa8bf7e42b8c73a9bc07ed6781364ba05f5a9776.tar.xz
Merge to XFA: Switch from nonstd::unique_ptr to std::unique_ptr.
TBR=thakis@chromium.org Review URL: https://codereview.chromium.org/1547833002 . (cherry picked from commit d20dfba2ae10e8aeb328328f09da79ff904110a8) Review URL: https://codereview.chromium.org/1545183002 .
Diffstat (limited to 'core/src/fxcodec/codec')
-rw-r--r--core/src/fxcodec/codec/codec_int.h7
-rw-r--r--core/src/fxcodec/codec/fx_codec.cpp2
-rw-r--r--core/src/fxcodec/codec/fx_codec_flate.cpp10
-rw-r--r--core/src/fxcodec/codec/fx_codec_jpx_opj.cpp2
4 files changed, 12 insertions, 9 deletions
diff --git a/core/src/fxcodec/codec/codec_int.h b/core/src/fxcodec/codec/codec_int.h
index 2950cfe2ae..707088e1a9 100644
--- a/core/src/fxcodec/codec/codec_int.h
+++ b/core/src/fxcodec/codec/codec_int.h
@@ -8,12 +8,13 @@
#define CORE_SRC_FXCODEC_CODEC_CODEC_INT_H_
#include <limits.h>
+
#include <list>
#include <map>
+#include <memory>
#include "core/include/fxcodec/fx_codec.h"
#include "core/src/fxcodec/jbig2/JBig2_Context.h"
-#include "third_party/base/nonstd_unique_ptr.h"
#include "third_party/libopenjpeg20/openjpeg.h" // For OPJ_SIZE_T.
class CFX_IccProfileCache;
@@ -78,7 +79,7 @@ class CCodec_ScanlineDecoder : public ICodec_ScanlineDecoder {
const int m_Height;
const FX_DWORD m_Pitch;
int m_nCachedLines;
- nonstd::unique_ptr<uint8_t, FxFreeDeleter> m_Data;
+ std::unique_ptr<uint8_t, FxFreeDeleter> m_Data;
};
virtual FX_BOOL v_Rewind() = 0;
@@ -98,7 +99,7 @@ class CCodec_ScanlineDecoder : public ICodec_ScanlineDecoder {
FX_BOOL m_bColorTransformed;
int m_NextLine;
uint8_t* m_pLastScanline;
- nonstd::unique_ptr<ImageDataCache> m_pDataCache;
+ std::unique_ptr<ImageDataCache> m_pDataCache;
};
class CCodec_FaxModule : public ICodec_FaxModule {
diff --git a/core/src/fxcodec/codec/fx_codec.cpp b/core/src/fxcodec/codec/fx_codec.cpp
index f856f43958..82a6ae67da 100644
--- a/core/src/fxcodec/codec/fx_codec.cpp
+++ b/core/src/fxcodec/codec/fx_codec.cpp
@@ -141,7 +141,7 @@ void CCodec_ScanlineDecoder::DownScale(int dest_width, int dest_height) {
return;
}
- nonstd::unique_ptr<ImageDataCache> cache(
+ std::unique_ptr<ImageDataCache> cache(
new ImageDataCache(m_OutputWidth, m_OutputHeight, m_Pitch));
if (!cache->AllocateCache())
return;
diff --git a/core/src/fxcodec/codec/fx_codec_flate.cpp b/core/src/fxcodec/codec/fx_codec_flate.cpp
index b293781318..17f20da1de 100644
--- a/core/src/fxcodec/codec/fx_codec_flate.cpp
+++ b/core/src/fxcodec/codec/fx_codec_flate.cpp
@@ -5,9 +5,11 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#include "codec_int.h"
+
+#include <memory>
+
#include "core/include/fxcodec/fx_codec.h"
#include "core/include/fxcodec/fx_codec_flate.h"
-#include "third_party/base/nonstd_unique_ptr.h"
#include "third_party/zlib_v128/zlib.h"
extern "C" {
@@ -639,7 +641,7 @@ void FlateUncompress(const uint8_t* src_buf,
if (!context)
return;
- nonstd::unique_ptr<uint8_t, FxFreeDeleter> guess_buf(
+ std::unique_ptr<uint8_t, FxFreeDeleter> guess_buf(
FX_Alloc(uint8_t, guess_size + 1));
guess_buf.get()[guess_size] = '\0';
@@ -933,7 +935,7 @@ FX_DWORD CCodec_FlateModule::FlateOrLZWDecode(FX_BOOL bLZW,
}
if (bLZW) {
{
- nonstd::unique_ptr<CLZWDecoder> decoder(new CLZWDecoder);
+ std::unique_ptr<CLZWDecoder> decoder(new CLZWDecoder);
dest_size = (FX_DWORD)-1;
offset = src_size;
int err = decoder->Decode(NULL, dest_size, src_buf, offset, bEarlyChange);
@@ -942,7 +944,7 @@ FX_DWORD CCodec_FlateModule::FlateOrLZWDecode(FX_BOOL bLZW,
}
}
{
- nonstd::unique_ptr<CLZWDecoder> decoder(new CLZWDecoder);
+ std::unique_ptr<CLZWDecoder> decoder(new CLZWDecoder);
dest_buf = FX_Alloc(uint8_t, dest_size + 1);
dest_buf[dest_size] = '\0';
decoder->Decode(dest_buf, dest_size, src_buf, offset, bEarlyChange);
diff --git a/core/src/fxcodec/codec/fx_codec_jpx_opj.cpp b/core/src/fxcodec/codec/fx_codec_jpx_opj.cpp
index d3276450c9..c185d224f0 100644
--- a/core/src/fxcodec/codec/fx_codec_jpx_opj.cpp
+++ b/core/src/fxcodec/codec/fx_codec_jpx_opj.cpp
@@ -865,7 +865,7 @@ CCodec_JpxModule::~CCodec_JpxModule() {
CJPX_Decoder* CCodec_JpxModule::CreateDecoder(const uint8_t* src_buf,
FX_DWORD src_size,
CPDF_ColorSpace* cs) {
- nonstd::unique_ptr<CJPX_Decoder> decoder(new CJPX_Decoder(cs));
+ std::unique_ptr<CJPX_Decoder> decoder(new CJPX_Decoder(cs));
return decoder->Init(src_buf, src_size) ? decoder.release() : nullptr;
}