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

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

Issue 2245863002: Push v8::Isolate into CFXJS_Engine class (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Null isolate before letting CFXJS_Engine dtor invoked Created 4 years, 4 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/Consts.cpp ('k') | fpdfsdk/javascript/Document.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_DOCUMENT_H_ 7 #ifndef FPDFSDK_JAVASCRIPT_DOCUMENT_H_
8 #define FPDFSDK_JAVASCRIPT_DOCUMENT_H_ 8 #define FPDFSDK_JAVASCRIPT_DOCUMENT_H_
9 9
10 #include <list> 10 #include <list>
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 FX_BOOL removeIcon(IJS_Context* cc, 262 FX_BOOL removeIcon(IJS_Context* cc,
263 const std::vector<CJS_Value>& params, 263 const std::vector<CJS_Value>& params,
264 CJS_Value& vRet, 264 CJS_Value& vRet,
265 CFX_WideString& sError); 265 CFX_WideString& sError);
266 FX_BOOL URL(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); 266 FX_BOOL URL(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
267 267
268 void AttachDoc(CPDFSDK_Document* pDoc); 268 void AttachDoc(CPDFSDK_Document* pDoc);
269 CPDFSDK_Document* GetReaderDoc(); 269 CPDFSDK_Document* GetReaderDoc();
270 void AddDelayData(CJS_DelayData* pData); 270 void AddDelayData(CJS_DelayData* pData);
271 void DoFieldDelay(const CFX_WideString& sFieldName, int nControlIndex); 271 void DoFieldDelay(const CFX_WideString& sFieldName, int nControlIndex);
272 void SetIsolate(v8::Isolate* isolate) { m_isolate = isolate; }
273 CJS_Document* GetCJSDoc() const; 272 CJS_Document* GetCJSDoc() const;
274 273
275 private: 274 private:
276 bool IsEnclosedInRect(CFX_FloatRect rect, CFX_FloatRect LinkRect); 275 bool IsEnclosedInRect(CFX_FloatRect rect, CFX_FloatRect LinkRect);
277 int CountWords(CPDF_TextObject* pTextObj); 276 int CountWords(CPDF_TextObject* pTextObj);
278 CFX_WideString GetObjWordStr(CPDF_TextObject* pTextObj, int nWordIndex); 277 CFX_WideString GetObjWordStr(CPDF_TextObject* pTextObj, int nWordIndex);
279 278
280 FX_BOOL getPropertyInternal(IJS_Context* cc, 279 FX_BOOL getPropertyInternal(IJS_Context* cc,
281 CJS_PropValue& vp, 280 CJS_PropValue& vp,
282 const CFX_ByteString& propName, 281 const CFX_ByteString& propName,
283 CFX_WideString& sError); 282 CFX_WideString& sError);
284 283
285 v8::Isolate* m_isolate;
286 std::list<std::unique_ptr<IconElement>> m_IconList;
287 CPDFSDK_Document* m_pDocument; 284 CPDFSDK_Document* m_pDocument;
288 CFX_WideString m_cwBaseURL; 285 CFX_WideString m_cwBaseURL;
286 std::list<std::unique_ptr<CJS_DelayData>> m_DelayData;
287 std::list<std::unique_ptr<IconElement>> m_IconList;
289 bool m_bDelay; 288 bool m_bDelay;
290 std::list<std::unique_ptr<CJS_DelayData>> m_DelayData;
291 }; 289 };
292 290
293 class CJS_Document : public CJS_Object { 291 class CJS_Document : public CJS_Object {
294 public: 292 public:
295 explicit CJS_Document(v8::Local<v8::Object> pObject) : CJS_Object(pObject) {} 293 explicit CJS_Document(v8::Local<v8::Object> pObject) : CJS_Object(pObject) {}
296 ~CJS_Document() override {} 294 ~CJS_Document() override {}
297 295
298 // CJS_Object 296 // CJS_Object
299 void InitInstance(IJS_Runtime* pIRuntime) override; 297 void InitInstance(IJS_Runtime* pIRuntime) override;
300 298
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 JS_STATIC_METHOD(removeField, Document); 368 JS_STATIC_METHOD(removeField, Document);
371 JS_STATIC_METHOD(replacePages, Document); 369 JS_STATIC_METHOD(replacePages, Document);
372 JS_STATIC_METHOD(removeIcon, Document); 370 JS_STATIC_METHOD(removeIcon, Document);
373 JS_STATIC_METHOD(resetForm, Document); 371 JS_STATIC_METHOD(resetForm, Document);
374 JS_STATIC_METHOD(saveAs, Document); 372 JS_STATIC_METHOD(saveAs, Document);
375 JS_STATIC_METHOD(submitForm, Document); 373 JS_STATIC_METHOD(submitForm, Document);
376 JS_STATIC_METHOD(mailDoc, Document); 374 JS_STATIC_METHOD(mailDoc, Document);
377 }; 375 };
378 376
379 #endif // FPDFSDK_JAVASCRIPT_DOCUMENT_H_ 377 #endif // FPDFSDK_JAVASCRIPT_DOCUMENT_H_
OLDNEW
« no previous file with comments | « fpdfsdk/javascript/Consts.cpp ('k') | fpdfsdk/javascript/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698