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/JS_Runtime.h" | 7 #include "fpdfsdk/javascript/JS_Runtime.h" |
8 | 8 |
9 #include "fpdfsdk/include/fsdk_mgr.h" // For CPDFDoc_Environment. | 9 #include "fpdfsdk/include/fsdk_mgr.h" // For CPDFDoc_Environment. |
10 #include "fpdfsdk/include/javascript/IJavaScript.h" | 10 #include "fpdfsdk/include/javascript/IJavaScript.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 #include "fpdfsdk/javascript/color.h" | 23 #include "fpdfsdk/javascript/color.h" |
24 #include "fpdfsdk/javascript/console.h" | 24 #include "fpdfsdk/javascript/console.h" |
25 #include "fpdfsdk/javascript/event.h" | 25 #include "fpdfsdk/javascript/event.h" |
26 #include "fpdfsdk/javascript/global.h" | 26 #include "fpdfsdk/javascript/global.h" |
27 #include "fpdfsdk/javascript/report.h" | 27 #include "fpdfsdk/javascript/report.h" |
28 #include "fpdfsdk/javascript/util.h" | 28 #include "fpdfsdk/javascript/util.h" |
29 #include "third_party/base/stl_util.h" | 29 #include "third_party/base/stl_util.h" |
30 | 30 |
31 #ifdef PDF_ENABLE_XFA | 31 #ifdef PDF_ENABLE_XFA |
32 #include "fpdfsdk/include/fpdfxfa/fpdfxfa_app.h" | 32 #include "fpdfsdk/include/fpdfxfa/fpdfxfa_app.h" |
33 #include "xfa/src/fxjse/value.h" | 33 #include "xfa/fxjse/value.h" |
34 #endif // PDF_ENABLE_XFA | 34 #endif // PDF_ENABLE_XFA |
35 | 35 |
36 // static | 36 // static |
37 void IJS_Runtime::Initialize(unsigned int slot, void* isolate) { | 37 void IJS_Runtime::Initialize(unsigned int slot, void* isolate) { |
38 FXJS_Initialize(slot, reinterpret_cast<v8::Isolate*>(isolate)); | 38 FXJS_Initialize(slot, reinterpret_cast<v8::Isolate*>(isolate)); |
39 } | 39 } |
40 | 40 |
41 // static | 41 // static |
42 IJS_Runtime* IJS_Runtime::Create(CPDFDoc_Environment* pEnv) { | 42 IJS_Runtime* IJS_Runtime::Create(CPDFDoc_Environment* pEnv) { |
43 return new CJS_Runtime(pEnv); | 43 return new CJS_Runtime(pEnv); |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 #endif | 336 #endif |
337 void CJS_Runtime::AddObserver(Observer* observer) { | 337 void CJS_Runtime::AddObserver(Observer* observer) { |
338 ASSERT(!pdfium::ContainsKey(m_observers, observer)); | 338 ASSERT(!pdfium::ContainsKey(m_observers, observer)); |
339 m_observers.insert(observer); | 339 m_observers.insert(observer); |
340 } | 340 } |
341 | 341 |
342 void CJS_Runtime::RemoveObserver(Observer* observer) { | 342 void CJS_Runtime::RemoveObserver(Observer* observer) { |
343 ASSERT(pdfium::ContainsKey(m_observers, observer)); | 343 ASSERT(pdfium::ContainsKey(m_observers, observer)); |
344 m_observers.erase(observer); | 344 m_observers.erase(observer); |
345 } | 345 } |
OLD | NEW |