diff options
author | dsinclair <dsinclair@chromium.org> | 2016-06-08 13:12:41 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-06-08 13:12:41 -0700 |
commit | 769b137a435fd53a419ebbd1deb8617771b73ef6 (patch) | |
tree | 4b4a525a939349e30719b29a7cf1b9f8d78de6aa /xfa/fxjse/context.cpp | |
parent | bc85eecc6cbac54e4b69fe202f802047d2979bf1 (diff) | |
download | pdfium-769b137a435fd53a419ebbd1deb8617771b73ef6.tar.xz |
Remove more FXJSE c-method wrappers.
This Cl cleans up a bunch of the FXJSE_* methods and moves others into the
classes where they most make sense.
Review-Url: https://codereview.chromium.org/2045883004
Diffstat (limited to 'xfa/fxjse/context.cpp')
-rw-r--r-- | xfa/fxjse/context.cpp | 36 |
1 files changed, 5 insertions, 31 deletions
diff --git a/xfa/fxjse/context.cpp b/xfa/fxjse/context.cpp index 75be76d673..8eacc77a74 100644 --- a/xfa/fxjse/context.cpp +++ b/xfa/fxjse/context.cpp @@ -84,37 +84,6 @@ CFXJSE_HostObject* FXJSE_RetrieveObjectBinding( hObject->GetAlignedPointerFromInternalField(0)); } -CFXJSE_Context* FXJSE_Context_Create( - v8::Isolate* pIsolate, - const FXJSE_CLASS_DESCRIPTOR* lpGlobalClass, - CFXJSE_HostObject* lpGlobalObject) { - return CFXJSE_Context::Create(pIsolate, lpGlobalClass, lpGlobalObject); -} - -void FXJSE_Context_Release(CFXJSE_Context* pContext) { - delete pContext; -} - -CFXJSE_Value* FXJSE_Context_GetGlobalObject(CFXJSE_Context* pContext) { - if (!pContext) - return nullptr; - - CFXJSE_Value* lpValue = new CFXJSE_Value(pContext->GetRuntime()); - pContext->GetGlobalObject(lpValue); - return lpValue; -} - -void FXJSE_Context_EnableCompatibleMode(CFXJSE_Context* pContext) { - FXJSE_ExecuteScript(pContext, szCompatibleModeScript, nullptr, nullptr); -} - -FX_BOOL FXJSE_ExecuteScript(CFXJSE_Context* pContext, - const FX_CHAR* szScript, - CFXJSE_Value* pRetValue, - CFXJSE_Value* pNewThisObject) { - return pContext->ExecuteScript(szScript, pRetValue, pNewThisObject); -} - v8::Local<v8::Object> FXJSE_CreateReturnValue(v8::Isolate* pIsolate, v8::TryCatch& trycatch) { v8::Local<v8::Object> hReturnValue = v8::Object::New(pIsolate); @@ -185,6 +154,7 @@ CFXJSE_Context* CFXJSE_Context::Create( } CFXJSE_Context::CFXJSE_Context(v8::Isolate* pIsolate) : m_pIsolate(pIsolate) {} + CFXJSE_Context::~CFXJSE_Context() {} void CFXJSE_Context::GetGlobalObject(CFXJSE_Value* pValue) { @@ -196,6 +166,10 @@ void CFXJSE_Context::GetGlobalObject(CFXJSE_Value* pValue) { pValue->ForceSetValue(hGlobalObject); } +void CFXJSE_Context::EnableCompatibleMode() { + ExecuteScript(szCompatibleModeScript, nullptr, nullptr); +} + FX_BOOL CFXJSE_Context::ExecuteScript(const FX_CHAR* szScript, CFXJSE_Value* lpRetValue, CFXJSE_Value* lpNewThisObject) { |