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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 ASSERT(g_embedderDataSlot == embedderDataSlot); | 130 ASSERT(g_embedderDataSlot == embedderDataSlot); |
131 ASSERT(g_isolate == pIsolate); | 131 ASSERT(g_isolate == pIsolate); |
132 return; | 132 return; |
133 } | 133 } |
134 g_embedderDataSlot = embedderDataSlot; | 134 g_embedderDataSlot = embedderDataSlot; |
135 g_isolate = pIsolate; | 135 g_isolate = pIsolate; |
136 } | 136 } |
137 | 137 |
138 void FXJS_Release() { | 138 void FXJS_Release() { |
139 ASSERT(!g_isolate || g_isolate_ref_count == 0); | 139 ASSERT(!g_isolate || g_isolate_ref_count == 0); |
| 140 delete g_DefaultGlobalObjectTemplate; |
140 g_DefaultGlobalObjectTemplate = nullptr; | 141 g_DefaultGlobalObjectTemplate = nullptr; |
141 g_isolate = nullptr; | 142 g_isolate = nullptr; |
142 | 143 |
143 delete g_arrayBufferAllocator; | 144 delete g_arrayBufferAllocator; |
144 g_arrayBufferAllocator = nullptr; | 145 g_arrayBufferAllocator = nullptr; |
145 } | 146 } |
146 | 147 |
147 bool FXJS_GetIsolate(v8::Isolate** pResultIsolate) { | 148 bool FXJS_GetIsolate(v8::Isolate** pResultIsolate) { |
148 if (g_isolate) { | 149 if (g_isolate) { |
149 *pResultIsolate = g_isolate; | 150 *pResultIsolate = g_isolate; |
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
753 return v8::Local<v8::Array>(); | 754 return v8::Local<v8::Array>(); |
754 v8::Local<v8::Context> context = pIsolate->GetCurrentContext(); | 755 v8::Local<v8::Context> context = pIsolate->GetCurrentContext(); |
755 return v8::Local<v8::Array>::Cast(pValue->ToObject(context).ToLocalChecked()); | 756 return v8::Local<v8::Array>::Cast(pValue->ToObject(context).ToLocalChecked()); |
756 } | 757 } |
757 | 758 |
758 void FXJS_ValueCopy(v8::Local<v8::Value>& pTo, v8::Local<v8::Value> pFrom) { | 759 void FXJS_ValueCopy(v8::Local<v8::Value>& pTo, v8::Local<v8::Value> pFrom) { |
759 pTo = pFrom; | 760 pTo = pFrom; |
760 } | 761 } |
761 | 762 |
762 | 763 |
OLD | NEW |