summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/javascript/global.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-09-14 14:32:33 -0700
committerTom Sepez <tsepez@chromium.org>2015-09-14 14:32:33 -0700
commit9a817f092e6800e9338b41acf4ea0416b6ad4467 (patch)
treec989a1abc1d24c108c7e8d869818368d373b1f00 /fpdfsdk/src/javascript/global.cpp
parentda0938f8671958aba0522a69fc687a7bbb01b435 (diff)
downloadpdfium-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/src/javascript/global.cpp')
-rw-r--r--fpdfsdk/src/javascript/global.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/fpdfsdk/src/javascript/global.cpp b/fpdfsdk/src/javascript/global.cpp
index bde4e7d5ae..e75dbd5585 100644
--- a/fpdfsdk/src/javascript/global.cpp
+++ b/fpdfsdk/src/javascript/global.cpp
@@ -108,12 +108,12 @@ JSGlobalAlternate::JSGlobalAlternate(CJS_Object* pJSObject)
JSGlobalAlternate::~JSGlobalAlternate() {
DestroyGlobalPersisitentVariables();
- m_pApp->GetRuntimeFactory()->ReleaseGlobalData();
+ m_pGlobalData->Release();
}
void JSGlobalAlternate::Initial(CPDFDoc_Environment* pApp) {
m_pApp = pApp;
- m_pGlobalData = pApp->GetRuntimeFactory()->NewGlobalData(pApp);
+ m_pGlobalData = CJS_GlobalData::GetRetainedInstance(pApp);
UpdateGlobalPersistentVariables();
}