| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 { | 56 { |
| 57 JS_Release(); | 57 JS_Release(); |
| 58 ReleaseGlobalData(); | 58 ReleaseGlobalData(); |
| 59 m_bInit = FALSE; | 59 m_bInit = FALSE; |
| 60 } | 60 } |
| 61 } | 61 } |
| 62 } | 62 } |
| 63 | 63 |
| 64 void CJS_RuntimeFactory::Dele
teJSRuntime(IFXJS_Runtime* pRuntime) | 64 void CJS_RuntimeFactory::Dele
teJSRuntime(IFXJS_Runtime* pRuntime) |
| 65 { | 65 { |
| 66 » if(pRuntime) | 66 delete (CJS_Runtime*)pRuntime; |
| 67 » » delete (CJS_Runtime*)pRuntime; | |
| 68 } | 67 } |
| 69 | 68 |
| 70 CJS_GlobalData* CJS_RuntimeFactory::NewGlobalData(CPDFDoc_Environment* pApp) | 69 CJS_GlobalData* CJS_RuntimeFactory::NewGlobalData(CPDFDoc_Environment* pApp) |
| 71 { | 70 { |
| 72 if (m_pGlobalData) | 71 if (m_pGlobalData) |
| 73 { | 72 { |
| 74 m_nGlobalDataCount++; | 73 m_nGlobalDataCount++; |
| 75 return m_pGlobalData; | 74 return m_pGlobalData; |
| 76 } | 75 } |
| 77 else | 76 else |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 v8::Local<v8::Context> context = | 393 v8::Local<v8::Context> context = |
| 395 v8::Local<v8::Context>::New(pIsolate, m_context); | 394 v8::Local<v8::Context>::New(pIsolate, m_context); |
| 396 v8::Context::Scope context_scope(context); | 395 v8::Context::Scope context_scope(context); |
| 397 | 396 |
| 398 //v8::Local<v8::Context> tmpCotext = v8::Local<v8::Context>::New(GetIsol
ate(), m_context); | 397 //v8::Local<v8::Context> tmpCotext = v8::Local<v8::Context>::New(GetIsol
ate(), m_context); |
| 399 v8::Local<v8::Value> propvalue = v8::Local<v8::Value>::New(GetIsolate(),
((CFXJSE_Value*)hValue)->DirectGetValue()); | 398 v8::Local<v8::Value> propvalue = v8::Local<v8::Value>::New(GetIsolate(),
((CFXJSE_Value*)hValue)->DirectGetValue()); |
| 400 context->Global()->Set(v8::String::NewFromUtf8(pIsolate, name, v8::Strin
g::kNormalString, utf8Name.GetLength()), propvalue); | 399 context->Global()->Set(v8::String::NewFromUtf8(pIsolate, name, v8::Strin
g::kNormalString, utf8Name.GetLength()), propvalue); |
| 401 | 400 |
| 402 return TRUE; | 401 return TRUE; |
| 403 } | 402 } |
| OLD | NEW |