JNIEXPORT jboolean JNICALL Java_org_cef_network_CefCookieManager_1N_N_1FlushStore(JNIEnv* env, jobject obj, jobject jhandler) { CefRefPtr<CefCookieManager> manager = GetCefFromJNIObject<CefCookieManager>(env, obj, "CefCookieManager"); if (!manager.get()) return JNI_FALSE; CefRefPtr<CefCompletionCallback> callback = new CompletionCallback(env, jhandler); bool result = manager->FlushStore(callback); return result ? JNI_TRUE : JNI_FALSE; }
WebBrowserHost::~WebBrowserHost() { instance_ = 0; // TODO: Better place for this? If there are issues with cookies not persisting // it is possible the async nature of this call could be a culprit CefRefPtr<CefCookieManager> manager = CefCookieManager::GetGlobalManager(nullptr); if (manager.get()) manager->FlushStore(nullptr); CefClearSchemeHandlerFactories(); CefShutdown(); }