From 16cc79354c5dcc8758c043185a16196d64c14bb6 Mon Sep 17 00:00:00 2001 From: joshaber Date: Fri, 31 Mar 2017 13:53:42 -0400 Subject: [PATCH] Errrrybody's a scoped_refptr now --- atom/browser/api/atom_api_app.cc | 4 ++-- atom/browser/api/atom_api_app.h | 2 +- atom/browser/api/atom_api_certificate_trust.h | 3 ++- atom/browser/api/atom_api_certificate_trust_mac.mm | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/atom/browser/api/atom_api_app.cc b/atom/browser/api/atom_api_app.cc index 3a8f4ef0f8b5..41e7655a66f1 100644 --- a/atom/browser/api/atom_api_app.cc +++ b/atom/browser/api/atom_api_app.cc @@ -813,7 +813,7 @@ void App::OnCertificateManagerModelCreated( #if defined(OS_MACOSX) void App::ShowCertificateTrust(atom::NativeWindow* parent_window, - const net::X509Certificate& cert, + const scoped_refptr& cert, std::string message, const ShowTrustCallback& callback, mate::Arguments* args) { @@ -960,7 +960,7 @@ void App::BuildPrototype( base::Bind(&Browser::GetCurrentActivityType, browser)) .SetMethod("setAboutPanelOptions", base::Bind(&Browser::SetAboutPanelOptions, browser)) - // .SetMethod("showCertificateTrust", &App::ShowCertificateTrust) + .SetMethod("showCertificateTrust", &App::ShowCertificateTrust) #endif #if defined(OS_WIN) .SetMethod("setUserTasks", base::Bind(&Browser::SetUserTasks, browser)) diff --git a/atom/browser/api/atom_api_app.h b/atom/browser/api/atom_api_app.h index 367709cf0c6f..19640cb84886 100644 --- a/atom/browser/api/atom_api_app.h +++ b/atom/browser/api/atom_api_app.h @@ -156,7 +156,7 @@ class App : public AtomBrowserClient::Delegate, #if defined(OS_MACOSX) void ShowCertificateTrust(atom::NativeWindow* parent_window, - const net::X509Certificate& cert, + const scoped_refptr& cert, std::string message, const ShowTrustCallback& callback, mate::Arguments* args); diff --git a/atom/browser/api/atom_api_certificate_trust.h b/atom/browser/api/atom_api_certificate_trust.h index c3e6994b3baf..1de7d653bb18 100644 --- a/atom/browser/api/atom_api_certificate_trust.h +++ b/atom/browser/api/atom_api_certificate_trust.h @@ -8,6 +8,7 @@ #include #include "base/callback_forward.h" +#include "base/memory/ref_counted.h" namespace net { class X509Certificate; @@ -22,7 +23,7 @@ namespace api { typedef base::Callback ShowTrustCallback; void ShowCertificateTrustUI(atom::NativeWindow* parent_window, - const net::X509Certificate& cert, + const scoped_refptr& cert, std::string message, const ShowTrustCallback& callback); diff --git a/atom/browser/api/atom_api_certificate_trust_mac.mm b/atom/browser/api/atom_api_certificate_trust_mac.mm index c0109d9f45a7..dc12ada27f84 100644 --- a/atom/browser/api/atom_api_certificate_trust_mac.mm +++ b/atom/browser/api/atom_api_certificate_trust_mac.mm @@ -21,12 +21,12 @@ namespace atom { namespace api { void ShowCertificateTrustUI(atom::NativeWindow* parent_window, - const net::X509Certificate& cert, + const scoped_refptr& cert, std::string message, const ShowTrustCallback& callback) { auto sec_policy = SecPolicyCreateBasicX509(); SecTrustRef trust = nullptr; - SecTrustCreateWithCertificates(cert.CreateOSCertChainForCert(), sec_policy, &trust); + SecTrustCreateWithCertificates(cert->CreateOSCertChainForCert(), sec_policy, &trust); // CFRelease(sec_policy); NSWindow* window = parent_window ?