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

Unified Diff: fpdfsdk/src/javascript/util.cpp

Issue 1394053003: Merge to XFA: Wean CJS_Value off of v8::Isolate. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Fix compile Created 5 years, 2 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 | « fpdfsdk/src/javascript/global.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/javascript/util.cpp
diff --git a/fpdfsdk/src/javascript/util.cpp b/fpdfsdk/src/javascript/util.cpp
index 6a48c09a08128ee6571b8ba9cb410019a02d8033..14e15c1b6fac2b1ec932cbb7d5ad4462d225662b 100644
--- a/fpdfsdk/src/javascript/util.cpp
+++ b/fpdfsdk/src/javascript/util.cpp
@@ -20,16 +20,6 @@
#include <ctype.h>
#endif
-static v8::Isolate* GetIsolate(IJS_Context* cc) {
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
-
- CJS_Runtime* pRuntime = pContext->GetJSRuntime();
- ASSERT(pRuntime != NULL);
-
- return pRuntime->GetIsolate();
-}
-
BEGIN_JS_STATIC_CONST(CJS_Util)
END_JS_STATIC_CONST()
@@ -191,17 +181,16 @@ FX_BOOL util::printd(IJS_Context* cc,
const CJS_Parameters& params,
CJS_Value& vRet,
CFX_WideString& sError) {
- v8::Isolate* isolate = GetIsolate(cc);
-
int iSize = params.size();
if (iSize < 2)
return FALSE;
- CJS_Value p1(isolate);
+ CJS_Runtime* pRuntime = CJS_Runtime::FromContext(cc);
+ CJS_Value p1(pRuntime);
p1 = params[0];
CJS_Value p2 = params[1];
- CJS_Date jsDate(isolate);
+ CJS_Date jsDate(pRuntime);
if (!p2.ConvertToDate(jsDate)) {
sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPRINT1);
return FALSE;
@@ -504,7 +493,6 @@ FX_BOOL util::scand(IJS_Context* cc,
const CJS_Parameters& params,
CJS_Value& vRet,
CFX_WideString& sError) {
- v8::Isolate* isolate = GetIsolate(cc);
int iSize = params.size();
if (iSize < 2)
return FALSE;
@@ -518,8 +506,7 @@ FX_BOOL util::scand(IJS_Context* cc,
}
if (!JS_PortIsNan(dDate)) {
- CJS_Date date(isolate, dDate);
- vRet = date;
+ vRet = CJS_Date(CJS_Runtime::FromContext(cc), dDate);
} else {
vRet.SetNull();
}
« no previous file with comments | « fpdfsdk/src/javascript/global.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698