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 #include "fpdfsdk/javascript/JS_Object.h" | 7 #include "fpdfsdk/javascript/JS_Object.h" |
8 | 8 |
9 #include "fpdfsdk/include/fsdk_mgr.h" | 9 #include "fpdfsdk/include/fsdk_mgr.h" |
10 #include "fpdfsdk/javascript/JS_Define.h" | 10 #include "fpdfsdk/javascript/JS_Define.h" |
11 #include "fpdfsdk/javascript/cjs_context.h" | 11 #include "fpdfsdk/javascript/cjs_context.h" |
12 | 12 |
13 CJS_EmbedObj::CJS_EmbedObj(CJS_Object* pJSObject) : m_pJSObject(pJSObject) {} | 13 CJS_EmbedObj::CJS_EmbedObj(CJS_Object* pJSObject) : m_pJSObject(pJSObject) {} |
14 | 14 |
15 CJS_EmbedObj::~CJS_EmbedObj() { | 15 CJS_EmbedObj::~CJS_EmbedObj() { |
16 m_pJSObject = nullptr; | |
17 } | 16 } |
18 | 17 |
19 void FreeObject(const v8::WeakCallbackInfo<CJS_Object>& data) { | 18 void FreeObject(const v8::WeakCallbackInfo<CJS_Object>& data) { |
20 CJS_Object* pJSObj = data.GetParameter(); | 19 CJS_Object* pJSObj = data.GetParameter(); |
21 pJSObj->ExitInstance(); | 20 pJSObj->ExitInstance(); |
22 delete pJSObj; | 21 delete pJSObj; |
23 FXJS_FreePrivate(data.GetInternalField(0)); | 22 FXJS_FreePrivate(data.GetInternalField(0)); |
24 } | 23 } |
25 | 24 |
26 void DisposeObject(const v8::WeakCallbackInfo<CJS_Object>& data) { | 25 void DisposeObject(const v8::WeakCallbackInfo<CJS_Object>& data) { |
(...skipping 14 matching lines...) Expand all Loading... |
41 v8::WeakCallbackType::kInternalFields); | 40 v8::WeakCallbackType::kInternalFields); |
42 } | 41 } |
43 | 42 |
44 void CJS_Object::Dispose() { | 43 void CJS_Object::Dispose() { |
45 m_pV8Object.Reset(); | 44 m_pV8Object.Reset(); |
46 } | 45 } |
47 | 46 |
48 void CJS_Object::InitInstance(IJS_Runtime* pIRuntime) {} | 47 void CJS_Object::InitInstance(IJS_Runtime* pIRuntime) {} |
49 | 48 |
50 void CJS_Object::ExitInstance() {} | 49 void CJS_Object::ExitInstance() {} |
OLD | NEW |