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

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

Issue 1334833003: Merge to XFA: Remove some abstractions in fxjs_v8.h. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 3 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_Define.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 <map> 10 #include <map>
(...skipping 30 matching lines...) Expand all
41 FX_UINT nType = 0, 41 FX_UINT nType = 0,
42 FX_UINT nIcon = 0); 42 FX_UINT nIcon = 0);
43 void Alert(CJS_Context* pContext, const FX_WCHAR* swMsg); 43 void Alert(CJS_Context* pContext, const FX_WCHAR* swMsg);
44 44
45 protected: 45 protected:
46 CJS_Object* m_pJSObject; 46 CJS_Object* m_pJSObject;
47 }; 47 };
48 48
49 class CJS_Object { 49 class CJS_Object {
50 public: 50 public:
51 explicit CJS_Object(JSFXObject pObject); 51 explicit CJS_Object(v8::Local<v8::Object> pObject);
52 virtual ~CJS_Object(); 52 virtual ~CJS_Object();
53 53
54 void MakeWeak(); 54 void MakeWeak();
55 void Dispose(); 55 void Dispose();
56 56
57 virtual FX_BOOL IsType(const FX_CHAR* sClassName) { return TRUE; } 57 virtual FX_BOOL IsType(const FX_CHAR* sClassName) { return TRUE; }
58 virtual CFX_ByteString GetClassName() { return ""; } 58 virtual CFX_ByteString GetClassName() { return ""; }
59 59
60 virtual FX_BOOL InitInstance(IFXJS_Context* cc) { return TRUE; } 60 virtual FX_BOOL InitInstance(IFXJS_Context* cc) { return TRUE; }
61 virtual FX_BOOL ExitInstance() { return TRUE; } 61 virtual FX_BOOL ExitInstance() { return TRUE; }
62 62
63 operator JSFXObject() { 63 operator v8::Local<v8::Object>() {
64 return v8::Local<v8::Object>::New(m_pIsolate, m_pObject); 64 return v8::Local<v8::Object>::New(m_pIsolate, m_pObject);
65 } 65 }
66 66
67 // Takes ownership of |pObj|. 67 // Takes ownership of |pObj|.
68 void SetEmbedObject(CJS_EmbedObj* pObj) { m_pEmbedObj.reset(pObj); } 68 void SetEmbedObject(CJS_EmbedObj* pObj) { m_pEmbedObj.reset(pObj); }
69 CJS_EmbedObj* GetEmbedObject() const { return m_pEmbedObj.get(); } 69 CJS_EmbedObj* GetEmbedObject() const { return m_pEmbedObj.get(); }
70 70
71 static CPDFSDK_PageView* JSGetPageView(IFXJS_Context* cc); 71 static CPDFSDK_PageView* JSGetPageView(IFXJS_Context* cc);
72 static int MsgBox(CPDFDoc_Environment* pApp, 72 static int MsgBox(CPDFDoc_Environment* pApp,
73 CPDFSDK_PageView* pPageView, 73 CPDFSDK_PageView* pPageView,
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 FX_DWORD m_dwTimeOut; 134 FX_DWORD m_dwTimeOut;
135 FX_DWORD m_dwElapse; 135 FX_DWORD m_dwElapse;
136 CJS_Runtime* m_pRuntime; 136 CJS_Runtime* m_pRuntime;
137 CFX_WideString m_swJScript; 137 CFX_WideString m_swJScript;
138 int m_nType; // 0:Interval; 1:TimeOut 138 int m_nType; // 0:Interval; 1:TimeOut
139 139
140 CPDFDoc_Environment* m_pApp; 140 CPDFDoc_Environment* m_pApp;
141 }; 141 };
142 142
143 #endif // FPDFSDK_INCLUDE_JAVASCRIPT_JS_OBJECT_H_ 143 #endif // FPDFSDK_INCLUDE_JAVASCRIPT_JS_OBJECT_H_
OLDNEW
« no previous file with comments | « fpdfsdk/include/javascript/JS_Define.h ('k') | fpdfsdk/include/javascript/JS_Runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698