diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-09-14 14:32:33 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-09-14 14:32:33 -0700 |
commit | 9a817f092e6800e9338b41acf4ea0416b6ad4467 (patch) | |
tree | c989a1abc1d24c108c7e8d869818368d373b1f00 /fpdfsdk/include/javascript/IJavaScript.h | |
parent | da0938f8671958aba0522a69fc687a7bbb01b435 (diff) | |
download | pdfium-9a817f092e6800e9338b41acf4ea0416b6ad4467.tar.xz |
Get CJS_RuntimeFactory out of the CJS_GlobalData management business.
First part of getting rid of CJS_RuntimeFactory. The factory design
pattern isn't appropriate here since we only ever make one kind of
object.
CJS_GlobalData is now perfectly capable of managing itself through
internal ref counts. I'm philosophically opposed to keeping ref-counts
outside the object (do you hear me std::shared_ptr, you're bad!)
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1338993005 .
Diffstat (limited to 'fpdfsdk/include/javascript/IJavaScript.h')
-rw-r--r-- | fpdfsdk/include/javascript/IJavaScript.h | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/fpdfsdk/include/javascript/IJavaScript.h b/fpdfsdk/include/javascript/IJavaScript.h index 18ab34b8cb..3524a5b8ff 100644 --- a/fpdfsdk/include/javascript/IJavaScript.h +++ b/fpdfsdk/include/javascript/IJavaScript.h @@ -10,10 +10,11 @@ #include "../../../core/include/fxcrt/fx_string.h" #include "../../../core/include/fxcrt/fx_system.h" -class CPDF_Bookmark; -class CPDF_FormField; +class CPDFDoc_Environment; class CPDFSDK_Annot; class CPDFSDK_Document; +class CPDF_Bookmark; +class CPDF_FormField; class IFXJS_Context { public: @@ -143,27 +144,19 @@ class IFXJS_Runtime { virtual ~IFXJS_Runtime() {} }; -class CPDFDoc_Environment; -class CJS_GlobalData; - class CJS_RuntimeFactory { public: - CJS_RuntimeFactory() - : m_bInit(FALSE), m_nRef(0), m_pGlobalData(NULL), m_nGlobalDataCount(0) {} + CJS_RuntimeFactory() : m_bInit(FALSE), m_nRef(0) {} ~CJS_RuntimeFactory(); + IFXJS_Runtime* NewJSRuntime(CPDFDoc_Environment* pApp); void DeleteJSRuntime(IFXJS_Runtime* pRuntime); void AddRef(); void Release(); - CJS_GlobalData* NewGlobalData(CPDFDoc_Environment* pApp); - void ReleaseGlobalData(); - private: FX_BOOL m_bInit; int m_nRef; - CJS_GlobalData* m_pGlobalData; - int32_t m_nGlobalDataCount; }; #endif // FPDFSDK_INCLUDE_JAVASCRIPT_IJAVASCRIPT_H_ |