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

Unified Diff: xfa/fxjse/context.cpp

Issue 2019333006: Replace void* with CFXJSE_HostObect and make wrapped objects inherit from it (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Another blown merge 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 d40e2af2234f36e286896c396bcc99ba45b74fa4..a277d4d412aa61a947361a58a1ac2596e30c3370 100644
--- a/xfa/fxjse/context.cpp
+++ b/xfa/fxjse/context.cpp
@@ -16,27 +16,29 @@ v8::Local<v8::Object> FXJSE_GetGlobalObjectFromContext(
}
void FXJSE_UpdateObjectBinding(v8::Local<v8::Object>& hObject,
- void* lpNewBinding) {
+ CFXJSE_HostObject* lpNewBinding) {
ASSERT(!hObject.IsEmpty());
ASSERT(hObject->InternalFieldCount() > 0);
- hObject->SetAlignedPointerInInternalField(0, lpNewBinding);
+ hObject->SetAlignedPointerInInternalField(0,
+ static_cast<void*>(lpNewBinding));
}
-void* FXJSE_RetrieveObjectBinding(const v8::Local<v8::Object>& hJSObject,
- CFXJSE_Class* lpClass) {
+CFXJSE_HostObject* FXJSE_RetrieveObjectBinding(
+ const v8::Local<v8::Object>& hJSObject,
+ CFXJSE_Class* lpClass) {
ASSERT(!hJSObject.IsEmpty());
if (!hJSObject->IsObject()) {
- return NULL;
+ return nullptr;
}
v8::Local<v8::Object> hObject = hJSObject;
if (hObject->InternalFieldCount() == 0) {
v8::Local<v8::Value> hProtoObject = hObject->GetPrototype();
if (hProtoObject.IsEmpty() || !hProtoObject->IsObject()) {
- return NULL;
+ return nullptr;
}
hObject = hProtoObject.As<v8::Object>();
if (hObject->InternalFieldCount() == 0) {
- return NULL;
+ return nullptr;
}
}
if (lpClass) {
@@ -44,16 +46,17 @@ void* FXJSE_RetrieveObjectBinding(const v8::Local<v8::Object>& hJSObject,
v8::Local<v8::FunctionTemplate>::New(
lpClass->GetContext()->GetRuntime(), lpClass->GetTemplate());
if (!hClass->HasInstance(hObject)) {
- return NULL;
+ return nullptr;
}
}
- return hObject->GetAlignedPointerFromInternalField(0);
+ return static_cast<CFXJSE_HostObject*>(
+ hObject->GetAlignedPointerFromInternalField(0));
}
CFXJSE_Context* FXJSE_Context_Create(
v8::Isolate* pIsolate,
const FXJSE_CLASS_DESCRIPTOR* lpGlobalClass,
- void* lpGlobalObject) {
+ CFXJSE_HostObject* lpGlobalObject) {
return CFXJSE_Context::Create(pIsolate, lpGlobalClass, lpGlobalObject);
}
@@ -153,7 +156,7 @@ v8::Local<v8::Object> FXJSE_CreateReturnValue(v8::Isolate* pIsolate,
CFXJSE_Context* CFXJSE_Context::Create(
v8::Isolate* pIsolate,
const FXJSE_CLASS_DESCRIPTOR* lpGlobalClass,
- void* lpGlobalObject) {
+ CFXJSE_HostObject* lpGlobalObject) {
CFXJSE_ScopeUtil_IsolateHandle scope(pIsolate);
CFXJSE_Context* pContext = new CFXJSE_Context(pIsolate);
CFXJSE_Class* lpGlobalClassObj = NULL;
« 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