Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(461)

Unified Diff: xfa/fxjse/context.cpp

Issue 2013963005: Replace FXJSE_HCONTEXT with CFXJSE_Context* (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/fxjse/context.h ('k') | xfa/fxjse/include/fxjse.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxjse/context.cpp
diff --git a/xfa/fxjse/context.cpp b/xfa/fxjse/context.cpp
index b1251776174456dde9b3e34f20b09b7884b5bc97..76df5616e53311e710775e333f630ec844ceb010 100644
--- a/xfa/fxjse/context.cpp
+++ b/xfa/fxjse/context.cpp
@@ -11,28 +11,17 @@
#include "xfa/fxjse/util_inline.h"
#include "xfa/fxjse/value.h"
-namespace {
-
-CFXJSE_Context* CFXContextFromHContext(FXJSE_HCONTEXT hContext) {
- return reinterpret_cast<CFXJSE_Context*>(hContext);
-}
-
-} // namespace
-
-FXJSE_HCONTEXT FXJSE_Context_Create(v8::Isolate* pIsolate,
- const FXJSE_CLASS* lpGlobalClass,
- void* lpGlobalObject) {
- CFXJSE_Context* pContext =
- CFXJSE_Context::Create(pIsolate, lpGlobalClass, lpGlobalObject);
- return reinterpret_cast<FXJSE_HCONTEXT>(pContext);
+CFXJSE_Context* FXJSE_Context_Create(v8::Isolate* pIsolate,
+ const FXJSE_CLASS* lpGlobalClass,
+ void* lpGlobalObject) {
+ return CFXJSE_Context::Create(pIsolate, lpGlobalClass, lpGlobalObject);
}
-void FXJSE_Context_Release(FXJSE_HCONTEXT hContext) {
- delete CFXContextFromHContext(hContext);
+void FXJSE_Context_Release(CFXJSE_Context* pContext) {
+ delete pContext;
}
-FXJSE_HVALUE FXJSE_Context_GetGlobalObject(FXJSE_HCONTEXT hContext) {
- CFXJSE_Context* pContext = CFXContextFromHContext(hContext);
+FXJSE_HVALUE FXJSE_Context_GetGlobalObject(CFXJSE_Context* pContext) {
if (!pContext)
return nullptr;
@@ -68,20 +57,19 @@ static const FX_CHAR* szCompatibleModeScripts[] = {
" }\n"
" }\n"
"}(this, {String: ['substr', 'toUpperCase']}));"};
-void FXJSE_Context_EnableCompatibleMode(FXJSE_HCONTEXT hContext,
+void FXJSE_Context_EnableCompatibleMode(CFXJSE_Context* pContext,
uint32_t dwCompatibleFlags) {
for (uint32_t i = 0; i < (uint32_t)FXJSE_COMPATIBLEMODEFLAGCOUNT; i++) {
if (dwCompatibleFlags & (1 << i)) {
- FXJSE_ExecuteScript(hContext, szCompatibleModeScripts[i], NULL, NULL);
+ FXJSE_ExecuteScript(pContext, szCompatibleModeScripts[i], NULL, NULL);
}
}
}
-FX_BOOL FXJSE_ExecuteScript(FXJSE_HCONTEXT hContext,
+FX_BOOL FXJSE_ExecuteScript(CFXJSE_Context* pContext,
const FX_CHAR* szScript,
FXJSE_HVALUE hRetValue,
FXJSE_HVALUE hNewThisObject) {
- CFXJSE_Context* pContext = CFXContextFromHContext(hContext);
return pContext->ExecuteScript(
szScript, reinterpret_cast<CFXJSE_Value*>(hRetValue),
reinterpret_cast<CFXJSE_Value*>(hNewThisObject));
« no previous file with comments | « xfa/fxjse/context.h ('k') | xfa/fxjse/include/fxjse.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698