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

Side by Side Diff: fpdfsdk/src/javascript/JS_Runtime.cpp

Issue 1652873003: Pdfium does not create isolate when it runs in chromium (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 4 years, 10 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 | « fpdfsdk/src/fpdfxfa/fpdfxfa_app.cpp ('k') | fpdfsdk/src/jsapi/fxjs_v8.cpp » ('j') | 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 "JS_Runtime.h" 7 #include "JS_Runtime.h"
8 8
9 #include "Consts.h" 9 #include "Consts.h"
10 #include "Document.h" 10 #include "Document.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 } 114 }
115 115
116 CJS_Runtime::~CJS_Runtime() { 116 CJS_Runtime::~CJS_Runtime() {
117 for (auto* obs : m_observers) 117 for (auto* obs : m_observers)
118 obs->OnDestroyed(); 118 obs->OnDestroyed();
119 119
120 for (int i = 0, sz = m_ContextArray.GetSize(); i < sz; i++) 120 for (int i = 0, sz = m_ContextArray.GetSize(); i < sz; i++)
121 delete m_ContextArray.GetAt(i); 121 delete m_ContextArray.GetAt(i);
122 122
123 m_ContextArray.RemoveAll(); 123 m_ContextArray.RemoveAll();
124 #ifndef PDF_ENABLE_XFA
125 FXJS_ReleaseRuntime(GetIsolate(), &m_context, &m_StaticObjects); 124 FXJS_ReleaseRuntime(GetIsolate(), &m_context, &m_StaticObjects);
126 #endif
127 125
128 m_pApp = NULL; 126 m_pApp = NULL;
129 m_pDocument = NULL; 127 m_pDocument = NULL;
130 m_context.Reset(); 128 m_context.Reset();
131 129
132 if (m_isolateManaged) 130 if (m_isolateManaged)
133 m_isolate->Dispose(); 131 m_isolate->Dispose();
134 } 132 }
135 133
136 void CJS_Runtime::DefineJSObjects() { 134 void CJS_Runtime::DefineJSObjects() {
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 #endif 326 #endif
329 void CJS_Runtime::AddObserver(Observer* observer) { 327 void CJS_Runtime::AddObserver(Observer* observer) {
330 ASSERT(!pdfium::ContainsKey(m_observers, observer)); 328 ASSERT(!pdfium::ContainsKey(m_observers, observer));
331 m_observers.insert(observer); 329 m_observers.insert(observer);
332 } 330 }
333 331
334 void CJS_Runtime::RemoveObserver(Observer* observer) { 332 void CJS_Runtime::RemoveObserver(Observer* observer) {
335 ASSERT(pdfium::ContainsKey(m_observers, observer)); 333 ASSERT(pdfium::ContainsKey(m_observers, observer));
336 m_observers.erase(observer); 334 m_observers.erase(observer);
337 } 335 }
OLDNEW
« no previous file with comments | « fpdfsdk/src/fpdfxfa/fpdfxfa_app.cpp ('k') | fpdfsdk/src/jsapi/fxjs_v8.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698