From 3d8af9d279bd14e0d37441b72cda0354031924a1 Mon Sep 17 00:00:00 2001 From: "trop[bot]" Date: Wed, 10 Oct 2018 12:59:27 +1100 Subject: [PATCH] fix: Lifetime of auth_info_ in login handler (#15044) --- atom/browser/login_handler.cc | 2 +- atom/browser/login_handler.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/atom/browser/login_handler.cc b/atom/browser/login_handler.cc index 2063c6197fce..f54cab7e7983 100644 --- a/atom/browser/login_handler.cc +++ b/atom/browser/login_handler.cc @@ -22,7 +22,7 @@ LoginHandler::LoginHandler( net::AuthCredentials* credentials, const content::ResourceRequestInfo* resource_request_info) : credentials_(credentials), - auth_info_(auth_info), + auth_info_(&auth_info), auth_callback_(std::move(callback)), weak_factory_(this) { DCHECK_CURRENTLY_ON(BrowserThread::IO); diff --git a/atom/browser/login_handler.h b/atom/browser/login_handler.h index e7f1c5be0094..e07b85feb2b3 100644 --- a/atom/browser/login_handler.h +++ b/atom/browser/login_handler.h @@ -40,7 +40,7 @@ class LoginHandler : public base::RefCountedThreadSafe { // thread. content::WebContents* GetWebContents() const; - const net::AuthChallengeInfo* auth_info() const { return &auth_info_; } + const net::AuthChallengeInfo* auth_info() const { return auth_info_.get(); } private: friend class base::RefCountedThreadSafe; @@ -56,7 +56,7 @@ class LoginHandler : public base::RefCountedThreadSafe { net::AuthCredentials* credentials_; // Who/where/what asked for the authentication. - const net::AuthChallengeInfo& auth_info_; + scoped_refptr auth_info_; // WebContents associated with the login request. content::ResourceRequestInfo::WebContentsGetter web_contents_getter_;