summaryrefslogtreecommitdiff
path: root/fpdfsdk/include/javascript/Document.h
diff options
context:
space:
mode:
authorJUN FANG <jun_fang@foxitsoftware.com>2015-04-06 12:39:51 -0700
committerJUN FANG <jun_fang@foxitsoftware.com>2015-04-06 12:44:08 -0700
commit33f6f0d9822b729f85a9ff7593ad82240ae22bf6 (patch)
treeba0d637dc9a18766a07b52c66135e58192bfc198 /fpdfsdk/include/javascript/Document.h
parente799e01bc6c8ef491154c555687ccaa8f9c87b6c (diff)
downloadpdfium-33f6f0d9822b729f85a9ff7593ad82240ae22bf6.tar.xz
Merge to XFA: Fix a fatal error due to cloning a global document object
BUG=454595 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1053373002
Diffstat (limited to 'fpdfsdk/include/javascript/Document.h')
-rw-r--r--fpdfsdk/include/javascript/Document.h52
1 files changed, 23 insertions, 29 deletions
diff --git a/fpdfsdk/include/javascript/Document.h b/fpdfsdk/include/javascript/Document.h
index 7d7cd7c8a0..8aa53fe7f7 100644
--- a/fpdfsdk/include/javascript/Document.h
+++ b/fpdfsdk/include/javascript/Document.h
@@ -160,38 +160,32 @@ public:
FX_BOOL removeIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
public:
- void AttachDoc(CPDFSDK_Document* pDoc);
- CPDFSDK_Document* GetReaderDoc();
-
- static FX_BOOL ExtractFileName(CPDFSDK_Document* pDoc, CFX_ByteString& strFileName);
- static FX_BOOL ExtractFolderName(CPDFSDK_Document* pDoc, CFX_ByteString& strFolderName);
-
-public:
- void AddDelayData(CJS_DelayData* pData);
- void DoFieldDelay(const CFX_WideString& sFieldName, int nControlIndex);
-
- void AddDelayAnnotData(CJS_AnnotObj *pData);
- void DoAnnotDelay();
- void SetIsolate(v8::Isolate* isolate) {m_isolate = isolate;}
-
-private:
- CFX_WideString ReversalStr(CFX_WideString cbFrom);
- CFX_WideString CutString(CFX_WideString cbFrom);
- bool IsEnclosedInRect(CFX_FloatRect rect, CFX_FloatRect LinkRect);
- int CountWords(CPDF_TextObject* pTextObj);
- CFX_WideString GetObjWordStr(CPDF_TextObject* pTextObj, int nWordIndex);
-
- FX_BOOL ParserParams(JSObject *pObj,CJS_AnnotObj& annotobj);
+ void AttachDoc(CPDFSDK_Document* pDoc);
+ CPDFSDK_Document* GetReaderDoc();
+ static FX_BOOL ExtractFileName(CPDFSDK_Document* pDoc, CFX_ByteString& strFileName);
+ static FX_BOOL ExtractFolderName(CPDFSDK_Document* pDoc, CFX_ByteString& strFolderName);
+ void AddDelayData(CJS_DelayData* pData);
+ void DoFieldDelay(const CFX_WideString& sFieldName, int nControlIndex);
+ void AddDelayAnnotData(CJS_AnnotObj *pData);
+ void DoAnnotDelay();
+ void SetIsolate(v8::Isolate* isolate) {m_isolate = isolate;}
+ CJS_Document* GetCJSDoc() const;
private:
- v8::Isolate* m_isolate;
- IconTree* m_pIconTree;
- CPDFSDK_Document* m_pDocument;
- CFX_WideString m_cwBaseURL;
+ CFX_WideString ReversalStr(CFX_WideString cbFrom);
+ CFX_WideString CutString(CFX_WideString cbFrom);
+ bool IsEnclosedInRect(CFX_FloatRect rect, CFX_FloatRect LinkRect);
+ int CountWords(CPDF_TextObject* pTextObj);
+ CFX_WideString GetObjWordStr(CPDF_TextObject* pTextObj, int nWordIndex);
+ FX_BOOL ParserParams(JSObject *pObj,CJS_AnnotObj& annotobj);
- FX_BOOL m_bDelay;
- CFX_ArrayTemplate<CJS_DelayData*> m_DelayData;
- CFX_ArrayTemplate<CJS_AnnotObj*> m_DelayAnnotData;
+ v8::Isolate* m_isolate;
+ IconTree* m_pIconTree;
+ CPDFSDK_Document* m_pDocument;
+ CFX_WideString m_cwBaseURL;
+ FX_BOOL m_bDelay;
+ CFX_ArrayTemplate<CJS_DelayData*> m_DelayData;
+ CFX_ArrayTemplate<CJS_AnnotObj*> m_DelayAnnotData;
};
class CJS_Document : public CJS_Object