diff options
author | Lei Zhang <thestig@chromium.org> | 2015-12-24 19:13:32 -0800 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2015-12-24 19:13:32 -0800 |
commit | aa8bf7e42b8c73a9bc07ed6781364ba05f5a9776 (patch) | |
tree | a5a435608eb527db39e2c9324737bd230e762030 /fpdfsdk | |
parent | 25ae22692cdd5b4ae4783ecb27eba79b3c794b2c (diff) | |
download | pdfium-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 'fpdfsdk')
-rw-r--r-- | fpdfsdk/include/fsdk_actionhandler.h | 5 | ||||
-rw-r--r-- | fpdfsdk/include/fsdk_mgr.h | 18 | ||||
-rw-r--r-- | fpdfsdk/src/fpdfformfill.cpp | 7 | ||||
-rw-r--r-- | fpdfsdk/src/fpdfppo.cpp | 5 | ||||
-rw-r--r-- | fpdfsdk/src/fpdfview.cpp | 5 | ||||
-rw-r--r-- | fpdfsdk/src/fsdk_baseform.cpp | 7 | ||||
-rw-r--r-- | fpdfsdk/src/fsdk_mgr.cpp | 6 | ||||
-rw-r--r-- | fpdfsdk/src/javascript/Field.cpp | 2 | ||||
-rw-r--r-- | fpdfsdk/src/javascript/JS_Object.h | 4 | ||||
-rw-r--r-- | fpdfsdk/src/javascript/JS_Runtime_Stub.cpp | 5 | ||||
-rw-r--r-- | fpdfsdk/src/javascript/app.cpp | 5 |
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 d0da678d34..694b471ab8 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" #ifdef PDF_ENABLE_XFA #include "fpdfxfa/fpdfxfa_doc.h" @@ -469,14 +469,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 { @@ -553,10 +553,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; }; @@ -649,7 +649,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; #ifdef PDF_ENABLE_XFA diff --git a/fpdfsdk/src/fpdfformfill.cpp b/fpdfsdk/src/fpdfformfill.cpp index 1f12f5dd3f..366c972c3a 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" #ifdef PDF_ENABLE_XFA #include "../include/fpdfxfa/fpdfxfa_app.h" @@ -344,9 +345,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 a7c38bcdf7..cca56e33fb 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" #ifdef PDF_ENABLE_XFA @@ -816,7 +817,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 b76cb75199..12faea2bef 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" #ifdef PDF_ENABLE_XFA #include "../include/fpdfxfa/fpdfxfa_doc.h" @@ -2055,7 +2056,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) { @@ -2555,7 +2556,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 e27823bea2..8ecc602b09 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" #ifdef PDF_ENABLE_XFA @@ -285,7 +285,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); @@ -308,7 +308,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 89725ffb7f..7baefd111c 100644 --- a/fpdfsdk/src/javascript/Field.cpp +++ b/fpdfsdk/src/javascript/Field.cpp @@ -3140,7 +3140,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 1d94976edf..e9d5a221f7 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: @@ -156,7 +157,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 34b51310ce..1473edbf69 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() @@ -803,7 +804,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(), |