Make JSGetObject<C>() return UnownedPtr<C>.
This a convenient place to assert that the callback that is about
to be invoked on the object doesn't destroy the object at any point
during its execution.
Change-Id: Iacb9d4e01603cc6bf316b00fdd062955c903ca5c
Reviewed-on: https://pdfium-review.googlesource.com/37970
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
diff --git a/fxjs/cjs_global.cpp b/fxjs/cjs_global.cpp
index c9afdcb..efeef56 100644
--- a/fxjs/cjs_global.cpp
+++ b/fxjs/cjs_global.cpp
@@ -32,7 +32,7 @@
void JSSpecialPropQuery(const char*,
v8::Local<v8::String> property,
const v8::PropertyCallbackInfo<v8::Integer>& info) {
- Alt* pObj = JSGetObject<Alt>(info.Holder());
+ auto pObj = JSGetObject<Alt>(info.Holder());
if (!pObj)
return;
@@ -50,7 +50,7 @@
void JSSpecialPropGet(const char* class_name,
v8::Local<v8::String> property,
const v8::PropertyCallbackInfo<v8::Value>& info) {
- Alt* pObj = JSGetObject<Alt>(info.Holder());
+ auto pObj = JSGetObject<Alt>(info.Holder());
if (!pObj)
return;
@@ -75,7 +75,7 @@
v8::Local<v8::String> property,
v8::Local<v8::Value> value,
const v8::PropertyCallbackInfo<v8::Value>& info) {
- Alt* pObj = JSGetObject<Alt>(info.Holder());
+ auto pObj = JSGetObject<Alt>(info.Holder());
if (!pObj)
return;
@@ -96,7 +96,7 @@
void JSSpecialPropDel(const char* class_name,
v8::Local<v8::String> property,
const v8::PropertyCallbackInfo<v8::Boolean>& info) {
- Alt* pObj = JSGetObject<Alt>(info.Holder());
+ auto pObj = JSGetObject<Alt>(info.Holder());
if (!pObj)
return;