| 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_GlobalData.h" | 7 #include "fpdfsdk/javascript/JS_GlobalData.h" |
| 8 | 8 |
| 9 #include "core/fdrm/crypto/include/fx_crypt.h" | 9 #include "core/fdrm/crypto/include/fx_crypt.h" |
| 10 #include "third_party/base/stl_util.h" | 10 #include "third_party/base/stl_util.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 sPropName->TrimLeft(); | 33 sPropName->TrimLeft(); |
| 34 sPropName->TrimRight(); | 34 sPropName->TrimRight(); |
| 35 return sPropName->GetLength() != 0; | 35 return sPropName->GetLength() != 0; |
| 36 } | 36 } |
| 37 | 37 |
| 38 CJS_GlobalData* g_pInstance = nullptr; | 38 CJS_GlobalData* g_pInstance = nullptr; |
| 39 | 39 |
| 40 } // namespace | 40 } // namespace |
| 41 | 41 |
| 42 // static | 42 // static |
| 43 CJS_GlobalData* CJS_GlobalData::GetRetainedInstance(CPDFDoc_Environment* pApp) { | 43 CJS_GlobalData* CJS_GlobalData::GetRetainedInstance(CPDFSDK_Environment* pApp) { |
| 44 if (!g_pInstance) { | 44 if (!g_pInstance) { |
| 45 g_pInstance = new CJS_GlobalData(); | 45 g_pInstance = new CJS_GlobalData(); |
| 46 } | 46 } |
| 47 ++g_pInstance->m_RefCount; | 47 ++g_pInstance->m_RefCount; |
| 48 return g_pInstance; | 48 return g_pInstance; |
| 49 } | 49 } |
| 50 | 50 |
| 51 void CJS_GlobalData::Release() { | 51 void CJS_GlobalData::Release() { |
| 52 if (!--m_RefCount) { | 52 if (!--m_RefCount) { |
| 53 delete g_pInstance; | 53 delete g_pInstance; |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 case JS_GlobalDataType::NULLOBJ: { | 385 case JS_GlobalDataType::NULLOBJ: { |
| 386 uint32_t dwNameLen = (uint32_t)name.GetLength(); | 386 uint32_t dwNameLen = (uint32_t)name.GetLength(); |
| 387 sData.AppendBlock(&dwNameLen, sizeof(uint32_t)); | 387 sData.AppendBlock(&dwNameLen, sizeof(uint32_t)); |
| 388 sData.AppendString(name); | 388 sData.AppendString(name); |
| 389 sData.AppendBlock(&pData->nType, sizeof(uint32_t)); | 389 sData.AppendBlock(&pData->nType, sizeof(uint32_t)); |
| 390 } break; | 390 } break; |
| 391 default: | 391 default: |
| 392 break; | 392 break; |
| 393 } | 393 } |
| 394 } | 394 } |
| OLD | NEW |