示例#1
0
void SetCookieUsage(const EA::WebKit::CookieInfo& cookieInfo)
{
	if (!cookieInfo.mCookieFilePath || !cookieInfo.mCookieFilePath[0] ) 
	{
		EAW_ASSERT_MSG(false,"Cookies persistence disabled. Invalid cookie file path.");
		return;
	}
	
	const char8_t* pCookieFilePath = cookieInfo.mCookieFilePath;

	EA::IO::Path::PathString8 fullPath;
	if(pCookieFilePath)
	{
        fullPath.assign(GetFullPath(pCookieFilePath, true));
		if(!fullPath.empty())
		{
			pCookieFilePath = fullPath.c_str();
		}
	}

	WebCore::ResourceHandleManager* pRHM = WebCore::ResourceHandleManager::sharedInstance();
	EA::WebKit::CookieManager* pCM = pRHM->GetCookieManager();   
	CookieManagerParameters    params(pCookieFilePath, cookieInfo.mMaxIndividualCookieSize, 
									cookieInfo.mDiskCookieStorageSize, cookieInfo.mMaxCookieCount);
	pCM->SetParametersAndInitialize(params);
}