Merge revision 574 changes:

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

git-svn-id: https://chromiumembedded.googlecode.com/svn/branches/963@576 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2012-04-03 19:26:28 +00:00
parent 0cf1388a2c
commit 82390e4676
8 changed files with 160 additions and 24 deletions

View File

@ -79,6 +79,33 @@ CefCookieManagerImpl::CefCookieManagerImpl(bool is_global)
CefCookieManagerImpl::~CefCookieManagerImpl() {
}
void CefCookieManagerImpl::SetSupportedSchemes(
const std::vector<CefString>& schemes) {
if (CefThread::CurrentlyOn(CefThread::IO)) {
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.
CefThread::PostTask(CefThread::IO, FROM_HERE,
base::Bind(&CefCookieManagerImpl::SetSupportedSchemes,
this, schemes));
}
}
bool CefCookieManagerImpl::VisitAllCookies(
CefRefPtr<CefCookieVisitor> visitor) {
if (CefThread::CurrentlyOn(CefThread::IO)) {