summaryrefslogtreecommitdiff
path: root/fpdfsdk/include/javascript/JS_Object.h
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-02-05 15:27:25 -0800
committerTom Sepez <tsepez@chromium.org>2015-02-05 15:27:25 -0800
commitc6ab1725213a487838cbe03cb08cb5cac4ad956a (patch)
tree9b736199673b73677054307794b62165c72f03f1 /fpdfsdk/include/javascript/JS_Object.h
parentdbe2a8e6ac3d92edf640ed10a6d4a0e658bc35c5 (diff)
downloadpdfium-c6ab1725213a487838cbe03cb08cb5cac4ad956a.tar.xz
Kill off some dodgy JS callbacks
None of these are currently reachable because the IsSafeMode method always returns true. This, in turn, will let us kill off some file (as in fopen()) based parsing. That, in turn, will let us kill of some more now-unreachable code. In general, we don't want to have unsafe modes. BUG=https://code.google.com/p/pdfium/issues/detail?id=116 R=jam@chromium.org Review URL: https://codereview.chromium.org/883393007
Diffstat (limited to 'fpdfsdk/include/javascript/JS_Object.h')
-rw-r--r--fpdfsdk/include/javascript/JS_Object.h22
1 files changed, 10 insertions, 12 deletions
diff --git a/fpdfsdk/include/javascript/JS_Object.h b/fpdfsdk/include/javascript/JS_Object.h
index 7ee3464dc7..33c1a1ff62 100644
--- a/fpdfsdk/include/javascript/JS_Object.h
+++ b/fpdfsdk/include/javascript/JS_Object.h
@@ -1,7 +1,7 @@
// Copyright 2014 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-
+
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#ifndef _JS_OBJECT_H_
@@ -28,10 +28,8 @@ public:
CPDFSDK_PageView * JSGetPageView(IFXJS_Context* cc);
int MsgBox(CPDFDoc_Environment * pApp, CPDFSDK_PageView* pPageView, FX_LPCWSTR swMsg, FX_LPCWSTR swTitle = NULL, FX_UINT nType = 0, FX_UINT nIcon = 0);
void Alert(CJS_Context* pContext, FX_LPCWSTR swMsg);
- FX_BOOL IsSafeMode(IFXJS_Context* cc);
protected:
-
CJS_Object* m_pJSObject;
};
@@ -40,7 +38,7 @@ class CJS_Object : public CFX_Object
public:
CJS_Object(JSFXObject pObject);
virtual ~CJS_Object(void);
-
+
void MakeWeak();
virtual FX_BOOL IsType(FX_LPCSTR sClassName){return TRUE;};
@@ -141,9 +139,9 @@ public:
}
int Find(FX_UINT nIndex)
- {
+ {
for (int i=0,sz=m_Array.GetSize(); i<sz; i++)
- {
+ {
if (JS_TIMER_MAP * pMap = m_Array.GetAt(i))
{
if (pMap->nID == nIndex)
@@ -165,8 +163,8 @@ class CJS_Timer
{
public:
CJS_Timer(CJS_EmbedObj * pObj, CPDFDoc_Environment* pApp):
- m_nTimerID(0),
- m_pEmbedObj(pObj),
+ m_nTimerID(0),
+ m_pEmbedObj(pObj),
m_bProcessing(FALSE),
m_dwStartTime(0),
m_dwTimeOut(0),
@@ -176,7 +174,7 @@ public:
m_pApp(pApp)
{
}
-
+
virtual ~CJS_Timer()
{
KillJSTimer();
@@ -184,7 +182,7 @@ public:
public:
FX_UINT SetJSTimer(FX_UINT nElapse)
- {
+ {
if (m_nTimerID)KillJSTimer();
IFX_SystemHandler* pHandler = m_pApp->GetSysHandler();
m_nTimerID = pHandler->SetTimer(nElapse,TimerProc);
@@ -243,7 +241,7 @@ public:
{
m_pRuntime = pRuntime;
}
-
+
CJS_Runtime* GetRuntime() const
{
return m_pRuntime;
@@ -277,7 +275,7 @@ public:
};
private:
- FX_UINT m_nTimerID;
+ FX_UINT m_nTimerID;
CJS_EmbedObj* m_pEmbedObj;
FX_BOOL m_bProcessing;