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:
Robo 2018-03-30 18:54:55 +05:30 committed by Charles Kerr
parent fc00a2ba32
commit 171230e45d
14 changed files with 144 additions and 96 deletions

View file

@ -18,6 +18,10 @@
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_getter.h"
#if DCHECK_IS_ON()
#include "base/debug/leak_tracker.h"
#endif
namespace base {
class MessageLoop;
}
@ -83,6 +87,8 @@ class URLRequestContextGetter : public net::URLRequestContextGetter {
net::HostResolver* host_resolver();
net::URLRequestJobFactory* job_factory() const { return job_factory_; }
void NotifyContextShutdownOnIO();
private:
Delegate* delegate_;
@ -93,6 +99,10 @@ class URLRequestContextGetter : public net::URLRequestContextGetter {
std::string user_agent_;
#if DCHECK_IS_ON()
base::debug::LeakTracker<URLRequestContextGetter> leak_tracker_;
#endif
std::unique_ptr<RequireCTDelegate> ct_delegate_;
std::unique_ptr<net::ProxyConfigService> proxy_config_service_;
std::unique_ptr<net::URLRequestContextStorage> storage_;
@ -107,6 +117,8 @@ class URLRequestContextGetter : public net::URLRequestContextGetter {
net::URLRequestJobFactory* job_factory_; // weak ref
bool context_shutting_down_;
DISALLOW_COPY_AND_ASSIGN(URLRequestContextGetter);
};