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

Side by Side Diff: fpdfsdk/include/javascript/JS_Object.h

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 unified diff | Download patch
« no previous file with comments | « fpdfsdk/include/javascript/JS_GlobalData.h ('k') | fpdfsdk/include/javascript/JS_Runtime.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #ifndef FPDFSDK_INCLUDE_JAVASCRIPT_JS_OBJECT_H_ 7 #ifndef FPDFSDK_INCLUDE_JAVASCRIPT_JS_OBJECT_H_
8 #define FPDFSDK_INCLUDE_JAVASCRIPT_JS_OBJECT_H_ 8 #define FPDFSDK_INCLUDE_JAVASCRIPT_JS_OBJECT_H_
9 9
10 #include "../fsdk_define.h" // For FX_UINT 10 #include "../fsdk_define.h" // For FX_UINT
(...skipping 30 matching lines...) Expand all
41 41
42 class CJS_Object 42 class CJS_Object
43 { 43 {
44 public: 44 public:
45 CJS_Object(JSFXObject pObject); 45 CJS_Object(JSFXObject pObject);
46 virtual ~CJS_Object(void); 46 virtual ~CJS_Object(void);
47 47
48 void MakeWeak(); 48 void MakeWeak();
49 void Dispose(); 49 void Dispose();
50 50
51 » virtual FX_BOOL»» » » IsType(const FX_CHAR* sClassName ){return TRUE;}; 51 » virtual bool» » » » IsType(const FX_CHAR* sClassName ){return true;};
52 virtual CFX_ByteString GetClassName(){return "";}; 52 virtual CFX_ByteString GetClassName(){return "";};
53 53
54 » virtual FX_BOOL»» » » InitInstance(IFXJS_Context* cc){ return TRUE;}; 54 » virtual bool» » » » InitInstance(IFXJS_Context* cc){ return true;};
55 » virtual FX_BOOL»» » » ExitInstance(){return TRUE;}; 55 » virtual bool» » » » ExitInstance(){return true;};
56 56
57 operator JSFXObject () {return v8 ::Local<v8::Object>::New(m_pIsolate, m_pObject);} 57 operator JSFXObject () {return v8 ::Local<v8::Object>::New(m_pIsolate, m_pObject);}
58 operator CJS_EmbedObj* (){return m_pEmbedObj;}; 58 operator CJS_EmbedObj* (){return m_pEmbedObj;};
59 59
60 void SetEmbedObject(CJS_Embed Obj* pObj){m_pEmbedObj = pObj;}; 60 void SetEmbedObject(CJS_Embed Obj* pObj){m_pEmbedObj = pObj;};
61 CJS_EmbedObj * GetEmbedObject(){return m_pEmbed Obj;}; 61 CJS_EmbedObj * GetEmbedObject(){return m_pEmbed Obj;};
62 62
63 static CPDFSDK_PageView * JSGetPageView(IFXJS_Context* cc); 63 static CPDFSDK_PageView * JSGetPageView(IFXJS_Context* cc);
64 static int MsgBox(CPDFDoc_Environme nt* pApp, CPDFSDK_PageView* pPageView, const FX_WCHAR* swMsg, const FX_WCHAR* sw Title = NULL, FX_UINT nType = 0,FX_UINT nIcon = 0); 64 static int MsgBox(CPDFDoc_Environme nt* pApp, CPDFSDK_PageView* pPageView, const FX_WCHAR* swMsg, const FX_WCHAR* sw Title = NULL, FX_UINT nType = 0,FX_UINT nIcon = 0);
65 static void Alert(CJS_Context* pCont ext, const FX_WCHAR* swMsg); 65 static void Alert(CJS_Context* pCont ext, const FX_WCHAR* swMsg);
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 JS_TIMER_MAPARRAY& GetTimeMap(); 165 JS_TIMER_MAPARRAY& GetTimeMap();
166 166
167 class CJS_Runtime; 167 class CJS_Runtime;
168 168
169 class CJS_Timer 169 class CJS_Timer
170 { 170 {
171 public: 171 public:
172 CJS_Timer(CJS_EmbedObj * pObj,CPDFDoc_Environment* pApp): 172 CJS_Timer(CJS_EmbedObj * pObj,CPDFDoc_Environment* pApp):
173 m_nTimerID(0), 173 m_nTimerID(0),
174 m_pEmbedObj(pObj), 174 m_pEmbedObj(pObj),
175 » » m_bProcessing(FALSE), 175 » » m_bProcessing(false),
176 m_dwStartTime(0), 176 m_dwStartTime(0),
177 m_dwTimeOut(0), 177 m_dwTimeOut(0),
178 m_dwElapse(0), 178 m_dwElapse(0),
179 m_pRuntime(NULL), 179 m_pRuntime(NULL),
180 m_nType(0), 180 m_nType(0),
181 m_pApp(pApp) 181 m_pApp(pApp)
182 { 182 {
183 } 183 }
184 184
185 virtual ~CJS_Timer() 185 virtual ~CJS_Timer()
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 { 258 {
259 return m_swJScript; 259 return m_swJScript;
260 } 260 }
261 261
262 static void TimerProc(int idEvent) 262 static void TimerProc(int idEvent)
263 { 263 {
264 if (CJS_Timer * pTimer = GetTimeMap().GetAt(idEvent)) 264 if (CJS_Timer * pTimer = GetTimeMap().GetAt(idEvent))
265 { 265 {
266 if (!pTimer->m_bProcessing) 266 if (!pTimer->m_bProcessing)
267 { 267 {
268 » » » » pTimer->m_bProcessing = TRUE; 268 » » » » pTimer->m_bProcessing = true;
269 if (pTimer->m_pEmbedObj) pTimer->m_pEmbedObj->Ti merProc(pTimer); 269 if (pTimer->m_pEmbedObj) pTimer->m_pEmbedObj->Ti merProc(pTimer);
270 » » » » pTimer->m_bProcessing = FALSE; 270 » » » » pTimer->m_bProcessing = false;
271 } 271 }
272 else 272 else
273 { 273 {
274 // TRACE(L"BUSY!\n"); 274 // TRACE(L"BUSY!\n");
275 } 275 }
276 } 276 }
277 }; 277 };
278 278
279 private: 279 private:
280 FX_UINT m_nTimerID; 280 FX_UINT m_nTimerID;
281 CJS_EmbedObj* m_pEmbedObj; 281 CJS_EmbedObj* m_pEmbedObj;
282 » FX_BOOL»» » » » » » m_bProcessing; 282 » bool» » » » » » » m_bProcessing;
283 283
284 //data 284 //data
285 FX_DWORD m_dwStar tTime; 285 FX_DWORD m_dwStar tTime;
286 FX_DWORD m_dwTime Out; 286 FX_DWORD m_dwTime Out;
287 FX_DWORD m_dwElapse; 287 FX_DWORD m_dwElapse;
288 CJS_Runtime* m_pRuntime; 288 CJS_Runtime* m_pRuntime;
289 CFX_WideString m_swJScript; 289 CFX_WideString m_swJScript;
290 int m_nType; //0:Interval; 1:TimeOut 290 int m_nType; //0:Interval; 1:TimeOut
291 291
292 CPDFDoc_Environment* m_pApp; 292 CPDFDoc_Environment* m_pApp;
293 }; 293 };
294 294
295 #endif // FPDFSDK_INCLUDE_JAVASCRIPT_JS_OBJECT_H_ 295 #endif // FPDFSDK_INCLUDE_JAVASCRIPT_JS_OBJECT_H_
OLDNEW
« no previous file with comments | « fpdfsdk/include/javascript/JS_GlobalData.h ('k') | fpdfsdk/include/javascript/JS_Runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698