Cleanup destruction of URLRequestContextGetter (#12305)
- Add Leak detector - Indicate shutdown of request context from Browser Context - Change stored references to URLRequestContextGetter to use BrowserContext - Destroy session properties explicitly
This commit is contained in:
parent
fc00a2ba32
commit
171230e45d
14 changed files with 144 additions and 96 deletions
|
@ -31,15 +31,16 @@ class IDUserData : public base::SupportsUserData::Data {
|
|||
|
||||
TrackableObjectBase::TrackableObjectBase()
|
||||
: weak_map_id_(0), weak_factory_(this) {
|
||||
cleanup_ = RegisterDestructionCallback(GetDestroyClosure());
|
||||
atom::AtomBrowserMainParts::Get()->RegisterDestructionCallback(
|
||||
GetDestroyClosure());
|
||||
}
|
||||
|
||||
TrackableObjectBase::~TrackableObjectBase() {
|
||||
cleanup_.Run();
|
||||
}
|
||||
|
||||
base::Closure TrackableObjectBase::GetDestroyClosure() {
|
||||
return base::Bind(&TrackableObjectBase::Destroy, weak_factory_.GetWeakPtr());
|
||||
base::OnceClosure TrackableObjectBase::GetDestroyClosure() {
|
||||
return base::BindOnce(&TrackableObjectBase::Destroy,
|
||||
weak_factory_.GetWeakPtr());
|
||||
}
|
||||
|
||||
void TrackableObjectBase::Destroy() {
|
||||
|
@ -62,10 +63,4 @@ int32_t TrackableObjectBase::GetIDFromWrappedClass(
|
|||
return 0;
|
||||
}
|
||||
|
||||
// static
|
||||
base::Closure TrackableObjectBase::RegisterDestructionCallback(
|
||||
const base::Closure& c) {
|
||||
return atom::AtomBrowserMainParts::Get()->RegisterDestructionCallback(c);
|
||||
}
|
||||
|
||||
} // namespace mate
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue