summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-12-24 19:00:05 -0800
committerLei Zhang <thestig@chromium.org>2015-12-24 19:00:05 -0800
commitd20dfba2ae10e8aeb328328f09da79ff904110a8 (patch)
tree560bc512ddec373595a9f719996e1d13338f72da /fpdfsdk
parentbab9a98b71f351cf9f4eb39138bca55e3be4ef15 (diff)
downloadpdfium-d20dfba2ae10e8aeb328328f09da79ff904110a8.tar.xz
Switch from nonstd::unique_ptr to std::unique_ptr.
R=thakis@chromium.org Review URL: https://codereview.chromium.org/1547833002 .
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/include/fsdk_actionhandler.h5
-rw-r--r--fpdfsdk/include/fsdk_mgr.h18
-rw-r--r--fpdfsdk/src/fpdfformfill.cpp7
-rw-r--r--fpdfsdk/src/fpdfppo.cpp5
-rw-r--r--fpdfsdk/src/fpdfview.cpp5
-rw-r--r--fpdfsdk/src/fsdk_baseform.cpp7
-rw-r--r--fpdfsdk/src/fsdk_mgr.cpp6
-rw-r--r--fpdfsdk/src/javascript/Field.cpp2
-rw-r--r--fpdfsdk/src/javascript/JS_Object.h4
-rw-r--r--fpdfsdk/src/javascript/JS_Runtime_Stub.cpp5
-rw-r--r--fpdfsdk/src/javascript/app.cpp5
11 files changed, 38 insertions, 31 deletions
diff --git a/fpdfsdk/include/fsdk_actionhandler.h b/fpdfsdk/include/fsdk_actionhandler.h
index 4417280a83..33f127d8c9 100644
--- a/fpdfsdk/include/fsdk_actionhandler.h
+++ b/fpdfsdk/include/fsdk_actionhandler.h
@@ -7,10 +7,11 @@
#ifndef FPDFSDK_INCLUDE_FSDK_ACTIONHANDLER_H_
#define FPDFSDK_INCLUDE_FSDK_ACTIONHANDLER_H_
+#include <memory>
+
#include "core/include/fpdfdoc/fpdf_doc.h"
#include "core/include/fxcrt/fx_string.h"
#include "fsdk_baseform.h"
-#include "third_party/base/nonstd_unique_ptr.h"
class CFX_PtrList;
class CPDFSDK_Annot;
@@ -116,7 +117,7 @@ class CPDFSDK_ActionHandler {
void DoAction_SetOCGState(CPDFSDK_Document* pDocument,
const CPDF_Action& action);
- nonstd::unique_ptr<CPDFSDK_FormActionHandler> m_pFormActionHandler;
+ std::unique_ptr<CPDFSDK_FormActionHandler> m_pFormActionHandler;
};
#endif // FPDFSDK_INCLUDE_FSDK_ACTIONHANDLER_H_
diff --git a/fpdfsdk/include/fsdk_mgr.h b/fpdfsdk/include/fsdk_mgr.h
index 409b49f6a9..a314be8d87 100644
--- a/fpdfsdk/include/fsdk_mgr.h
+++ b/fpdfsdk/include/fsdk_mgr.h
@@ -8,6 +8,7 @@
#define FPDFSDK_INCLUDE_FSDK_MGR_H_
#include <map>
+#include <memory>
#include "core/include/fpdftext/fpdf_text.h"
#include "fsdk_actionhandler.h"
@@ -20,7 +21,6 @@
#include "javascript/IJavaScript.h"
#include "public/fpdf_formfill.h"
#include "public/fpdf_fwlevent.h" // cross platform keycode and events define.
-#include "third_party/base/nonstd_unique_ptr.h"
class CFFL_IFormFiller;
class CPDFSDK_ActionHandler;
@@ -216,14 +216,14 @@ class CPDFDoc_Environment final {
CPDFSDK_ActionHandler* GetActionHander(); // Creates if not present.
private:
- nonstd::unique_ptr<CPDFSDK_AnnotHandlerMgr> m_pAnnotHandlerMgr;
- nonstd::unique_ptr<CPDFSDK_ActionHandler> m_pActionHandler;
- nonstd::unique_ptr<IJS_Runtime> m_pJSRuntime;
+ std::unique_ptr<CPDFSDK_AnnotHandlerMgr> m_pAnnotHandlerMgr;
+ std::unique_ptr<CPDFSDK_ActionHandler> m_pActionHandler;
+ std::unique_ptr<IJS_Runtime> m_pJSRuntime;
FPDF_FORMFILLINFO* const m_pInfo;
CPDFSDK_Document* m_pSDKDoc;
UnderlyingDocumentType* const m_pUnderlyingDoc;
- nonstd::unique_ptr<CFFL_IFormFiller> m_pIFormFiller;
- nonstd::unique_ptr<IFX_SystemHandler> m_pSysHandler;
+ std::unique_ptr<CFFL_IFormFiller> m_pIFormFiller;
+ std::unique_ptr<IFX_SystemHandler> m_pSysHandler;
};
class CPDFSDK_Document {
@@ -283,10 +283,10 @@ class CPDFSDK_Document {
private:
std::map<UnderlyingPageType*, CPDFSDK_PageView*> m_pageMap;
UnderlyingDocumentType* m_pDoc;
- nonstd::unique_ptr<CPDFSDK_InterForm> m_pInterForm;
+ std::unique_ptr<CPDFSDK_InterForm> m_pInterForm;
CPDFSDK_Annot* m_pFocusAnnot;
CPDFDoc_Environment* m_pEnv;
- nonstd::unique_ptr<CPDF_OCContext> m_pOccontent;
+ std::unique_ptr<CPDF_OCContext> m_pOccontent;
FX_BOOL m_bChangeMask;
FX_BOOL m_bBeingDestroyed;
};
@@ -354,7 +354,7 @@ class CPDFSDK_PageView final {
CFX_Matrix m_curMatrix;
UnderlyingPageType* m_page;
- nonstd::unique_ptr<CPDF_AnnotList> m_pAnnotList;
+ std::unique_ptr<CPDF_AnnotList> m_pAnnotList;
std::vector<CPDFSDK_Annot*> m_fxAnnotArray;
CPDFSDK_Document* m_pSDKDoc;
CPDFSDK_Widget* m_CaptureWidget;
diff --git a/fpdfsdk/src/fpdfformfill.cpp b/fpdfsdk/src/fpdfformfill.cpp
index 93cfab8bdf..93b25ffec1 100644
--- a/fpdfsdk/src/fpdfformfill.cpp
+++ b/fpdfsdk/src/fpdfformfill.cpp
@@ -6,10 +6,11 @@
#include "public/fpdf_formfill.h"
+#include <memory>
+
#include "fpdfsdk/include/fsdk_define.h"
#include "fpdfsdk/include/fsdk_mgr.h"
#include "public/fpdfview.h"
-#include "third_party/base/nonstd_unique_ptr.h"
namespace {
@@ -228,9 +229,9 @@ DLLEXPORT void STDCALL FPDF_FFLDraw(FPDF_FORMHANDLE hHandle,
clip.bottom = start_y + size_y;
#ifdef _SKIA_SUPPORT_
- nonstd::unique_ptr<CFX_SkiaDevice> pDevice(new CFX_SkiaDevice);
+ std::unique_ptr<CFX_SkiaDevice> pDevice(new CFX_SkiaDevice);
#else
- nonstd::unique_ptr<CFX_FxgeDevice> pDevice(new CFX_FxgeDevice);
+ std::unique_ptr<CFX_FxgeDevice> pDevice(new CFX_FxgeDevice);
#endif
pDevice->Attach((CFX_DIBitmap*)bitmap);
pDevice->SaveState();
diff --git a/fpdfsdk/src/fpdfppo.cpp b/fpdfsdk/src/fpdfppo.cpp
index 2fce7adfc4..50ef262560 100644
--- a/fpdfsdk/src/fpdfppo.cpp
+++ b/fpdfsdk/src/fpdfppo.cpp
@@ -6,8 +6,9 @@
#include "public/fpdf_ppo.h"
+#include <memory>
+
#include "fpdfsdk/include/fsdk_define.h"
-#include "third_party/base/nonstd_unique_ptr.h"
class CPDF_PageOrganizer {
public:
@@ -91,7 +92,7 @@ FX_BOOL CPDF_PageOrganizer::ExportPage(CPDF_Document* pSrcPDFDoc,
int nIndex) {
int curpage = nIndex;
- nonstd::unique_ptr<ObjectNumberMap> pObjNumberMap(new ObjectNumberMap);
+ std::unique_ptr<ObjectNumberMap> pObjNumberMap(new ObjectNumberMap);
for (int i = 0; i < nPageNum->GetSize(); ++i) {
CPDF_Dictionary* pCurPageDict = pDestPDFDoc->CreateNewPage(curpage);
diff --git a/fpdfsdk/src/fpdfview.cpp b/fpdfsdk/src/fpdfview.cpp
index daf9cfcbcf..1e1eb2a845 100644
--- a/fpdfsdk/src/fpdfview.cpp
+++ b/fpdfsdk/src/fpdfview.cpp
@@ -6,6 +6,8 @@
#include "public/fpdfview.h"
+#include <memory>
+
#include "core/include/fxcodec/fx_codec.h"
#include "core/include/fxcrt/fx_safe_types.h"
#include "fpdfsdk/include/fsdk_define.h"
@@ -14,7 +16,6 @@
#include "fpdfsdk/include/javascript/IJavaScript.h"
#include "public/fpdf_ext.h"
#include "public/fpdf_progressive.h"
-#include "third_party/base/nonstd_unique_ptr.h"
#include "third_party/base/numerics/safe_conversions_impl.h"
UnderlyingDocumentType* UnderlyingFromFPDFDocument(FPDF_DOCUMENT doc) {
@@ -606,7 +607,7 @@ DLLEXPORT void STDCALL FPDF_PageToDevice(FPDF_PAGE page,
DLLEXPORT FPDF_BITMAP STDCALL FPDFBitmap_Create(int width,
int height,
int alpha) {
- nonstd::unique_ptr<CFX_DIBitmap> pBitmap(new CFX_DIBitmap);
+ std::unique_ptr<CFX_DIBitmap> pBitmap(new CFX_DIBitmap);
if (!pBitmap->Create(width, height, alpha ? FXDIB_Argb : FXDIB_Rgb32)) {
return NULL;
}
diff --git a/fpdfsdk/src/fsdk_baseform.cpp b/fpdfsdk/src/fsdk_baseform.cpp
index 3b35d99026..4c6fc4bafd 100644
--- a/fpdfsdk/src/fsdk_baseform.cpp
+++ b/fpdfsdk/src/fsdk_baseform.cpp
@@ -4,6 +4,8 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+#include <memory>
+
#include "fpdfsdk/include/formfiller/FFL_FormFiller.h"
#include "fpdfsdk/include/fsdk_actionhandler.h"
#include "fpdfsdk/include/fsdk_baseannot.h"
@@ -11,7 +13,6 @@
#include "fpdfsdk/include/fsdk_define.h"
#include "fpdfsdk/include/fsdk_mgr.h"
#include "fpdfsdk/include/javascript/IJavaScript.h"
-#include "third_party/base/nonstd_unique_ptr.h"
#define IsFloatZero(f) ((f) < 0.01 && (f) > -0.01)
#define IsFloatBigger(fa, fb) ((fa) > (fb) && !IsFloatZero((fa) - (fb)))
@@ -1449,7 +1450,7 @@ FX_BOOL CPDFSDK_InterForm::HighlightWidgets() {
CPDFSDK_Widget* CPDFSDK_InterForm::GetSibling(CPDFSDK_Widget* pWidget,
FX_BOOL bNext) const {
- nonstd::unique_ptr<CBA_AnnotIterator> pIterator(
+ std::unique_ptr<CBA_AnnotIterator> pIterator(
new CBA_AnnotIterator(pWidget->GetPageView(), "Widget", ""));
if (bNext) {
@@ -1917,7 +1918,7 @@ FX_BOOL CPDFSDK_InterForm::ExportFieldsToFDFTextBuf(
const std::vector<CPDF_FormField*>& fields,
FX_BOOL bIncludeOrExclude,
CFX_ByteTextBuf& textBuf) {
- nonstd::unique_ptr<CFDF_Document> pFDF(m_pInterForm->ExportToFDF(
+ std::unique_ptr<CFDF_Document> pFDF(m_pInterForm->ExportToFDF(
m_pDocument->GetPath(), fields, bIncludeOrExclude));
return pFDF ? pFDF->WriteBuf(textBuf) : FALSE;
}
diff --git a/fpdfsdk/src/fsdk_mgr.cpp b/fpdfsdk/src/fsdk_mgr.cpp
index 03edd83891..ecef863d61 100644
--- a/fpdfsdk/src/fsdk_mgr.cpp
+++ b/fpdfsdk/src/fsdk_mgr.cpp
@@ -5,6 +5,7 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#include <algorithm>
+#include <memory>
#include "fpdfsdk/include/fsdk_mgr.h"
@@ -12,7 +13,6 @@
#include "fpdfsdk/include/fsdk_define.h"
#include "fpdfsdk/include/javascript/IJavaScript.h"
#include "public/fpdf_ext.h"
-#include "third_party/base/nonstd_unique_ptr.h"
#include "third_party/base/stl_util.h"
#if _FX_OS_ == _FX_ANDROID_
@@ -273,7 +273,7 @@ CFX_WideString CPDFDoc_Environment::JS_fieldBrowse() {
if (nRequiredLen <= 0)
return L"";
- nonstd::unique_ptr<char[]> pBuff(new char[nRequiredLen]);
+ std::unique_ptr<char[]> pBuff(new char[nRequiredLen]);
memset(pBuff.get(), 0, nRequiredLen);
const int nActualLen = m_pInfo->m_pJsPlatform->Field_browse(
m_pInfo->m_pJsPlatform, pBuff.get(), nRequiredLen);
@@ -296,7 +296,7 @@ CFX_WideString CPDFDoc_Environment::JS_docGetFilePath() {
if (nRequiredLen <= 0)
return L"";
- nonstd::unique_ptr<char[]> pBuff(new char[nRequiredLen]);
+ std::unique_ptr<char[]> pBuff(new char[nRequiredLen]);
memset(pBuff.get(), 0, nRequiredLen);
const int nActualLen = m_pInfo->m_pJsPlatform->Doc_getFilePath(
m_pInfo->m_pJsPlatform, pBuff.get(), nRequiredLen);
diff --git a/fpdfsdk/src/javascript/Field.cpp b/fpdfsdk/src/javascript/Field.cpp
index 288ab5e747..959e8dcadd 100644
--- a/fpdfsdk/src/javascript/Field.cpp
+++ b/fpdfsdk/src/javascript/Field.cpp
@@ -3141,7 +3141,7 @@ FX_BOOL Field::getArray(IJS_Context* cc,
CJS_Array FormFieldArray(pRuntime);
for (int j = 0, jsz = swSort.GetSize(); j < jsz; j++) {
- nonstd::unique_ptr<CFX_WideString> pStr(swSort.GetAt(j));
+ std::unique_ptr<CFX_WideString> pStr(swSort.GetAt(j));
v8::Local<v8::Object> pObj = FXJS_NewFxDynamicObj(
pRuntime->GetIsolate(), pRuntime, CJS_Field::g_nObjDefnID);
ASSERT(!pObj.IsEmpty());
diff --git a/fpdfsdk/src/javascript/JS_Object.h b/fpdfsdk/src/javascript/JS_Object.h
index d72696caeb..fe9e5ec5d2 100644
--- a/fpdfsdk/src/javascript/JS_Object.h
+++ b/fpdfsdk/src/javascript/JS_Object.h
@@ -8,11 +8,11 @@
#define FPDFSDK_SRC_JAVASCRIPT_JS_OBJECT_H_
#include <map>
+#include <memory>
#include "JS_Runtime.h"
#include "fpdfsdk/include/fsdk_define.h" // For FX_UINT
#include "fpdfsdk/include/jsapi/fxjs_v8.h"
-#include "third_party/base/nonstd_unique_ptr.h"
class CJS_Context;
class CJS_Object;
@@ -68,7 +68,7 @@ class CJS_Object {
v8::Isolate* GetIsolate() { return m_pIsolate; }
protected:
- nonstd::unique_ptr<CJS_EmbedObj> m_pEmbedObj;
+ std::unique_ptr<CJS_EmbedObj> m_pEmbedObj;
v8::Global<v8::Object> m_pV8Object;
v8::Isolate* m_pIsolate;
};
diff --git a/fpdfsdk/src/javascript/JS_Runtime_Stub.cpp b/fpdfsdk/src/javascript/JS_Runtime_Stub.cpp
index f7b1124a6e..ad8d27dae3 100644
--- a/fpdfsdk/src/javascript/JS_Runtime_Stub.cpp
+++ b/fpdfsdk/src/javascript/JS_Runtime_Stub.cpp
@@ -4,9 +4,10 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+#include <memory>
+
#include "fpdfsdk/include/fsdk_mgr.h" // For CPDFDoc_Environment.
#include "fpdfsdk/include/javascript/IJavaScript.h"
-#include "third_party/base/nonstd_unique_ptr.h"
class CJS_ContextStub final : public IJS_Context {
public:
@@ -144,7 +145,7 @@ class CJS_RuntimeStub final : public IJS_Runtime {
protected:
CPDFSDK_Document* m_pDoc;
- nonstd::unique_ptr<CJS_ContextStub> m_pContext;
+ std::unique_ptr<CJS_ContextStub> m_pContext;
};
// static
diff --git a/fpdfsdk/src/javascript/app.cpp b/fpdfsdk/src/javascript/app.cpp
index 0ed280740d..5959b9a1b5 100644
--- a/fpdfsdk/src/javascript/app.cpp
+++ b/fpdfsdk/src/javascript/app.cpp
@@ -6,6 +6,8 @@
#include "app.h"
+#include <memory>
+
#include "Document.h"
#include "JS_Context.h"
#include "JS_Define.h"
@@ -16,7 +18,6 @@
#include "fpdfsdk/include/fsdk_mgr.h" // For CPDFDoc_Environment.
#include "fpdfsdk/include/javascript/IJavaScript.h"
#include "resource.h"
-#include "third_party/base/nonstd_unique_ptr.h"
BEGIN_JS_STATIC_CONST(CJS_TimerObj)
END_JS_STATIC_CONST()
@@ -769,7 +770,7 @@ FX_BOOL app::response(IJS_Context* cc,
CPDFDoc_Environment* pApp = pContext->GetReaderApp();
const int MAX_INPUT_BYTES = 2048;
- nonstd::unique_ptr<char[]> pBuff(new char[MAX_INPUT_BYTES + 2]);
+ std::unique_ptr<char[]> pBuff(new char[MAX_INPUT_BYTES + 2]);
memset(pBuff.get(), 0, MAX_INPUT_BYTES + 2);
int nLengthBytes = pApp->JS_appResponse(
swQuestion.c_str(), swTitle.c_str(), swDefault.c_str(), swLabel.c_str(),