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

Side by Side Diff: fpdfsdk/include/javascript/global.h

Issue 1297723002: CFX_MapByteStringToPtr considered harmful. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Separate reload & delete. Created 5 years, 4 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
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 #ifndef FPDFSDK_INCLUDE_JAVASCRIPT_GLOBAL_H_ 7 #ifndef FPDFSDK_INCLUDE_JAVASCRIPT_GLOBAL_H_
8 #define FPDFSDK_INCLUDE_JAVASCRIPT_GLOBAL_H_ 8 #define FPDFSDK_INCLUDE_JAVASCRIPT_GLOBAL_H_
9 9
10 #include <map>
11
10 #include "JS_Define.h" 12 #include "JS_Define.h"
11 13
12 class CJS_GlobalData; 14 class CJS_GlobalData;
13 class CJS_GlobalVariableArray; 15 class CJS_GlobalVariableArray;
14 class CJS_KeyValue; 16 class CJS_KeyValue;
15 17
16 struct js_global_data { 18 struct js_global_data {
17 js_global_data() { 19 js_global_data() {
18 nType = 0; 20 nType = 0;
19 dData = 0; 21 dData = 0;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 bool bData, 68 bool bData,
67 const CFX_ByteString& sData, 69 const CFX_ByteString& sData,
68 JSObject pData, 70 JSObject pData,
69 bool bDefaultPersistent); 71 bool bDefaultPersistent);
70 72
71 void ObjectToArray(v8::Local<v8::Object> pObj, 73 void ObjectToArray(v8::Local<v8::Object> pObj,
72 CJS_GlobalVariableArray& array); 74 CJS_GlobalVariableArray& array);
73 void PutObjectProperty(v8::Local<v8::Object> obj, CJS_KeyValue* pData); 75 void PutObjectProperty(v8::Local<v8::Object> obj, CJS_KeyValue* pData);
74 76
75 private: 77 private:
76 CFX_MapByteStringToPtr m_mapGlobal; 78 std::map<CFX_ByteString, js_global_data*> m_mapGlobal;
77 CFX_WideString m_sFilePath; 79 CFX_WideString m_sFilePath;
78 CJS_GlobalData* m_pGlobalData; 80 CJS_GlobalData* m_pGlobalData;
79 CPDFDoc_Environment* m_pApp; 81 CPDFDoc_Environment* m_pApp;
80 }; 82 };
81 83
82 class CJS_Global : public CJS_Object { 84 class CJS_Global : public CJS_Object {
83 public: 85 public:
84 CJS_Global(JSFXObject pObject) : CJS_Object(pObject){}; 86 CJS_Global(JSFXObject pObject) : CJS_Object(pObject){};
85 virtual ~CJS_Global(void){}; 87 virtual ~CJS_Global(void){};
86 88
87 virtual FX_BOOL InitInstance(IFXJS_Context* cc); 89 virtual FX_BOOL InitInstance(IFXJS_Context* cc);
88 90
89 DECLARE_SPECIAL_JS_CLASS(CJS_Global); 91 DECLARE_SPECIAL_JS_CLASS(CJS_Global);
90 92
91 JS_SPECIAL_STATIC_METHOD(setPersistent, global_alternate, global); 93 JS_SPECIAL_STATIC_METHOD(setPersistent, global_alternate, global);
92 }; 94 };
93 95
94 #endif // FPDFSDK_INCLUDE_JAVASCRIPT_GLOBAL_H_ 96 #endif // FPDFSDK_INCLUDE_JAVASCRIPT_GLOBAL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698