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

Side by Side Diff: fpdfsdk/javascript/app.h

Issue 1834203002: use std::vector in more places in JavaScript bindings code. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@util_printx
Patch Set: Nits. Created 4 years, 8 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_Runtime.cpp ('k') | fpdfsdk/javascript/app.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 #ifndef FPDFSDK_JAVASCRIPT_APP_H_ 7 #ifndef FPDFSDK_JAVASCRIPT_APP_H_
8 #define FPDFSDK_JAVASCRIPT_APP_H_ 8 #define FPDFSDK_JAVASCRIPT_APP_H_
9 9
10 #include <memory>
10 #include <vector> 11 #include <vector>
11 12
12 #include "fpdfsdk/javascript/JS_Define.h" 13 #include "fpdfsdk/javascript/JS_Define.h"
13 14
14 class CJS_Runtime; 15 class CJS_Runtime;
15 class CJS_Timer; 16 class CJS_Timer;
16 17
17 class TimerObj : public CJS_EmbedObj { 18 class TimerObj : public CJS_EmbedObj {
18 public: 19 public:
19 TimerObj(CJS_Object* pJSObject); 20 TimerObj(CJS_Object* pJSObject);
(...skipping 13 matching lines...) Expand all
33 ~CJS_TimerObj() override {} 34 ~CJS_TimerObj() override {}
34 35
35 DECLARE_JS_CLASS(); 36 DECLARE_JS_CLASS();
36 }; 37 };
37 38
38 class app : public CJS_EmbedObj { 39 class app : public CJS_EmbedObj {
39 public: 40 public:
40 app(CJS_Object* pJSObject); 41 app(CJS_Object* pJSObject);
41 ~app() override; 42 ~app() override;
42 43
43 public:
44 FX_BOOL activeDocs(IJS_Context* cc, 44 FX_BOOL activeDocs(IJS_Context* cc,
45 CJS_PropValue& vp, 45 CJS_PropValue& vp,
46 CFX_WideString& sError); 46 CFX_WideString& sError);
47 FX_BOOL calculate(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); 47 FX_BOOL calculate(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
48 FX_BOOL formsVersion(IJS_Context* cc, 48 FX_BOOL formsVersion(IJS_Context* cc,
49 CJS_PropValue& vp, 49 CJS_PropValue& vp,
50 CFX_WideString& sError); 50 CFX_WideString& sError);
51 FX_BOOL fs(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); 51 FX_BOOL fs(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
52 FX_BOOL fullscreen(IJS_Context* cc, 52 FX_BOOL fullscreen(IJS_Context* cc,
53 CJS_PropValue& vp, 53 CJS_PropValue& vp,
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 CJS_Value& vRet, 153 CJS_Value& vRet,
154 CFX_WideString& sError); 154 CFX_WideString& sError);
155 155
156 static CFX_WideString SysPathToPDFPath(const CFX_WideString& sOldPath); 156 static CFX_WideString SysPathToPDFPath(const CFX_WideString& sOldPath);
157 157
158 private: 158 private:
159 // CJS_EmbedObj 159 // CJS_EmbedObj
160 void TimerProc(CJS_Timer* pTimer) override; 160 void TimerProc(CJS_Timer* pTimer) override;
161 void RunJsScript(CJS_Runtime* pRuntime, const CFX_WideString& wsScript); 161 void RunJsScript(CJS_Runtime* pRuntime, const CFX_WideString& wsScript);
162 162
163 void ClearTimerCommon(const CJS_Value& param);
164
163 bool m_bCalculate; 165 bool m_bCalculate;
164 bool m_bRuntimeHighLight; 166 bool m_bRuntimeHighLight;
165 CFX_ArrayTemplate<CJS_Timer*> m_aTimer; 167 std::vector<std::unique_ptr<CJS_Timer>> m_Timers;
166 }; 168 };
167 169
168 class CJS_App : public CJS_Object { 170 class CJS_App : public CJS_Object {
169 public: 171 public:
170 explicit CJS_App(v8::Local<v8::Object> pObject) : CJS_Object(pObject) {} 172 explicit CJS_App(v8::Local<v8::Object> pObject) : CJS_Object(pObject) {}
171 ~CJS_App() override {} 173 ~CJS_App() override {}
172 174
173 DECLARE_JS_CLASS(); 175 DECLARE_JS_CLASS();
174 176
175 JS_STATIC_PROP(activeDocs, app); 177 JS_STATIC_PROP(activeDocs, app);
(...skipping 26 matching lines...) Expand all
202 JS_STATIC_METHOD(openDoc, app); 204 JS_STATIC_METHOD(openDoc, app);
203 JS_STATIC_METHOD(openFDF, app); 205 JS_STATIC_METHOD(openFDF, app);
204 JS_STATIC_METHOD(popUpMenuEx, app); 206 JS_STATIC_METHOD(popUpMenuEx, app);
205 JS_STATIC_METHOD(popUpMenu, app); 207 JS_STATIC_METHOD(popUpMenu, app);
206 JS_STATIC_METHOD(response, app); 208 JS_STATIC_METHOD(response, app);
207 JS_STATIC_METHOD(setInterval, app); 209 JS_STATIC_METHOD(setInterval, app);
208 JS_STATIC_METHOD(setTimeOut, app); 210 JS_STATIC_METHOD(setTimeOut, app);
209 }; 211 };
210 212
211 #endif // FPDFSDK_JAVASCRIPT_APP_H_ 213 #endif // FPDFSDK_JAVASCRIPT_APP_H_
OLDNEW
« no previous file with comments | « fpdfsdk/javascript/JS_Runtime.cpp ('k') | fpdfsdk/javascript/app.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698