Had anybody worked with CEF3 CefCookieManager?
I just want to study the usage of CefCookieManager,so I test my code in cefSimple project packed wtih Cef3 downloads.I use cef3.1750,vs2013(vc12)
First,I write a class(WXRequestContextHandler) which inherited form CefRequestContextHandler,like this:
#include "include/cef_app.h"
#include "include/cef_request_context_handler.h"
#include "include/cef_cookie.h"
class WXRequestContextHandler :public CefRequestContextHandler
{
public:
WXRequestContextHandler(){};
~WXRequestContextHandler(){};
CefRefPtr<CefCookieManager> GetCookieManager() OVERRIDE{
return CefCookieManager::CreateManager("F:\\CefCookie",FALSE);
}
private:
IMPLEMENT_REFCOUNTING(WXRequestContextHandler);
};
then Create an instance of this Class,like this:
CefRefPtr<CefRequestContext> rc = CefRequestContext::CreateContext(new WXRequestContextHandler());
and Create the browser:
CefBrowserHost::CreateBrowser(window_info, handler.get(), url,
browser_settings, rc);
OK,I don't know anymore about the CefCookieManager,so I run the code press F5,and got a exception(triggered in libcef.dll ,access violation 0xc0000005),the cefSimple application crashed.
I noticted the getCookieManager methed was called and when it return the exception will be triggered.but if it return NULL(which means use global cookieManager) the app runs as normal.
Obviously,I think I didn't use the CookieManager::CreateManager Correctly.
My problem is:what is the correct way to use CefCookieManager::CreateManager?