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

Side by Side Diff: fpdfsdk/src/jsapi/fxjs_v8.cpp

Issue 1391843005: Merge to XFA: Fix a leak with g_DefaultGlobalObjectTemplate. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 2 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 | « no previous file | no next file » | 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 #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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698