summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/jsapi
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-11-09 22:41:21 -0800
committerLei Zhang <thestig@chromium.org>2015-11-09 22:41:21 -0800
commit8deeacd23872ecc132a0a678e344a018b5114a3a (patch)
treeeba48ec898f8b6454f4e29caa4bf0a6f75519056 /fpdfsdk/src/jsapi
parent6d9979dc685e3b67b0a6d9946376e026d75d3e47 (diff)
downloadpdfium-8deeacd23872ecc132a0a678e344a018b5114a3a.tar.xz
Remove CFX_PtrArray usage in fpdfsdk.
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1430213002 .
Diffstat (limited to 'fpdfsdk/src/jsapi')
-rw-r--r--fpdfsdk/src/jsapi/fxjs_v8.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/fpdfsdk/src/jsapi/fxjs_v8.cpp b/fpdfsdk/src/jsapi/fxjs_v8.cpp
index 0822531da6..0c58a1b01f 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(),