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

Unified Diff: fpdfsdk/src/javascript/JS_Define.h

Issue 1412103010: Segv when PDF-side JS object property getter invoked from XFA. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Comment about using right context. Created 5 years, 1 month 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 | « fpdfsdk/include/jsapi/fxjs_v8.h ('k') | fpdfsdk/src/javascript/JS_Runtime.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/javascript/JS_Define.h
diff --git a/fpdfsdk/src/javascript/JS_Define.h b/fpdfsdk/src/javascript/JS_Define.h
index 3ebd07518ebfbeac12ce29936cb8c942d80e9b4c..b097aaa63f52540c135e9f689d7682c5fc2599c1 100644
--- a/fpdfsdk/src/javascript/JS_Define.h
+++ b/fpdfsdk/src/javascript/JS_Define.h
@@ -78,8 +78,8 @@ void JSPropGetter(const char* prop_name_string,
v8::Local<v8::String> property,
const v8::PropertyCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
- CJS_Runtime* pRuntime =
- static_cast<CJS_Runtime*>(FXJS_GetRuntimeFromIsolate(isolate));
+ CJS_Runtime* pRuntime = static_cast<CJS_Runtime*>(
+ FXJS_GetRuntimeFromV8Context(isolate->GetCurrentContext()));
if (!pRuntime)
return;
IJS_Context* pContext = pRuntime->GetCurrentContext();
@@ -104,8 +104,8 @@ void JSPropSetter(const char* prop_name_string,
v8::Local<v8::Value> value,
const v8::PropertyCallbackInfo<void>& info) {
v8::Isolate* isolate = info.GetIsolate();
- CJS_Runtime* pRuntime =
- static_cast<CJS_Runtime*>(FXJS_GetRuntimeFromIsolate(isolate));
+ CJS_Runtime* pRuntime = static_cast<CJS_Runtime*>(
+ FXJS_GetRuntimeFromV8Context(isolate->GetCurrentContext()));
if (!pRuntime)
return;
IJS_Context* pContext = pRuntime->GetCurrentContext();
@@ -143,8 +143,8 @@ void JSMethod(const char* method_name_string,
const char* class_name_string,
const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
- CJS_Runtime* pRuntime =
- static_cast<CJS_Runtime*>(FXJS_GetRuntimeFromIsolate(isolate));
+ CJS_Runtime* pRuntime = static_cast<CJS_Runtime*>(
+ FXJS_GetRuntimeFromV8Context(isolate->GetCurrentContext()));
if (!pRuntime)
return;
IJS_Context* pContext = pRuntime->GetCurrentContext();
@@ -366,8 +366,8 @@ void JSSpecialPropGet(const char* class_name,
v8::Local<v8::String> property,
const v8::PropertyCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
- CJS_Runtime* pRuntime =
- static_cast<CJS_Runtime*>(FXJS_GetRuntimeFromIsolate(isolate));
+ CJS_Runtime* pRuntime = static_cast<CJS_Runtime*>(
+ FXJS_GetRuntimeFromV8Context(isolate->GetCurrentContext()));
if (!pRuntime)
return;
IJS_Context* pContext = pRuntime->GetCurrentContext();
@@ -393,8 +393,8 @@ void JSSpecialPropPut(const char* class_name,
v8::Local<v8::Value> value,
const v8::PropertyCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
- CJS_Runtime* pRuntime =
- static_cast<CJS_Runtime*>(FXJS_GetRuntimeFromIsolate(isolate));
+ CJS_Runtime* pRuntime = static_cast<CJS_Runtime*>(
+ FXJS_GetRuntimeFromV8Context(isolate->GetCurrentContext()));
if (!pRuntime)
return;
IJS_Context* pContext = pRuntime->GetCurrentContext();
@@ -417,7 +417,8 @@ void JSSpecialPropDel(const char* class_name,
v8::Local<v8::String> property,
const v8::PropertyCallbackInfo<v8::Boolean>& info) {
v8::Isolate* isolate = info.GetIsolate();
- IJS_Runtime* pRuntime = FXJS_GetRuntimeFromIsolate(isolate);
+ IJS_Runtime* pRuntime =
+ FXJS_GetRuntimeFromV8Context(isolate->GetCurrentContext());
if (!pRuntime)
return;
IJS_Context* pContext = pRuntime->GetCurrentContext();
@@ -439,8 +440,8 @@ template <FX_BOOL (
*F)(IJS_Context*, const CJS_Parameters&, CJS_Value&, CFX_WideString&)>
void JSGlobalFunc(const char* func_name_string,
const v8::FunctionCallbackInfo<v8::Value>& info) {
- CJS_Runtime* pRuntime =
- static_cast<CJS_Runtime*>(FXJS_GetRuntimeFromIsolate(info.GetIsolate()));
+ CJS_Runtime* pRuntime = static_cast<CJS_Runtime*>(
+ FXJS_GetRuntimeFromV8Context(info.GetIsolate()->GetCurrentContext()));
if (!pRuntime)
return;
IJS_Context* pContext = pRuntime->GetCurrentContext();
« no previous file with comments | « fpdfsdk/include/jsapi/fxjs_v8.h ('k') | fpdfsdk/src/javascript/JS_Runtime.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698