| OLD | NEW |
| 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 // FXJS_V8 is a layer that makes it easier to define native objects in V8, but | 7 // FXJS_V8 is a layer that makes it easier to define native objects in V8, but |
| 8 // has no knowledge of PDF-specific native objects. It could in theory be used | 8 // has no knowledge of PDF-specific native objects. It could in theory be used |
| 9 // to implement other sets of native objects. | 9 // to implement other sets of native objects. |
| 10 | 10 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 | 90 |
| 91 private: | 91 private: |
| 92 MapType m_map; | 92 MapType m_map; |
| 93 }; | 93 }; |
| 94 | 94 |
| 95 class FXJS_PerIsolateData { | 95 class FXJS_PerIsolateData { |
| 96 public: | 96 public: |
| 97 static void SetUp(v8::Isolate* pIsolate); | 97 static void SetUp(v8::Isolate* pIsolate); |
| 98 static FXJS_PerIsolateData* Get(v8::Isolate* pIsolate); | 98 static FXJS_PerIsolateData* Get(v8::Isolate* pIsolate); |
| 99 void CreateDynamicObjsMap(v8::Isolate* pIsolate) { | 99 void CreateDynamicObjsMap(v8::Isolate* pIsolate) { |
| 100 m_pDynamicObjsMap = new V8TemplateMap(pIsolate); | 100 if (!m_pDynamicObjsMap) |
| 101 m_pDynamicObjsMap = new V8TemplateMap(pIsolate); |
| 101 } | 102 } |
| 102 void ReleaseDynamicObjsMap() { | 103 void ReleaseDynamicObjsMap() { |
| 103 delete m_pDynamicObjsMap; | 104 delete m_pDynamicObjsMap; |
| 104 m_pDynamicObjsMap = nullptr; | 105 m_pDynamicObjsMap = nullptr; |
| 105 } | 106 } |
| 106 | 107 |
| 107 std::vector<CFXJS_ObjDefinition*> m_ObjectDefnArray; | 108 std::vector<CFXJS_ObjDefinition*> m_ObjectDefnArray; |
| 108 #ifdef PDF_ENABLE_XFA | 109 #ifdef PDF_ENABLE_XFA |
| 109 CFXJSE_RuntimeData* m_pFXJSERuntimeData; | 110 CFXJSE_RuntimeData* m_pFXJSERuntimeData; |
| 110 #endif // PDF_ENABLE_XFA | 111 #endif // PDF_ENABLE_XFA |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 double FXJS_ToNumber(v8::Isolate* pIsolate, v8::Local<v8::Value> pValue); | 296 double FXJS_ToNumber(v8::Isolate* pIsolate, v8::Local<v8::Value> pValue); |
| 296 v8::Local<v8::Object> FXJS_ToObject(v8::Isolate* pIsolate, | 297 v8::Local<v8::Object> FXJS_ToObject(v8::Isolate* pIsolate, |
| 297 v8::Local<v8::Value> pValue); | 298 v8::Local<v8::Value> pValue); |
| 298 CFX_WideString FXJS_ToString(v8::Isolate* pIsolate, | 299 CFX_WideString FXJS_ToString(v8::Isolate* pIsolate, |
| 299 v8::Local<v8::Value> pValue); | 300 v8::Local<v8::Value> pValue); |
| 300 v8::Local<v8::Array> FXJS_ToArray(v8::Isolate* pIsolate, | 301 v8::Local<v8::Array> FXJS_ToArray(v8::Isolate* pIsolate, |
| 301 v8::Local<v8::Value> pValue); | 302 v8::Local<v8::Value> pValue); |
| 302 void FXJS_ValueCopy(v8::Local<v8::Value>& pTo, v8::Local<v8::Value> pFrom); | 303 void FXJS_ValueCopy(v8::Local<v8::Value>& pTo, v8::Local<v8::Value> pFrom); |
| 303 | 304 |
| 304 #endif // FPDFSDK_INCLUDE_JSAPI_FXJS_V8_H_ | 305 #endif // FPDFSDK_INCLUDE_JSAPI_FXJS_V8_H_ |
| OLD | NEW |