Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Side by Side Diff: fpdfsdk/javascript/JS_GlobalData.cpp

Issue 2034253003: Fix more code which has shadow variables (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: address comments and style fix Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « fpdfsdk/javascript/JS_GlobalData.h ('k') | xfa/fwl/basewidget/fwl_listboximp.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 CJS_KeyValue* pNewObjData = new CJS_KeyValue; 54 CJS_KeyValue* pNewObjData = new CJS_KeyValue;
55 pNewObjData->sKey = pOldObjData->sKey; 55 pNewObjData->sKey = pOldObjData->sKey;
56 pNewObjData->nType = pOldObjData->nType; 56 pNewObjData->nType = pOldObjData->nType;
57 Add(pNewObjData); 57 Add(pNewObjData);
58 } break; 58 } break;
59 } 59 }
60 } 60 }
61 } 61 }
62 62
63 void CJS_GlobalVariableArray::Add(CJS_KeyValue* p) { 63 void CJS_GlobalVariableArray::Add(CJS_KeyValue* p) {
64 array.Add(p); 64 m_Array.Add(p);
65 } 65 }
66 66
67 int CJS_GlobalVariableArray::Count() const { 67 int CJS_GlobalVariableArray::Count() const {
68 return array.GetSize(); 68 return m_Array.GetSize();
69 } 69 }
70 70
71 CJS_KeyValue* CJS_GlobalVariableArray::GetAt(int index) const { 71 CJS_KeyValue* CJS_GlobalVariableArray::GetAt(int index) const {
72 return array.GetAt(index); 72 return m_Array.GetAt(index);
73 } 73 }
74 74
75 void CJS_GlobalVariableArray::Empty() { 75 void CJS_GlobalVariableArray::Empty() {
76 for (int i = 0, sz = array.GetSize(); i < sz; i++) 76 for (int i = 0, sz = m_Array.GetSize(); i < sz; i++)
77 delete array.GetAt(i); 77 delete m_Array.GetAt(i);
78 array.RemoveAll(); 78 m_Array.RemoveAll();
79 } 79 }
80 80
81 #define READER_JS_GLOBALDATA_FILENAME L"Reader_JsGlobal.Data" 81 #define READER_JS_GLOBALDATA_FILENAME L"Reader_JsGlobal.Data"
82 #define PHANTOM_JS_GLOBALDATA_FILENAME L"Phantom_JsGlobal.Data" 82 #define PHANTOM_JS_GLOBALDATA_FILENAME L"Phantom_JsGlobal.Data"
83 #define SDK_JS_GLOBALDATA_FILENAME L"SDK_JsGlobal.Data" 83 #define SDK_JS_GLOBALDATA_FILENAME L"SDK_JsGlobal.Data"
84 84
85 static const uint8_t JS_RC4KEY[] = { 85 static const uint8_t JS_RC4KEY[] = {
86 0x19, 0xa8, 0xe8, 0x01, 0xf6, 0xa8, 0xb6, 0x4d, 0x82, 0x04, 0x45, 0x6d, 86 0x19, 0xa8, 0xe8, 0x01, 0xf6, 0xa8, 0xb6, 0x4d, 0x82, 0x04, 0x45, 0x6d,
87 0xb4, 0xcf, 0xd7, 0x77, 0x67, 0xf9, 0x75, 0x9f, 0xf0, 0xe0, 0x1e, 0x51, 87 0xb4, 0xcf, 0xd7, 0x77, 0x67, 0xf9, 0x75, 0x9f, 0xf0, 0xe0, 0x1e, 0x51,
88 0xee, 0x46, 0xfd, 0x0b, 0xc9, 0x93, 0x25, 0x55, 0x4a, 0xee, 0xe0, 0x16, 88 0xee, 0x46, 0xfd, 0x0b, 0xc9, 0x93, 0x25, 0x55, 0x4a, 0xee, 0xe0, 0x16,
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 case JS_GLOBALDATA_TYPE_NULL: { 446 case JS_GLOBALDATA_TYPE_NULL: {
447 uint32_t dwNameLen = (uint32_t)name.GetLength(); 447 uint32_t dwNameLen = (uint32_t)name.GetLength();
448 sData.AppendBlock(&dwNameLen, sizeof(uint32_t)); 448 sData.AppendBlock(&dwNameLen, sizeof(uint32_t));
449 sData.AppendString(name); 449 sData.AppendString(name);
450 sData.AppendBlock(&wType, sizeof(uint32_t)); 450 sData.AppendBlock(&wType, sizeof(uint32_t));
451 } break; 451 } break;
452 default: 452 default:
453 break; 453 break;
454 } 454 }
455 } 455 }
OLDNEW
« no previous file with comments | « fpdfsdk/javascript/JS_GlobalData.h ('k') | xfa/fwl/basewidget/fwl_listboximp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698