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

Unified Diff: fpdfsdk/src/jsapi/fxjs_v8.cpp

Issue 1430213002: Remove CFX_PtrArray usage in fpdfsdk. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: rebase Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/src/javascript/Field.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/jsapi/fxjs_v8.cpp
diff --git a/fpdfsdk/src/jsapi/fxjs_v8.cpp b/fpdfsdk/src/jsapi/fxjs_v8.cpp
index 0822531da60c71e900940b84afe03ea51375dc0d..0c58a1b01f610ce68259ee4ef1e0a129bc6d9604 100644
--- a/fpdfsdk/src/jsapi/fxjs_v8.cpp
+++ b/fpdfsdk/src/jsapi/fxjs_v8.cpp
@@ -30,24 +30,24 @@ static v8::Global<v8::ObjectTemplate>* g_DefaultGlobalObjectTemplate = nullptr;
class CFXJS_PerObjectData {
public:
- CFXJS_PerObjectData(int nObjDefID)
+ explicit CFXJS_PerObjectData(int nObjDefID)
: m_ObjDefID(nObjDefID), m_pPrivate(nullptr) {}
- int m_ObjDefID;
+ const int m_ObjDefID;
void* m_pPrivate;
};
class CFXJS_ObjDefinition {
public:
static int MaxID(v8::Isolate* pIsolate) {
- return static_cast<int>(
- FXJS_PerIsolateData::Get(pIsolate)->m_ObjectDefnArray.GetSize());
+ return FXJS_PerIsolateData::Get(pIsolate)->m_ObjectDefnArray.size();
}
+
static CFXJS_ObjDefinition* ForID(v8::Isolate* pIsolate, int id) {
// Note: GetAt() halts if out-of-range even in release builds.
- return static_cast<CFXJS_ObjDefinition*>(
- FXJS_PerIsolateData::Get(pIsolate)->m_ObjectDefnArray.GetAt(id));
+ return FXJS_PerIsolateData::Get(pIsolate)->m_ObjectDefnArray[id];
}
+
CFXJS_ObjDefinition(v8::Isolate* isolate,
const wchar_t* sObjName,
FXJSOBJTYPE eObjType,
@@ -71,8 +71,8 @@ class CFXJS_ObjDefinition {
int AssignID() {
FXJS_PerIsolateData* pData = FXJS_PerIsolateData::Get(m_pIsolate);
- pData->m_ObjectDefnArray.Add(this);
- return pData->m_ObjectDefnArray.GetSize() - 1;
+ pData->m_ObjectDefnArray.push_back(this);
+ return pData->m_ObjectDefnArray.size() - 1;
}
v8::Local<v8::ObjectTemplate> GetInstanceTemplate() {
@@ -553,8 +553,7 @@ v8::Local<v8::Array> FXJS_GetObjectElementNames(v8::Isolate* pIsolate,
void FXJS_PutObjectString(v8::Isolate* pIsolate,
v8::Local<v8::Object> pObj,
const wchar_t* PropertyName,
- const wchar_t* sValue) // VT_string
-{
+ const wchar_t* sValue) {
if (pObj.IsEmpty())
return;
pObj->Set(pIsolate->GetCurrentContext(),
« no previous file with comments | « fpdfsdk/src/javascript/Field.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698