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 "../../include/jsapi/fxjs_v8.h" | 7 #include "../../include/jsapi/fxjs_v8.h" |
8 | 8 |
9 #include "../../../core/include/fxcrt/fx_basic.h" | 9 #include "../../../core/include/fxcrt/fx_basic.h" |
10 | 10 |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 ASSERT(g_embedderDataSlot == embedderDataSlot); | 138 ASSERT(g_embedderDataSlot == embedderDataSlot); |
139 ASSERT(g_isolate == pIsolate); | 139 ASSERT(g_isolate == pIsolate); |
140 return; | 140 return; |
141 } | 141 } |
142 g_embedderDataSlot = embedderDataSlot; | 142 g_embedderDataSlot = embedderDataSlot; |
143 g_isolate = pIsolate; | 143 g_isolate = pIsolate; |
144 } | 144 } |
145 | 145 |
146 void FXJS_Release() { | 146 void FXJS_Release() { |
147 ASSERT(!g_isolate || g_isolate_ref_count == 0); | 147 ASSERT(!g_isolate || g_isolate_ref_count == 0); |
| 148 delete g_DefaultGlobalObjectTemplate; |
148 g_DefaultGlobalObjectTemplate = nullptr; | 149 g_DefaultGlobalObjectTemplate = nullptr; |
149 g_isolate = nullptr; | 150 g_isolate = nullptr; |
150 | 151 |
151 delete g_arrayBufferAllocator; | 152 delete g_arrayBufferAllocator; |
152 g_arrayBufferAllocator = nullptr; | 153 g_arrayBufferAllocator = nullptr; |
153 } | 154 } |
154 | 155 |
155 bool FXJS_GetIsolate(v8::Isolate** pResultIsolate) { | 156 bool FXJS_GetIsolate(v8::Isolate** pResultIsolate) { |
156 if (g_isolate) { | 157 if (g_isolate) { |
157 *pResultIsolate = g_isolate; | 158 *pResultIsolate = g_isolate; |
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
777 return v8::Local<v8::Array>(); | 778 return v8::Local<v8::Array>(); |
778 v8::Local<v8::Context> context = pIsolate->GetCurrentContext(); | 779 v8::Local<v8::Context> context = pIsolate->GetCurrentContext(); |
779 return v8::Local<v8::Array>::Cast(pValue->ToObject(context).ToLocalChecked()); | 780 return v8::Local<v8::Array>::Cast(pValue->ToObject(context).ToLocalChecked()); |
780 } | 781 } |
781 | 782 |
782 void FXJS_ValueCopy(v8::Local<v8::Value>& pTo, v8::Local<v8::Value> pFrom) { | 783 void FXJS_ValueCopy(v8::Local<v8::Value>& pTo, v8::Local<v8::Value> pFrom) { |
783 pTo = pFrom; | 784 pTo = pFrom; |
784 } | 785 } |
785 | 786 |
786 | 787 |
OLD | NEW |