diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-04-17 13:57:46 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-04-17 13:57:46 -0700 |
commit | 48606843d54c5f870d69627afedd574b58d65b3e (patch) | |
tree | b8c8fe92e99f2deea542611dfb21e94a2c06541d /fpdfsdk/src/jsapi/fxjs_v8.cpp | |
parent | 916228365f7f03a51e5fb0e4bab03fa708b107c5 (diff) | |
download | pdfium-48606843d54c5f870d69627afedd574b58d65b3e.tar.xz |
Replace FX_NEW with new, remove tests from fpdfsdk
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1089823004
Diffstat (limited to 'fpdfsdk/src/jsapi/fxjs_v8.cpp')
-rw-r--r-- | fpdfsdk/src/jsapi/fxjs_v8.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/fpdfsdk/src/jsapi/fxjs_v8.cpp b/fpdfsdk/src/jsapi/fxjs_v8.cpp index fdac40d470..5a77713fb4 100644 --- a/fpdfsdk/src/jsapi/fxjs_v8.cpp +++ b/fpdfsdk/src/jsapi/fxjs_v8.cpp @@ -80,12 +80,12 @@ int JS_DefineObj(IJS_Runtime* pJSRuntime, const wchar_t* sObjName, FXJSOBJTYPE e v8::Isolate::Scope isolate_scope(isolate); v8::HandleScope handle_scope(isolate); CFX_PtrArray* pArray = (CFX_PtrArray*)isolate->GetData(0); - if(!pArray) + if(!pArray) { - pArray = FX_NEW CFX_PtrArray(); + pArray = new CFX_PtrArray(); isolate->SetData(0, pArray); } - CJS_ObjDefintion* pObjDef = FX_NEW CJS_ObjDefintion(isolate, sObjName, eObjType, pConstructor, pDestructor, bApplyNew); + CJS_ObjDefintion* pObjDef = new CJS_ObjDefintion(isolate, sObjName, eObjType, pConstructor, pDestructor, bApplyNew); pArray->Add(pObjDef); return pArray->GetSize()-1; } @@ -263,7 +263,7 @@ void JS_InitialRuntime(IJS_Runtime* pJSRuntime,IFXJS_Runtime* pFXRuntime, IFXJS_ if(ws.Equal(L"Document")) { - CJS_PrivateData* pPrivateData = FX_NEW CJS_PrivateData; + CJS_PrivateData* pPrivateData = new CJS_PrivateData; pPrivateData->ObjDefID = i; v8::Handle<v8::External> ptr = v8::External::New(isolate, pPrivateData); @@ -377,14 +377,13 @@ v8::Handle<v8::Object> JS_NewFxDynamicObj(IJS_Runtime* pJSRuntime, IFXJS_Context v8::Local<v8::Context> context = isolate->GetCurrentContext(); v8::Local<v8::ObjectTemplate> objTemp = v8::Local<v8::ObjectTemplate>::New(isolate, pObjDef->m_objTemplate); - v8::Local<v8::Object> obj = objTemp->NewInstance(); - - CJS_PrivateData* pPrivateData = FX_NEW CJS_PrivateData; + + CJS_PrivateData* pPrivateData = new CJS_PrivateData; pPrivateData->ObjDefID = nObjDefnID; - v8::Handle<v8::External> ptr = v8::External::New(isolate, pPrivateData); - obj->SetInternalField(0, ptr); + v8::Handle<v8::External> ptr = v8::External::New(isolate, pPrivateData); + obj->SetInternalField(0, ptr); if(pObjDef->m_pConstructor) pObjDef->m_pConstructor(pJSContext, obj, context->Global()->GetPrototype()->ToObject()); |