mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Merge revision 556 changes:
- Fix race condition in CefCookieManagerImpl constructor (issue #542). git-svn-id: https://chromiumembedded.googlecode.com/svn/branches/1025@558 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@ -66,18 +66,14 @@ class VisitCookiesCallback : public base::RefCounted<VisitCookiesCallback> {
|
|||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
|
||||||
CefCookieManagerImpl::CefCookieManagerImpl()
|
CefCookieManagerImpl::CefCookieManagerImpl(bool is_global)
|
||||||
: is_global_(true) {
|
: is_global_(is_global) {
|
||||||
|
if (is_global) {
|
||||||
cookie_monster_ =
|
cookie_monster_ =
|
||||||
static_cast<net::CookieMonster*>(
|
static_cast<net::CookieMonster*>(
|
||||||
_Context->request_context()->cookie_store());
|
_Context->request_context()->cookie_store());
|
||||||
DCHECK(cookie_monster_);
|
DCHECK(cookie_monster_);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Creates a new cookie monster with storage at the specified |path|.
|
|
||||||
CefCookieManagerImpl::CefCookieManagerImpl(const CefString& path)
|
|
||||||
:is_global_(false) {
|
|
||||||
SetStoragePath(path);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CefCookieManagerImpl::~CefCookieManagerImpl() {
|
CefCookieManagerImpl::~CefCookieManagerImpl() {
|
||||||
@ -239,7 +235,7 @@ CefRefPtr<CefCookieManager> CefCookieManager::GetGlobalManager() {
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new CefCookieManagerImpl();
|
return new CefCookieManagerImpl(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
@ -251,5 +247,7 @@ CefRefPtr<CefCookieManager> CefCookieManager::CreateManager(
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new CefCookieManagerImpl(path);
|
CefRefPtr<CefCookieManager> manager(new CefCookieManagerImpl(false));
|
||||||
|
manager->SetStoragePath(path);
|
||||||
|
return manager;
|
||||||
}
|
}
|
||||||
|
@ -12,11 +12,7 @@
|
|||||||
// Implementation of the CefCookieManager interface.
|
// Implementation of the CefCookieManager interface.
|
||||||
class CefCookieManagerImpl : public CefCookieManager {
|
class CefCookieManagerImpl : public CefCookieManager {
|
||||||
public:
|
public:
|
||||||
// Creates a new reference to the existing global cookie monster.
|
CefCookieManagerImpl(bool is_global);
|
||||||
CefCookieManagerImpl();
|
|
||||||
|
|
||||||
// Creates a new cookie monster with storage at the specified |path|.
|
|
||||||
explicit CefCookieManagerImpl(const CefString& path);
|
|
||||||
|
|
||||||
~CefCookieManagerImpl();
|
~CefCookieManagerImpl();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user