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

Unified Diff: fpdfsdk/src/jsapi/fxjs_v8.cpp

Issue 1463973002: Mising JS refactoring in XFA. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: 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/src/javascript/JS_Define.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/jsapi/fxjs_v8.cpp
diff --git a/fpdfsdk/src/jsapi/fxjs_v8.cpp b/fpdfsdk/src/jsapi/fxjs_v8.cpp
index a3100bec4120439aab87d158df4d6e8be682611d..9c2c538aa80d4a9700656020b568cce3653e80c1 100644
--- a/fpdfsdk/src/jsapi/fxjs_v8.cpp
+++ b/fpdfsdk/src/jsapi/fxjs_v8.cpp
@@ -288,7 +288,7 @@ void FXJS_InitializeRuntime(
v8::Context::Scope context_scope(v8Context);
FXJS_PerIsolateData::SetUp(pIsolate);
- FXJS_SetRuntimeForV8Context(v8Context, pIRuntime);
+ v8Context->SetAlignedPointerInEmbedderData(kPerContextDataIndex, pIRuntime);
int maxID = CFXJS_ObjDefinition::MaxID(pIsolate);
pStaticObjects->resize(maxID + 1);
@@ -366,16 +366,17 @@ void FXJS_ReleaseRuntime(v8::Isolate* pIsolate,
delete pData;
}
+IJS_Runtime* FXJS_GetRuntimeFromIsolate(v8::Isolate* pIsolate) {
+ v8::Local<v8::Context> context = pIsolate->GetCurrentContext();
+ return static_cast<IJS_Runtime*>(
+ context->GetAlignedPointerFromEmbedderData(kPerContextDataIndex));
+}
+
void FXJS_SetRuntimeForV8Context(v8::Local<v8::Context> v8Context,
IJS_Runtime* pIRuntime) {
v8Context->SetAlignedPointerInEmbedderData(kPerContextDataIndex, pIRuntime);
}
-IJS_Runtime* FXJS_GetRuntimeFromV8Context(v8::Local<v8::Context> v8Context) {
- return static_cast<IJS_Runtime*>(
- v8Context->GetAlignedPointerFromEmbedderData(kPerContextDataIndex));
-}
-
int FXJS_Execute(v8::Isolate* pIsolate,
IJS_Context* pJSContext,
const wchar_t* script,
« no previous file with comments | « fpdfsdk/src/javascript/JS_Define.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698