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 "fpdfsdk/javascript/cjs_runtime.h" | 7 #include "fpdfsdk/javascript/cjs_runtime.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
11 #include "fpdfsdk/include/fsdk_mgr.h" | 11 #include "fpdfsdk/include/fsdk_mgr.h" |
12 #include "fpdfsdk/javascript/Consts.h" | 12 #include "fpdfsdk/javascript/Consts.h" |
13 #include "fpdfsdk/javascript/Document.h" | 13 #include "fpdfsdk/javascript/Document.h" |
14 #include "fpdfsdk/javascript/Field.h" | 14 #include "fpdfsdk/javascript/Field.h" |
15 #include "fpdfsdk/javascript/Icon.h" | 15 #include "fpdfsdk/javascript/Icon.h" |
16 #include "fpdfsdk/javascript/cjs_context.h" | |
17 #include "fpdfsdk/javascript/JS_Define.h" | 16 #include "fpdfsdk/javascript/JS_Define.h" |
18 #include "fpdfsdk/javascript/JS_EventHandler.h" | 17 #include "fpdfsdk/javascript/JS_EventHandler.h" |
19 #include "fpdfsdk/javascript/JS_GlobalData.h" | 18 #include "fpdfsdk/javascript/JS_GlobalData.h" |
20 #include "fpdfsdk/javascript/JS_Object.h" | 19 #include "fpdfsdk/javascript/JS_Object.h" |
21 #include "fpdfsdk/javascript/JS_Value.h" | 20 #include "fpdfsdk/javascript/JS_Value.h" |
22 #include "fpdfsdk/javascript/PublicMethods.h" | 21 #include "fpdfsdk/javascript/PublicMethods.h" |
23 #include "fpdfsdk/javascript/app.h" | 22 #include "fpdfsdk/javascript/app.h" |
| 23 #include "fpdfsdk/javascript/cjs_context.h" |
24 #include "fpdfsdk/javascript/color.h" | 24 #include "fpdfsdk/javascript/color.h" |
25 #include "fpdfsdk/javascript/console.h" | 25 #include "fpdfsdk/javascript/console.h" |
26 #include "fpdfsdk/javascript/event.h" | 26 #include "fpdfsdk/javascript/event.h" |
27 #include "fpdfsdk/javascript/global.h" | 27 #include "fpdfsdk/javascript/global.h" |
28 #include "fpdfsdk/javascript/report.h" | 28 #include "fpdfsdk/javascript/report.h" |
29 #include "fpdfsdk/javascript/util.h" | 29 #include "fpdfsdk/javascript/util.h" |
30 #include "third_party/base/stl_util.h" | 30 #include "third_party/base/stl_util.h" |
31 | 31 |
32 #ifdef PDF_ENABLE_XFA | 32 #ifdef PDF_ENABLE_XFA |
33 #include "fpdfsdk/include/fpdfxfa/fpdfxfa_app.h" | 33 #include "fpdfsdk/fpdfxfa/include/fpdfxfa_app.h" |
34 #include "xfa/fxjse/value.h" | 34 #include "xfa/fxjse/value.h" |
35 #endif // PDF_ENABLE_XFA | 35 #endif // PDF_ENABLE_XFA |
36 | 36 |
37 // static | 37 // static |
38 void IJS_Runtime::Initialize(unsigned int slot, void* isolate) { | 38 void IJS_Runtime::Initialize(unsigned int slot, void* isolate) { |
39 FXJS_Initialize(slot, reinterpret_cast<v8::Isolate*>(isolate)); | 39 FXJS_Initialize(slot, reinterpret_cast<v8::Isolate*>(isolate)); |
40 } | 40 } |
41 | 41 |
42 // static | 42 // static |
43 IJS_Runtime* IJS_Runtime::Create(CPDFDoc_Environment* pEnv) { | 43 IJS_Runtime* IJS_Runtime::Create(CPDFDoc_Environment* pEnv) { |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 #endif | 324 #endif |
325 void CJS_Runtime::AddObserver(Observer* observer) { | 325 void CJS_Runtime::AddObserver(Observer* observer) { |
326 ASSERT(!pdfium::ContainsKey(m_observers, observer)); | 326 ASSERT(!pdfium::ContainsKey(m_observers, observer)); |
327 m_observers.insert(observer); | 327 m_observers.insert(observer); |
328 } | 328 } |
329 | 329 |
330 void CJS_Runtime::RemoveObserver(Observer* observer) { | 330 void CJS_Runtime::RemoveObserver(Observer* observer) { |
331 ASSERT(pdfium::ContainsKey(m_observers, observer)); | 331 ASSERT(pdfium::ContainsKey(m_observers, observer)); |
332 m_observers.erase(observer); | 332 m_observers.erase(observer); |
333 } | 333 } |
OLD | NEW |