summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/javascript/JS_Runtime.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-07-23 13:36:00 -0700
committerTom Sepez <tsepez@chromium.org>2015-07-23 13:36:00 -0700
commitf1e7c461dfabbff6b65a072f24f6711b34159361 (patch)
tree3b0bb772a59669f06b86824a444fd06642592d4b /fpdfsdk/src/javascript/JS_Runtime.cpp
parent320b2313d19869333ed453af546e61a9fc2b81c9 (diff)
downloadpdfium-f1e7c461dfabbff6b65a072f24f6711b34159361.tar.xz
Revert "FX_BOOL considered harmful, part 2."
This reverts commit 320b2313d19869333ed453af546e61a9fc2b81c9. Reason for revert: build failure. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1255693002 .
Diffstat (limited to 'fpdfsdk/src/javascript/JS_Runtime.cpp')
-rw-r--r--fpdfsdk/src/javascript/JS_Runtime.cpp68
1 files changed, 34 insertions, 34 deletions
diff --git a/fpdfsdk/src/javascript/JS_Runtime.cpp b/fpdfsdk/src/javascript/JS_Runtime.cpp
index 7333e88cd2..485cd27813 100644
--- a/fpdfsdk/src/javascript/JS_Runtime.cpp
+++ b/fpdfsdk/src/javascript/JS_Runtime.cpp
@@ -40,7 +40,7 @@ IFXJS_Runtime* CJS_RuntimeFactory::NewJSRuntime(CPDFDoc_Environ
embedderDataSlot = pApp->GetFormFillInfo()->m_pJsPlatform->m_v8EmbedderSlot;
}
JS_Initial(embedderDataSlot);
- m_bInit = true;
+ m_bInit = TRUE;
}
return new CJS_Runtime(pApp);
}
@@ -58,7 +58,7 @@ void CJS_RuntimeFactory::Release()
{
JS_Release();
ReleaseGlobalData();
- m_bInit = false;
+ m_bInit = FALSE;
}
}
}
@@ -108,7 +108,7 @@ void CJS_ArrayBufferAllocator::Free(void* data, size_t length) {
CJS_Runtime::CJS_Runtime(CPDFDoc_Environment * pApp) :
m_pApp(pApp),
m_pDocument(NULL),
- m_bBlocking(false),
+ m_bBlocking(FALSE),
m_pFieldEventPath(NULL),
m_isolate(NULL)
{
@@ -150,46 +150,46 @@ CJS_Runtime::~CJS_Runtime()
m_isolate->Dispose();
}
-bool CJS_Runtime::InitJSObjects()
+FX_BOOL CJS_Runtime::InitJSObjects()
{
v8::Isolate::Scope isolate_scope(GetIsolate());
v8::HandleScope handle_scope(GetIsolate());
v8::Local<v8::Context> context = v8::Context::New(GetIsolate());
v8::Context::Scope context_scope(context);
//0 - 8
- if (CJS_Border::Init(*this, JS_STATIC) < 0) return false;
- if (CJS_Display::Init(*this, JS_STATIC) < 0) return false;
- if (CJS_Font::Init(*this, JS_STATIC) < 0) return false;
- if (CJS_Highlight::Init(*this, JS_STATIC) < 0) return false;
- if (CJS_Position::Init(*this, JS_STATIC) < 0) return false;
- if (CJS_ScaleHow::Init(*this, JS_STATIC) < 0) return false;
- if (CJS_ScaleWhen::Init(*this, JS_STATIC) < 0) return false;
- if (CJS_Style::Init(*this, JS_STATIC) < 0) return false;
- if (CJS_Zoomtype::Init(*this, JS_STATIC) < 0) return false;
+ if (CJS_Border::Init(*this, JS_STATIC) < 0) return FALSE;
+ if (CJS_Display::Init(*this, JS_STATIC) < 0) return FALSE;
+ if (CJS_Font::Init(*this, JS_STATIC) < 0) return FALSE;
+ if (CJS_Highlight::Init(*this, JS_STATIC) < 0) return FALSE;
+ if (CJS_Position::Init(*this, JS_STATIC) < 0) return FALSE;
+ if (CJS_ScaleHow::Init(*this, JS_STATIC) < 0) return FALSE;
+ if (CJS_ScaleWhen::Init(*this, JS_STATIC) < 0) return FALSE;
+ if (CJS_Style::Init(*this, JS_STATIC) < 0) return FALSE;
+ if (CJS_Zoomtype::Init(*this, JS_STATIC) < 0) return FALSE;
//9 - 11
- if (CJS_App::Init(*this, JS_STATIC) < 0) return false;
- if (CJS_Color::Init(*this, JS_STATIC) < 0) return false;
- if (CJS_Console::Init(*this, JS_STATIC) < 0) return false;
+ if (CJS_App::Init(*this, JS_STATIC) < 0) return FALSE;
+ if (CJS_Color::Init(*this, JS_STATIC) < 0) return FALSE;
+ if (CJS_Console::Init(*this, JS_STATIC) < 0) return FALSE;
//12 - 14
- if (CJS_Document::Init(*this, JS_DYNAMIC) < 0) return false;
- if (CJS_Event::Init(*this, JS_STATIC) < 0) return false;
- if (CJS_Field::Init(*this, JS_DYNAMIC) < 0) return false;
+ if (CJS_Document::Init(*this, JS_DYNAMIC) < 0) return FALSE;
+ if (CJS_Event::Init(*this, JS_STATIC) < 0) return FALSE;
+ if (CJS_Field::Init(*this, JS_DYNAMIC) < 0) return FALSE;
//15 - 17
- if (CJS_Global::Init(*this, JS_STATIC) < 0) return false;
- if (CJS_Icon::Init(*this, JS_DYNAMIC) < 0) return false;
- if (CJS_Util::Init(*this, JS_STATIC) < 0) return false;
+ if (CJS_Global::Init(*this, JS_STATIC) < 0) return FALSE;
+ if (CJS_Icon::Init(*this, JS_DYNAMIC) < 0) return FALSE;
+ if (CJS_Util::Init(*this, JS_STATIC) < 0) return FALSE;
- if (CJS_PublicMethods::Init(*this) < 0) return false;
- if (CJS_GlobalConsts::Init(*this) < 0) return false;
- if (CJS_GlobalArrays::Init(*this) < 0) return false;
+ if (CJS_PublicMethods::Init(*this) < 0) return FALSE;
+ if (CJS_GlobalConsts::Init(*this) < 0) return FALSE;
+ if (CJS_GlobalArrays::Init(*this) < 0) return FALSE;
- if (CJS_TimerObj::Init(*this, JS_DYNAMIC) < 0) return false;
- if (CJS_PrintParamsObj::Init(*this, JS_DYNAMIC) <0) return false;
+ if (CJS_TimerObj::Init(*this, JS_DYNAMIC) < 0) return FALSE;
+ if (CJS_PrintParamsObj::Init(*this, JS_DYNAMIC) <0) return FALSE;
- return true;
+ return TRUE;
}
IFXJS_Context* CJS_Runtime::NewContext()
@@ -255,7 +255,7 @@ void CJS_Runtime::SetReaderDocument(CPDFSDK_Document* pReaderDoc)
}
}
-bool CJS_Runtime::AddEventToLoop(const CFX_WideString& sTargetName, JS_EVENT_T eEventType)
+FX_BOOL CJS_Runtime::AddEventToLoop(const CFX_WideString& sTargetName, JS_EVENT_T eEventType)
{
if (m_pFieldEventPath == NULL)
{
@@ -264,7 +264,7 @@ bool CJS_Runtime::AddEventToLoop(const CFX_WideString& sTargetName, JS_EVENT_T e
m_pFieldEventPath->eEventType = eEventType;
m_pFieldEventPath->pNext = NULL;
- return true;
+ return TRUE;
}
//to search
@@ -273,7 +273,7 @@ bool CJS_Runtime::AddEventToLoop(const CFX_WideString& sTargetName, JS_EVENT_T e
while (p)
{
if (p->eEventType == eEventType && p->sTargetName == sTargetName)
- return false;
+ return FALSE;
pLast = p;
p = p->pNext;
@@ -287,12 +287,12 @@ bool CJS_Runtime::AddEventToLoop(const CFX_WideString& sTargetName, JS_EVENT_T e
pLast->pNext = pNew;
- return true;
+ return TRUE;
}
void CJS_Runtime::RemoveEventInLoop(const CFX_WideString& sTargetName, JS_EVENT_T eEventType)
{
- bool bFind = false;
+ FX_BOOL bFind = FALSE;
CJS_FieldEvent* p = m_pFieldEventPath;
CJS_FieldEvent* pLast = NULL;
@@ -300,7 +300,7 @@ void CJS_Runtime::RemoveEventInLoop(const CFX_WideString& sTargetName, JS_EVENT_
{
if (p->eEventType == eEventType && p->sTargetName == sTargetName)
{
- bFind = true;
+ bFind = TRUE;
break;
}