diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-10-17 21:53:43 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-10-17 21:53:43 +0000 |
commit | a8a69e742f57a58a61555242751542fbc3fc5267 (patch) | |
tree | cc83f7fdb87aa2f4aee3ca15c119a589d032e359 /fxjs/cjs_globaldata.h | |
parent | d78358d506c2e700a1177f93bdb915154eefae5c (diff) | |
download | pdfium-a8a69e742f57a58a61555242751542fbc3fc5267.tar.xz |
Nest CJS_GlobalData_Element in CJS_GlobalData.
Why settle for _ when you can have :: ?
No functional change. Move some ctors/initializers out of line
and avoid assignment in some ifs.
Change-Id: I792bca35f38aa8c4ff41d776a789c5525c5d5113
Reviewed-on: https://pdfium-review.googlesource.com/c/44212
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fxjs/cjs_globaldata.h')
-rw-r--r-- | fxjs/cjs_globaldata.h | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/fxjs/cjs_globaldata.h b/fxjs/cjs_globaldata.h index 9ce4358fd4..1bff94d298 100644 --- a/fxjs/cjs_globaldata.h +++ b/fxjs/cjs_globaldata.h @@ -15,17 +15,17 @@ class CPDFSDK_FormFillEnvironment; -class CJS_GlobalData_Element { +class CJS_GlobalData { public: - CJS_GlobalData_Element() {} - ~CJS_GlobalData_Element() {} + class Element { + public: + Element(); + ~Element(); - CJS_KeyValue data; - bool bPersistent; -}; + CJS_KeyValue data; + bool bPersistent; + }; -class CJS_GlobalData { - public: static CJS_GlobalData* GetRetainedInstance(CPDFSDK_FormFillEnvironment* pApp); void Release(); @@ -39,13 +39,11 @@ class CJS_GlobalData { bool DeleteGlobalVariable(ByteString propname); int32_t GetSize() const; - CJS_GlobalData_Element* GetAt(int index) const; + Element* GetAt(int index) const; private: - using iterator = - std::vector<std::unique_ptr<CJS_GlobalData_Element>>::iterator; - using const_iterator = - std::vector<std::unique_ptr<CJS_GlobalData_Element>>::const_iterator; + using iterator = std::vector<std::unique_ptr<Element>>::iterator; + using const_iterator = std::vector<std::unique_ptr<Element>>::const_iterator; CJS_GlobalData(); ~CJS_GlobalData(); @@ -53,7 +51,7 @@ class CJS_GlobalData { void LoadGlobalPersistentVariables(); void SaveGlobalPersisitentVariables(); - CJS_GlobalData_Element* GetGlobalVariable(const ByteString& sPropname); + Element* GetGlobalVariable(const ByteString& sPropname); iterator FindGlobalVariable(const ByteString& sPropname); const_iterator FindGlobalVariable(const ByteString& sPropname) const; @@ -67,8 +65,8 @@ class CJS_GlobalData { CJS_KeyValue* pData, CFX_BinaryBuf& sData); - size_t m_RefCount; - std::vector<std::unique_ptr<CJS_GlobalData_Element>> m_arrayGlobalData; + size_t m_RefCount = 0; + std::vector<std::unique_ptr<Element>> m_arrayGlobalData; WideString m_sFilePath; }; |