From 185fe6ced957da86b616071013ce999ac7210c82 Mon Sep 17 00:00:00 2001 From: Nitish Sakhawalkar Date: Tue, 9 Oct 2018 16:50:44 -0700 Subject: [PATCH] fix: Lifetime of auth_info_ in login handler (#15042) --- 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 80525ebfd3385..211ac0e13cbdb 100644 --- a/atom/browser/login_handler.cc +++ b/atom/browser/login_handler.cc @@ -25,7 +25,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 e7f1c5be00945..e07b85feb2b36 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_;