chromiumembedded / java-cef

Java Chromium Embedded Framework (JCEF). A simple framework for embedding Chromium-based browsers in other applications using the Java programming language.
https://bitbucket.org/chromiumembedded/java-cef
Other
648 stars 142 forks source link

Fix for persistent callbacks #476

Open MarshallVielmetti-jhuapl opened 3 months ago

MarshallVielmetti-jhuapl commented 3 months ago

My fix for #398

  1. Add two private methods to CefQueryCallbackN.java, makePersistent and getIsPersistent, and a private boolean variable persistent
  2. In MessageRouterHandler::OnQuery (message_router_handler.cpp:28), check the value of persistent, if true use JNI_CALL_VOID_METHOD to call makePersistent. This will set a boolean value to true in CefQueryCallback_N
  3. In CefQueryCallback_N.cpp::Success, use JNI_CALL_BOOLEAN_METHOD to call getIsPersistent, check the boolean value, and if its true then do not call ClearSelf

I am totally open to fixing anything here, this is my first attempt at open source contribution so please let me know if I'm forgetting something!