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 "JS_Runtime.h" | 7 #include "JS_Runtime.h" |
8 | 8 |
9 #include "../../../xfa/src/fxjse/src/value.h" | 9 #include "../../../xfa/src/fxjse/src/value.h" |
10 #include "../../include/fpdfxfa/fpdfxfa_app.h" | 10 #include "../../include/fpdfxfa/fpdfxfa_app.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 #include "console.h" | 26 #include "console.h" |
27 #include "event.h" | 27 #include "event.h" |
28 #include "global.h" | 28 #include "global.h" |
29 #include "report.h" | 29 #include "report.h" |
30 #include "util.h" | 30 #include "util.h" |
31 | 31 |
32 /* ------------------------------ CJS_Runtime ------------------------------ */ | 32 /* ------------------------------ CJS_Runtime ------------------------------ */ |
33 v8::Global<v8::ObjectTemplate>& _getGlobalObjectTemplate(v8::Isolate* pIsolate); | 33 v8::Global<v8::ObjectTemplate>& _getGlobalObjectTemplate(v8::Isolate* pIsolate); |
34 | 34 |
35 // static | 35 // static |
| 36 void IJS_Runtime::Initialize(unsigned int slot, void* isolate) { |
| 37 FXJS_Initialize(slot, reinterpret_cast<v8::Isolate*>(isolate)); |
| 38 } |
| 39 |
| 40 // static |
36 IJS_Runtime* IJS_Runtime::Create(CPDFDoc_Environment* pEnv) { | 41 IJS_Runtime* IJS_Runtime::Create(CPDFDoc_Environment* pEnv) { |
37 return new CJS_Runtime(pEnv); | 42 return new CJS_Runtime(pEnv); |
38 } | 43 } |
39 | 44 |
40 // static | 45 // static |
41 CJS_Runtime* CJS_Runtime::FromContext(const IJS_Context* cc) { | 46 CJS_Runtime* CJS_Runtime::FromContext(const IJS_Context* cc) { |
42 const CJS_Context* pContext = static_cast<const CJS_Context*>(cc); | 47 const CJS_Context* pContext = static_cast<const CJS_Context*>(cc); |
43 return pContext->GetJSRuntime(); | 48 return pContext->GetJSRuntime(); |
44 } | 49 } |
45 | 50 |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 | 280 |
276 void CJS_Runtime::AddObserver(Observer* observer) { | 281 void CJS_Runtime::AddObserver(Observer* observer) { |
277 ASSERT(m_observers.find(observer) == m_observers.end()); | 282 ASSERT(m_observers.find(observer) == m_observers.end()); |
278 m_observers.insert(observer); | 283 m_observers.insert(observer); |
279 } | 284 } |
280 | 285 |
281 void CJS_Runtime::RemoveObserver(Observer* observer) { | 286 void CJS_Runtime::RemoveObserver(Observer* observer) { |
282 ASSERT(m_observers.find(observer) != m_observers.end()); | 287 ASSERT(m_observers.find(observer) != m_observers.end()); |
283 m_observers.erase(observer); | 288 m_observers.erase(observer); |
284 } | 289 } |
OLD | NEW |