summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFranziska Hinkelmann <franzih@chromium.org>2018-03-21 12:58:25 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-03-21 12:58:25 +0000
commit9a635e8127880dd93b2abc5e8da6a45046d35e31 (patch)
treeac361ba63aec227d693aca2b104fbe7be65ceae0
parent765d1ebe41defa659a703a2f0ff5284c0da96a95 (diff)
downloadpdfium-9a635e8127880dd93b2abc5e8da6a45046d35e31.tar.xz
Replace deprecated SetNamedPropertyHandler
Replace v8::SetNamedPropertyHandler() with SetHandler() and the appropriate flag set. Change-Id: Ia06311cbea4ab21903d4ac4fe115eab6f0983c0d Reviewed-on: https://pdfium-review.googlesource.com/28930 Reviewed-by: Jochen Eisinger <jochen@chromium.org> Commit-Queue: Jochen Eisinger <jochen@chromium.org>
-rw-r--r--fxjs/cfxjs_engine.cpp15
-rw-r--r--fxjs/cfxjs_engine.h8
-rw-r--r--fxjs/cjs_global.cpp32
-rw-r--r--fxjs/cjs_global.h8
4 files changed, 41 insertions, 22 deletions
diff --git a/fxjs/cfxjs_engine.cpp b/fxjs/cfxjs_engine.cpp
index 927d4a7b0a..561a0a31f9 100644
--- a/fxjs/cfxjs_engine.cpp
+++ b/fxjs/cfxjs_engine.cpp
@@ -377,16 +377,19 @@ void CFXJS_Engine::DefineObjProperty(int nObjDefnID,
void CFXJS_Engine::DefineObjAllProperties(
int nObjDefnID,
- v8::NamedPropertyQueryCallback pPropQurey,
- v8::NamedPropertyGetterCallback pPropGet,
- v8::NamedPropertySetterCallback pPropPut,
- v8::NamedPropertyDeleterCallback pPropDel) {
+ v8::GenericNamedPropertyQueryCallback pPropQurey,
+ v8::GenericNamedPropertyGetterCallback pPropGet,
+ v8::GenericNamedPropertySetterCallback pPropPut,
+ v8::GenericNamedPropertyDeleterCallback pPropDel) {
v8::Isolate::Scope isolate_scope(GetIsolate());
v8::HandleScope handle_scope(GetIsolate());
CFXJS_ObjDefinition* pObjDef =
CFXJS_ObjDefinition::ForID(GetIsolate(), nObjDefnID);
- pObjDef->GetInstanceTemplate()->SetNamedPropertyHandler(pPropGet, pPropPut,
- pPropQurey, pPropDel);
+ pObjDef->GetInstanceTemplate()->SetHandler(
+ v8::NamedPropertyHandlerConfiguration(
+ pPropGet, pPropPut, pPropQurey, pPropDel, nullptr,
+ v8::Local<v8::Value>(),
+ v8::PropertyHandlerFlags::kOnlyInterceptStrings));
}
void CFXJS_Engine::DefineObjConst(int nObjDefnID,
diff --git a/fxjs/cfxjs_engine.h b/fxjs/cfxjs_engine.h
index 5f883f7e4a..4f903bd96e 100644
--- a/fxjs/cfxjs_engine.h
+++ b/fxjs/cfxjs_engine.h
@@ -111,10 +111,10 @@ class CFXJS_Engine : public CFX_V8 {
v8::AccessorGetterCallback pPropGet,
v8::AccessorSetterCallback pPropPut);
void DefineObjAllProperties(int nObjDefnID,
- v8::NamedPropertyQueryCallback pPropQurey,
- v8::NamedPropertyGetterCallback pPropGet,
- v8::NamedPropertySetterCallback pPropPut,
- v8::NamedPropertyDeleterCallback pPropDel);
+ v8::GenericNamedPropertyQueryCallback pPropQurey,
+ v8::GenericNamedPropertyGetterCallback pPropGet,
+ v8::GenericNamedPropertySetterCallback pPropPut,
+ v8::GenericNamedPropertyDeleterCallback pPropDel);
void DefineObjConst(int nObjDefnID,
const char* sConstName,
v8::Local<v8::Value> pDefault);
diff --git a/fxjs/cjs_global.cpp b/fxjs/cjs_global.cpp
index 729190fe13..c8deadf5d5 100644
--- a/fxjs/cjs_global.cpp
+++ b/fxjs/cjs_global.cpp
@@ -147,31 +147,47 @@ void CJS_Global::setPersistent_static(
// static
void CJS_Global::queryprop_static(
- v8::Local<v8::String> property,
+ v8::Local<v8::Name> property,
const v8::PropertyCallbackInfo<v8::Integer>& info) {
- JSSpecialPropQuery<CJS_Global>("global", property, info);
+ DCHECK(property->IsString());
+ JSSpecialPropQuery<CJS_Global>(
+ "global",
+ v8::Local<v8::String>::New(info.GetIsolate(), property->ToString()),
+ info);
}
// static
void CJS_Global::getprop_static(
- v8::Local<v8::String> property,
+ v8::Local<v8::Name> property,
const v8::PropertyCallbackInfo<v8::Value>& info) {
- JSSpecialPropGet<CJS_Global>("global", property, info);
+ DCHECK(property->IsString());
+ JSSpecialPropGet<CJS_Global>(
+ "global",
+ v8::Local<v8::String>::New(info.GetIsolate(), property->ToString()),
+ info);
}
// static
void CJS_Global::putprop_static(
- v8::Local<v8::String> property,
+ v8::Local<v8::Name> property,
v8::Local<v8::Value> value,
const v8::PropertyCallbackInfo<v8::Value>& info) {
- JSSpecialPropPut<CJS_Global>("global", property, value, info);
+ DCHECK(property->IsString());
+ JSSpecialPropPut<CJS_Global>(
+ "global",
+ v8::Local<v8::String>::New(info.GetIsolate(), property->ToString()),
+ value, info);
}
// static
void CJS_Global::delprop_static(
- v8::Local<v8::String> property,
+ v8::Local<v8::Name> property,
const v8::PropertyCallbackInfo<v8::Boolean>& info) {
- JSSpecialPropDel<CJS_Global>("global", property, info);
+ DCHECK(property->IsString());
+ JSSpecialPropDel<CJS_Global>(
+ "global",
+ v8::Local<v8::String>::New(info.GetIsolate(), property->ToString()),
+ info);
}
// static
diff --git a/fxjs/cjs_global.h b/fxjs/cjs_global.h
index ab905bcdd2..15ef603e45 100644
--- a/fxjs/cjs_global.h
+++ b/fxjs/cjs_global.h
@@ -22,14 +22,14 @@ class CJS_Global : public CJS_Object {
static void DefineAllProperties(CFXJS_Engine* pEngine);
static void queryprop_static(
- v8::Local<v8::String> property,
+ v8::Local<v8::Name> property,
const v8::PropertyCallbackInfo<v8::Integer>& info);
- static void getprop_static(v8::Local<v8::String> property,
+ static void getprop_static(v8::Local<v8::Name> property,
const v8::PropertyCallbackInfo<v8::Value>& info);
- static void putprop_static(v8::Local<v8::String> property,
+ static void putprop_static(v8::Local<v8::Name> property,
v8::Local<v8::Value> value,
const v8::PropertyCallbackInfo<v8::Value>& info);
- static void delprop_static(v8::Local<v8::String> property,
+ static void delprop_static(v8::Local<v8::Name> property,
const v8::PropertyCallbackInfo<v8::Boolean>& info);
static void setPersistent_static(