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

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

Issue 1252613002: FX_BOOL considered harmful. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Manual edits. Created 5 years, 5 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/JS_GlobalData.cpp ('k') | fpdfsdk/src/javascript/JS_Value.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/javascript/JS_Runtime.cpp
diff --git a/fpdfsdk/src/javascript/JS_Runtime.cpp b/fpdfsdk/src/javascript/JS_Runtime.cpp
index 2343eb3a4354a2289f3ec1f56f1772d3c62692c4..e23e9de2256758d04428eae9ba90681afe798e1f 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_Environment* pApp)
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;
}
}
}
@@ -111,8 +111,8 @@ 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_bRegistered(FALSE),
+ m_bBlocking(false),
+ m_bRegistered(false),
m_pFieldEventPath(NULL),
m_isolate(NULL)
{
@@ -154,46 +154,46 @@ CJS_Runtime::~CJS_Runtime()
m_isolate->Dispose();
}
-FX_BOOL CJS_Runtime::InitJSObjects()
+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()
@@ -259,7 +259,7 @@ void CJS_Runtime::SetReaderDocument(CPDFSDK_Document* pReaderDoc)
}
}
-FX_BOOL CJS_Runtime::AddEventToLoop(const CFX_WideString& sTargetName, JS_EVENT_T eEventType)
+bool CJS_Runtime::AddEventToLoop(const CFX_WideString& sTargetName, JS_EVENT_T eEventType)
{
if (m_pFieldEventPath == NULL)
{
@@ -268,7 +268,7 @@ FX_BOOL CJS_Runtime::AddEventToLoop(const CFX_WideString& sTargetName, JS_EVENT_
m_pFieldEventPath->eEventType = eEventType;
m_pFieldEventPath->pNext = NULL;
- return TRUE;
+ return true;
}
//to search
@@ -277,7 +277,7 @@ FX_BOOL CJS_Runtime::AddEventToLoop(const CFX_WideString& sTargetName, JS_EVENT_
while (p)
{
if (p->eEventType == eEventType && p->sTargetName == sTargetName)
- return FALSE;
+ return false;
pLast = p;
p = p->pNext;
@@ -291,12 +291,12 @@ FX_BOOL CJS_Runtime::AddEventToLoop(const CFX_WideString& sTargetName, JS_EVENT_
pLast->pNext = pNew;
- return TRUE;
+ return true;
}
void CJS_Runtime::RemoveEventInLoop(const CFX_WideString& sTargetName, JS_EVENT_T eEventType)
{
- FX_BOOL bFind = FALSE;
+ bool bFind = false;
CJS_FieldEvent* p = m_pFieldEventPath;
CJS_FieldEvent* pLast = NULL;
@@ -304,7 +304,7 @@ void CJS_Runtime::RemoveEventInLoop(const CFX_WideString& sTargetName, JS_EVENT_
{
if (p->eEventType == eEventType && p->sTargetName == sTargetName)
{
- bFind = TRUE;
+ bFind = true;
break;
}
« no previous file with comments | « fpdfsdk/src/javascript/JS_GlobalData.cpp ('k') | fpdfsdk/src/javascript/JS_Value.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698