Fix CefSchemeHandlerFactory leak during shutdown.

This commit is contained in:
Marshall Greenblatt
2017-04-24 20:13:43 -04:00
parent 069c2fd9f6
commit 364cd863b1
7 changed files with 161 additions and 107 deletions

View File

@@ -24,6 +24,9 @@ class CefURLRequestContextGetterProxy : public CefURLRequestContextGetter {
scoped_refptr<CefURLRequestContextGetterImpl> parent);
~CefURLRequestContextGetterProxy() override;
// Called when the StoragePartitionProxy is destroyed.
void ShutdownOnUIThread();
// net::URLRequestContextGetter implementation.
net::URLRequestContext* GetURLRequestContext() override;
scoped_refptr<base::SingleThreadTaskRunner>
@@ -35,6 +38,8 @@ class CefURLRequestContextGetterProxy : public CefURLRequestContextGetter {
CefRefPtr<CefRequestContextHandler> handler() const { return handler_; }
private:
void ShutdownOnIOThread();
CefRefPtr<CefRequestContextHandler> handler_;
// The CefURLRequestContextImpl owned by |parent_| is passed as a raw pointer
@@ -44,6 +49,8 @@ class CefURLRequestContextGetterProxy : public CefURLRequestContextGetter {
std::unique_ptr<CefURLRequestContextProxy> context_proxy_;
bool shutting_down_ = false;
DISALLOW_COPY_AND_ASSIGN(CefURLRequestContextGetterProxy);
};