Skip to content

Commit

Permalink
fix: Lifetime of auth_info_ in login handler (#15042)
Browse files Browse the repository at this point in the history
  • Loading branch information
nitsakh authored and MarshallOfSound committed Oct 9, 2018
1 parent 36ee838 commit 185fe6c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion atom/browser/login_handler.cc
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions atom/browser/login_handler.h
Expand Up @@ -40,7 +40,7 @@ class LoginHandler : public base::RefCountedThreadSafe<LoginHandler> {
// 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<LoginHandler>;
Expand All @@ -56,7 +56,7 @@ class LoginHandler : public base::RefCountedThreadSafe<LoginHandler> {
net::AuthCredentials* credentials_;

// Who/where/what asked for the authentication.
const net::AuthChallengeInfo& auth_info_;
scoped_refptr<const net::AuthChallengeInfo> auth_info_;

// WebContents associated with the login request.
content::ResourceRequestInfo::WebContentsGetter web_contents_getter_;
Expand Down

0 comments on commit 185fe6c

Please sign in to comment.