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

Side by Side Diff: fpdfsdk/javascript/JS_Object.cpp

Issue 2031653003: Get rid of NULLs in fpdfsdk/ (Closed) Base URL: https://pdfium.googlesource.com/pdfium@nullptr_core
Patch Set: rebase Created 4 years, 6 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/javascript/JS_GlobalData.cpp ('k') | fpdfsdk/javascript/JS_Value.cpp » ('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 #include "fpdfsdk/javascript/JS_Object.h" 7 #include "fpdfsdk/javascript/JS_Object.h"
8 8
9 #include "fpdfsdk/include/fsdk_mgr.h" 9 #include "fpdfsdk/include/fsdk_mgr.h"
10 #include "fpdfsdk/javascript/JS_Define.h" 10 #include "fpdfsdk/javascript/JS_Define.h"
(...skipping 13 matching lines...) Expand all
24 pDoc->KillFocusAnnot(); 24 pDoc->KillFocusAnnot();
25 25
26 return pApp->JS_appAlert(swMsg, swTitle, nType, nIcon); 26 return pApp->JS_appAlert(swMsg, swTitle, nType, nIcon);
27 } 27 }
28 28
29 } // namespace 29 } // namespace
30 30
31 CJS_EmbedObj::CJS_EmbedObj(CJS_Object* pJSObject) : m_pJSObject(pJSObject) {} 31 CJS_EmbedObj::CJS_EmbedObj(CJS_Object* pJSObject) : m_pJSObject(pJSObject) {}
32 32
33 CJS_EmbedObj::~CJS_EmbedObj() { 33 CJS_EmbedObj::~CJS_EmbedObj() {
34 m_pJSObject = NULL; 34 m_pJSObject = nullptr;
35 } 35 }
36 36
37 int CJS_EmbedObj::MsgBox(CPDFDoc_Environment* pApp, 37 int CJS_EmbedObj::MsgBox(CPDFDoc_Environment* pApp,
38 const FX_WCHAR* swMsg, 38 const FX_WCHAR* swMsg,
39 const FX_WCHAR* swTitle, 39 const FX_WCHAR* swTitle,
40 FX_UINT nType, 40 FX_UINT nType,
41 FX_UINT nIcon) { 41 FX_UINT nIcon) {
42 return FXJS_MsgBox(pApp, swMsg, swTitle, nType, nIcon); 42 return FXJS_MsgBox(pApp, swMsg, swTitle, nType, nIcon);
43 } 43 }
44 44
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 const FX_WCHAR* swTitle, 80 const FX_WCHAR* swTitle,
81 FX_UINT nType, 81 FX_UINT nType,
82 FX_UINT nIcon) { 82 FX_UINT nIcon) {
83 return FXJS_MsgBox(pApp, swMsg, swTitle, nType, nIcon); 83 return FXJS_MsgBox(pApp, swMsg, swTitle, nType, nIcon);
84 } 84 }
85 85
86 void CJS_Object::Alert(CJS_Context* pContext, const FX_WCHAR* swMsg) { 86 void CJS_Object::Alert(CJS_Context* pContext, const FX_WCHAR* swMsg) {
87 if (pContext->IsMsgBoxEnabled()) { 87 if (pContext->IsMsgBoxEnabled()) {
88 CPDFDoc_Environment* pApp = pContext->GetReaderApp(); 88 CPDFDoc_Environment* pApp = pContext->GetReaderApp();
89 if (pApp) 89 if (pApp)
90 pApp->JS_appAlert(swMsg, NULL, 0, 3); 90 pApp->JS_appAlert(swMsg, nullptr, 0, 3);
91 } 91 }
92 } 92 }
93 93
94 CJS_Timer::CJS_Timer(CJS_EmbedObj* pObj, 94 CJS_Timer::CJS_Timer(CJS_EmbedObj* pObj,
95 CPDFDoc_Environment* pApp, 95 CPDFDoc_Environment* pApp,
96 CJS_Runtime* pRuntime, 96 CJS_Runtime* pRuntime,
97 int nType, 97 int nType,
98 const CFX_WideString& script, 98 const CFX_WideString& script,
99 uint32_t dwElapse, 99 uint32_t dwElapse,
100 uint32_t dwTimeOut) 100 uint32_t dwTimeOut)
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 // static 148 // static
149 CJS_Timer::TimerMap* CJS_Timer::GetGlobalTimerMap() { 149 CJS_Timer::TimerMap* CJS_Timer::GetGlobalTimerMap() {
150 // Leak the timer array at shutdown. 150 // Leak the timer array at shutdown.
151 static auto* s_TimerMap = new TimerMap; 151 static auto* s_TimerMap = new TimerMap;
152 return s_TimerMap; 152 return s_TimerMap;
153 } 153 }
154 154
155 void CJS_Timer::OnDestroyed() { 155 void CJS_Timer::OnDestroyed() {
156 m_bValid = false; 156 m_bValid = false;
157 } 157 }
OLDNEW
« no previous file with comments | « fpdfsdk/javascript/JS_GlobalData.cpp ('k') | fpdfsdk/javascript/JS_Value.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698