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 "../../include/javascript/JavaScript.h" | 7 #include "../../include/javascript/JavaScript.h" |
8 #include "../../include/javascript/IJavaScript.h" | 8 #include "../../include/javascript/IJavaScript.h" |
9 #include "../../include/javascript/JS_EventHandler.h" | 9 #include "../../include/javascript/JS_EventHandler.h" |
10 #include "../../include/javascript/JS_Runtime.h" | 10 #include "../../include/javascript/JS_Runtime.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 void CJS_ArrayBufferAllocator::Free(void* data, size_t length) { | 105 void CJS_ArrayBufferAllocator::Free(void* data, size_t length) { |
106 free(data); | 106 free(data); |
107 } | 107 } |
108 | 108 |
109 /* ------------------------------ CJS_Runtime ------------------------------ */ | 109 /* ------------------------------ CJS_Runtime ------------------------------ */ |
110 | 110 |
111 CJS_Runtime::CJS_Runtime(CPDFDoc_Environment * pApp) : | 111 CJS_Runtime::CJS_Runtime(CPDFDoc_Environment * pApp) : |
112 m_pApp(pApp), | 112 m_pApp(pApp), |
113 m_pDocument(NULL), | 113 m_pDocument(NULL), |
114 m_bBlocking(FALSE), | 114 m_bBlocking(FALSE), |
115 m_bRegistered(FALSE), | |
116 m_pFieldEventPath(NULL), | 115 m_pFieldEventPath(NULL), |
117 m_isolate(NULL) | 116 m_isolate(NULL) |
118 { | 117 { |
119 if (m_pApp->GetFormFillInfo()->m_pJsPlatform->version >= 2) { | 118 if (m_pApp->GetFormFillInfo()->m_pJsPlatform->version >= 2) { |
120 m_isolate = reinterpret_cast<v8::Isolate*>(m_pApp->GetFormFillIn
fo()->m_pJsPlatform->m_isolate); | 119 m_isolate = reinterpret_cast<v8::Isolate*>(m_pApp->GetFormFillIn
fo()->m_pJsPlatform->m_isolate); |
121 } | 120 } |
122 if (!m_isolate) { | 121 if (!m_isolate) { |
123 m_pArrayBufferAllocator.reset(new CJS_ArrayBufferAllocator()); | 122 m_pArrayBufferAllocator.reset(new CJS_ArrayBufferAllocator()); |
124 | 123 |
125 v8::Isolate::CreateParams params; | 124 v8::Isolate::CreateParams params; |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 { | 340 { |
342 return v8::Local<v8::Context>::New(m_isolate, m_context); | 341 return v8::Local<v8::Context>::New(m_isolate, m_context); |
343 } | 342 } |
344 | 343 |
345 CFX_WideString ChangeObjName(const CFX_WideString& str) | 344 CFX_WideString ChangeObjName(const CFX_WideString& str) |
346 { | 345 { |
347 CFX_WideString sRet = str; | 346 CFX_WideString sRet = str; |
348 sRet.Replace(L"_", L"."); | 347 sRet.Replace(L"_", L"."); |
349 return sRet; | 348 return sRet; |
350 } | 349 } |
OLD | NEW |