Add CefSetCookiePath() and CefSetStoragePath() functions for changing cookie and localStorage locations while CEF is running (issue #347).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@353 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2011-11-02 19:50:00 +00:00
parent 7a4cb9dd20
commit 28adf8908a
14 changed files with 474 additions and 134 deletions

View File

@@ -283,14 +283,24 @@ CEF_EXPORT int cef_delete_cookies(const cef_string_t* url,
{
CefString urlStr, cookieNameStr;
if(url)
if (url)
urlStr = url;
if(cookie_name)
if (cookie_name)
cookieNameStr = cookie_name;
return CefDeleteCookies(urlStr, cookieNameStr);
}
CEF_EXPORT int cef_set_cookie_path(const cef_string_t* path)
{
CefString pathStr;
if (path)
pathStr = path;
return CefSetCookiePath(pathStr);
}
CEF_EXPORT int cef_visit_storage(enum cef_storage_type_t type,
const cef_string_t* origin, const cef_string_t* key,
struct _cef_storage_visitor_t* visitor)
@@ -334,3 +344,14 @@ CEF_EXPORT int cef_delete_storage(enum cef_storage_type_t type,
return CefDeleteStorage(type, origin, key);
}
CEF_EXPORT int cef_set_storage_path(enum cef_storage_type_t type,
const cef_string_t* path)
{
CefString pathStr;
if (path)
pathStr = path;
return CefSetStoragePath(type, pathStr);
}

View File

@@ -205,6 +205,11 @@ bool CefDeleteCookies(const CefString& url, const CefString& cookie_name)
true : false;
}
bool CefSetCookiePath(const CefString& path)
{
return cef_set_cookie_path(path.GetStruct()) ? true : false;
}
bool CefVisitStorage(CefStorageType type, const CefString& origin,
const CefString& key,
CefRefPtr<CefStorageVisitor> visitor)
@@ -226,3 +231,8 @@ bool CefDeleteStorage(CefStorageType type, const CefString& origin,
return cef_delete_storage(type, origin.GetStruct(), key.GetStruct()) ?
true : false;
}
bool CefSetStoragePath(CefStorageType type, const CefString& path)
{
return cef_set_storage_path(type, path.GetStruct()) ? true : false;
}