CEF3: Add CefCookieManager::SetSupportedSchemes method which supports cookie storage for non-http(s) schemes (issue #567).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@577 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2012-04-03 22:14:28 +00:00
parent 825080f86d
commit 0b3ef6e2cd
8 changed files with 158 additions and 24 deletions

View File

@@ -85,6 +85,33 @@ void CefCookieManagerImpl::Initialize(const CefString& path) {
SetStoragePath(path);
}
void CefCookieManagerImpl::SetSupportedSchemes(
const std::vector<CefString>& schemes) {
if (CEF_CURRENTLY_ON_IOT()) {
if (schemes.empty())
return;
std::set<std::string> scheme_set;
std::vector<CefString>::const_iterator it = schemes.begin();
for (; it != schemes.end(); ++it)
scheme_set.insert(*it);
const char** arr = new const char*[scheme_set.size()];
std::set<std::string>::const_iterator it2 = scheme_set.begin();
for (int i = 0; it2 != scheme_set.end(); ++it2, ++i)
arr[i] = it2->c_str();
cookie_monster_->SetCookieableSchemes(arr, scheme_set.size());
delete [] arr;
} else {
// Execute on the IO thread.
CEF_POST_TASK(CEF_IOT,
base::Bind(&CefCookieManagerImpl::SetSupportedSchemes,
this, schemes));
}
}
bool CefCookieManagerImpl::VisitAllCookies(
CefRefPtr<CefCookieVisitor> visitor) {
if (CEF_CURRENTLY_ON_IOT()) {