From 142165e2f62b8ba727e8aab40591ca3a7b6fa214 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Fri, 11 Sep 2015 13:21:50 -0700 Subject: Merge to XFA: Fix strings, ..., void return types for Consts.h. (cherry picked from commit f9e40aec10263f9445d69598657f42550294d653) Orignal Review URL: https://codereview.chromium.org/1342433002 . R=thestig@chromium.org TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1338003004 . --- fpdfsdk/src/javascript/JS_Runtime.cpp | 80 ++++++++++++----------------------- 1 file changed, 28 insertions(+), 52 deletions(-) (limited to 'fpdfsdk/src/javascript/JS_Runtime.cpp') diff --git a/fpdfsdk/src/javascript/JS_Runtime.cpp b/fpdfsdk/src/javascript/JS_Runtime.cpp index 95060ae4ac..880fadebbc 100644 --- a/fpdfsdk/src/javascript/JS_Runtime.cpp +++ b/fpdfsdk/src/javascript/JS_Runtime.cpp @@ -156,7 +156,7 @@ CJS_Runtime::~CJS_Runtime() { m_isolate = NULL; } -FX_BOOL CJS_Runtime::DefineJSObjects() { +void CJS_Runtime::DefineJSObjects() { v8::Isolate::Scope isolate_scope(GetIsolate()); v8::Locker locker(GetIsolate()); v8::HandleScope handle_scope(GetIsolate()); @@ -165,67 +165,43 @@ FX_BOOL CJS_Runtime::DefineJSObjects() { // The call order determines the "ObjDefID" assigned to each class. // ObjDefIDs 0 - 2 - if (CJS_Border::DefineJSObjects(GetIsolate(), JS_STATIC) < 0) - return FALSE; - if (CJS_Display::DefineJSObjects(GetIsolate(), JS_STATIC) < 0) - return FALSE; - if (CJS_Font::DefineJSObjects(GetIsolate(), JS_STATIC) < 0) - return FALSE; + CJS_Border::DefineJSObjects(GetIsolate(), JS_STATIC); + CJS_Display::DefineJSObjects(GetIsolate(), JS_STATIC); + CJS_Font::DefineJSObjects(GetIsolate(), JS_STATIC); // ObjDefIDs 3 - 5 - if (CJS_Highlight::DefineJSObjects(GetIsolate(), JS_STATIC) < 0) - return FALSE; - if (CJS_Position::DefineJSObjects(GetIsolate(), JS_STATIC) < 0) - return FALSE; - if (CJS_ScaleHow::DefineJSObjects(GetIsolate(), JS_STATIC) < 0) - return FALSE; + CJS_Highlight::DefineJSObjects(GetIsolate(), JS_STATIC); + CJS_Position::DefineJSObjects(GetIsolate(), JS_STATIC); + CJS_ScaleHow::DefineJSObjects(GetIsolate(), JS_STATIC); // ObjDefIDs 6 - 8 - if (CJS_ScaleWhen::DefineJSObjects(GetIsolate(), JS_STATIC) < 0) - return FALSE; - if (CJS_Style::DefineJSObjects(GetIsolate(), JS_STATIC) < 0) - return FALSE; - if (CJS_Zoomtype::DefineJSObjects(GetIsolate(), JS_STATIC) < 0) - return FALSE; + CJS_ScaleWhen::DefineJSObjects(GetIsolate(), JS_STATIC); + CJS_Style::DefineJSObjects(GetIsolate(), JS_STATIC); + CJS_Zoomtype::DefineJSObjects(GetIsolate(), JS_STATIC); // ObjDefIDs 9 - 11 - if (CJS_App::DefineJSObjects(GetIsolate(), JS_STATIC) < 0) - return FALSE; - if (CJS_Color::DefineJSObjects(GetIsolate(), JS_STATIC) < 0) - return FALSE; - if (CJS_Console::DefineJSObjects(GetIsolate(), JS_STATIC) < 0) - return FALSE; + CJS_App::DefineJSObjects(GetIsolate(), JS_STATIC); + CJS_Color::DefineJSObjects(GetIsolate(), JS_STATIC); + CJS_Console::DefineJSObjects(GetIsolate(), JS_STATIC); // ObjDefIDs 12 - 14 - if (CJS_Document::DefineJSObjects(GetIsolate(), JS_DYNAMIC) < 0) - return FALSE; - if (CJS_Event::DefineJSObjects(GetIsolate(), JS_STATIC) < 0) - return FALSE; - if (CJS_Field::DefineJSObjects(GetIsolate(), JS_DYNAMIC) < 0) - return FALSE; + CJS_Document::DefineJSObjects(GetIsolate(), JS_DYNAMIC); + CJS_Event::DefineJSObjects(GetIsolate(), JS_STATIC); + CJS_Field::DefineJSObjects(GetIsolate(), JS_DYNAMIC); // ObjDefIDs 15 - 17 - if (CJS_Global::DefineJSObjects(GetIsolate(), JS_STATIC) < 0) - return FALSE; - if (CJS_Icon::DefineJSObjects(GetIsolate(), JS_DYNAMIC) < 0) - return FALSE; - if (CJS_Util::DefineJSObjects(GetIsolate(), JS_STATIC) < 0) - return FALSE; - - // ObjDefIDs 18 - 20 - if (CJS_PublicMethods::DefineJSObjects(GetIsolate()) < 0) - return FALSE; - if (CJS_GlobalConsts::DefineJSObjects(GetIsolate()) < 0) - return FALSE; - if (CJS_GlobalArrays::DefineJSObjects(GetIsolate()) < 0) - return FALSE; - - if (CJS_TimerObj::DefineJSObjects(GetIsolate(), JS_DYNAMIC) < 0) - return FALSE; - if (CJS_PrintParamsObj::DefineJSObjects(GetIsolate(), JS_DYNAMIC) < 0) - return FALSE; - - return TRUE; + CJS_Global::DefineJSObjects(GetIsolate(), JS_STATIC); + CJS_Icon::DefineJSObjects(GetIsolate(), JS_DYNAMIC); + CJS_Util::DefineJSObjects(GetIsolate(), JS_STATIC); + + // ObjDefIDs 18 - 20 (these can't fail, return void). + CJS_PublicMethods::DefineJSObjects(GetIsolate()); + CJS_GlobalConsts::DefineJSObjects(GetIsolate()); + CJS_GlobalArrays::DefineJSObjects(GetIsolate()); + + // ObjDefIDs 21 - 22. + CJS_TimerObj::DefineJSObjects(GetIsolate(), JS_DYNAMIC); + CJS_PrintParamsObj::DefineJSObjects(GetIsolate(), JS_DYNAMIC); } IFXJS_Context* CJS_Runtime::NewContext() { -- cgit v1.2.3