diff --git a/atom/browser/api/atom_api_session.cc b/atom/browser/api/atom_api_session.cc index 07b9b68a94d7..579b64bf4a7d 100644 --- a/atom/browser/api/atom_api_session.cc +++ b/atom/browser/api/atom_api_session.cc @@ -241,10 +241,7 @@ void SetProxyInIO(net::URLRequestContextGetter* getter, void PassVerificationResult( scoped_refptr request, bool success) { - int result = net::OK; - if (!success) - result = net::ERR_FAILED; - request->ContinueWithResult(result); + request->ContinueWithResult(success ? net::OK : net::ERR_FAILED); } } // namespace diff --git a/atom/browser/atom_cert_verifier.cc b/atom/browser/atom_cert_verifier.cc index e56e611faa81..0ff0d1e4a547 100644 --- a/atom/browser/atom_cert_verifier.cc +++ b/atom/browser/atom_cert_verifier.cc @@ -66,8 +66,7 @@ void AtomCertVerifier::CertVerifyRequest::DelegateToDefaultVerifier() { key_.flags, crl_set_.get(), verify_result_, - base::Bind(&CertVerifyRequest::RunResult, - weak_ptr_factory_.GetWeakPtr()), + base::Bind(&CertVerifyRequest::RunResult, this), out_req_, net_log_); @@ -86,15 +85,14 @@ void AtomCertVerifier::CertVerifyRequest::ContinueWithResult(int result) { if (result != net::ERR_IO_PENDING) { BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, base::Bind(&CertVerifyRequest::RunResult, - weak_ptr_factory_.GetWeakPtr(), + this, result)); return; } BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, - base::Bind(&CertVerifyRequest::DelegateToDefaultVerifier, - weak_ptr_factory_.GetWeakPtr())); + base::Bind(&CertVerifyRequest::DelegateToDefaultVerifier, this)); } AtomCertVerifier::AtomCertVerifier() diff --git a/atom/browser/atom_cert_verifier.h b/atom/browser/atom_cert_verifier.h index e5560ff82fe4..50446dd38bd2 100644 --- a/atom/browser/atom_cert_verifier.h +++ b/atom/browser/atom_cert_verifier.h @@ -55,8 +55,7 @@ class AtomCertVerifier : public net::CertVerifier { verify_result_(verify_result), out_req_(out_req), net_log_(net_log), - handled_(false), - weak_ptr_factory_(this) { + handled_(false) { } void RunResult(int result); @@ -91,8 +90,6 @@ class AtomCertVerifier : public net::CertVerifier { std::vector callbacks_; bool handled_; - base::WeakPtrFactory weak_ptr_factory_; - DISALLOW_COPY_AND_ASSIGN(CertVerifyRequest); };