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

Unified Diff: xfa/fxjse/value.cpp

Issue 2026993003: Remove FXJSE_Value_ToObject and call methods directly (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@context_cleanup_3
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
« xfa/fxjse/value.h ('K') | « xfa/fxjse/value.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxjse/value.cpp
diff --git a/xfa/fxjse/value.cpp b/xfa/fxjse/value.cpp
index b369c0bf3b7c19d18c31b5e4b831277645574641..254fada8baba8be1f52446e9acce39f79bc40f20 100644
--- a/xfa/fxjse/value.cpp
+++ b/xfa/fxjse/value.cpp
@@ -8,6 +8,7 @@
#include <math.h>
+#include "xfa/fxfa/fm2js/xfa_fm2jscontext.h"
Tom Sepez 2016/06/01 20:17:58 illegal include, in theory due to layering.
#include "xfa/fxjse/class.h"
#include "xfa/fxjse/context.h"
@@ -64,11 +65,6 @@ int32_t FXJSE_Value_ToInteger(CFXJSE_Value* pValue) {
return pValue->ToInteger();
}
-CFXJSE_HostObject* FXJSE_Value_ToObject(CFXJSE_Value* pValue,
- CFXJSE_Class* pClass) {
- return pValue->ToObject(pClass);
-}
-
void FXJSE_Value_SetUndefined(CFXJSE_Value* pValue) {
pValue->SetUndefined();
}
@@ -198,7 +194,7 @@ void FXJSE_ThrowMessage(const CFX_ByteStringC& utf8Name,
pIsolate->ThrowException(hError);
}
-CFXJSE_HostObject* CFXJSE_Value::ToObject(CFXJSE_Class* lpClass) const {
+CFXJSE_HostObject* CFXJSE_Value::ToHostObject(CFXJSE_Class* lpClass) const {
ASSERT(!m_hValue.IsEmpty());
CFXJSE_ScopeUtil_IsolateHandleRootContext scope(m_pIsolate);
@@ -211,6 +207,22 @@ CFXJSE_HostObject* CFXJSE_Value::ToObject(CFXJSE_Class* lpClass) const {
return FXJSE_RetrieveObjectBinding(pValue.As<v8::Object>(), lpClass);
}
+CXFA_Object* CFXJSE_Value::ToObject(CFXJSE_Class* lpClass) const {
+ return static_cast<CXFA_Object*>(ToHostObject(lpClass));
+}
+
+CXFA_Node* CFXJSE_Value::ToNode(CFXJSE_Class* lpClass) const {
+ return static_cast<CXFA_Node*>(ToHostObject(lpClass));
+}
+
+CXFA_FM2JSContext* CFXJSE_Value::ToJSContext(CFXJSE_Class* lpClass) const {
+ return static_cast<CXFA_FM2JSContext*>(ToHostObject(lpClass));
+}
+
+CXFA_ThisProxy* CFXJSE_Value::ToProxy(CFXJSE_Class* lpClass) const {
+ return static_cast<CXFA_ThisProxy*>(ToHostObject(lpClass));
+}
+
V8_INLINE static double FXJSE_ftod(FX_FLOAT fNumber) {
if (sizeof(FX_FLOAT) != 4) {
ASSERT(FALSE);
« xfa/fxjse/value.h ('K') | « xfa/fxjse/value.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698