Make CFXJS_Engine::SetObjectPrivate() static.

Avoids call to CFXJS_Engine::EngineFromIsolateCurrentContext() during
the Dispose() path, which feels scary because there aren't guarantees
about it having an engine at isolate "dispose" time. Fortunately, |this|
is not used, so make that fact clear.

Replace some c-style callbacks with std::function while we're at it.

Change-Id: Ia1a1a1fcc085d8657939e6f8c8d34fc511afddfe
Reviewed-on: https://pdfium-review.googlesource.com/25970
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
diff --git a/fxjs/JS_Define.cpp b/fxjs/JS_Define.cpp
index 744cb7d..d5b1cef 100644
--- a/fxjs/JS_Define.cpp
+++ b/fxjs/JS_Define.cpp
@@ -167,8 +167,8 @@
 
 }  // namespace
 
-void JSDestructor(CFXJS_Engine* pEngine, v8::Local<v8::Object> obj) {
-  pEngine->SetObjectPrivate(obj, nullptr);
+void JSDestructor(v8::Local<v8::Object> obj) {
+  CFXJS_Engine::SetObjectPrivate(obj, nullptr);
 }
 
 double JS_GetDateTime() {