Errrrybody's a scoped_refptr now
This commit is contained in:
parent
deae70de4d
commit
16cc79354c
4 changed files with 7 additions and 6 deletions
|
@ -813,7 +813,7 @@ void App::OnCertificateManagerModelCreated(
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MACOSX)
|
||||||
void App::ShowCertificateTrust(atom::NativeWindow* parent_window,
|
void App::ShowCertificateTrust(atom::NativeWindow* parent_window,
|
||||||
const net::X509Certificate& cert,
|
const scoped_refptr<net::X509Certificate>& cert,
|
||||||
std::string message,
|
std::string message,
|
||||||
const ShowTrustCallback& callback,
|
const ShowTrustCallback& callback,
|
||||||
mate::Arguments* args) {
|
mate::Arguments* args) {
|
||||||
|
@ -960,7 +960,7 @@ void App::BuildPrototype(
|
||||||
base::Bind(&Browser::GetCurrentActivityType, browser))
|
base::Bind(&Browser::GetCurrentActivityType, browser))
|
||||||
.SetMethod("setAboutPanelOptions",
|
.SetMethod("setAboutPanelOptions",
|
||||||
base::Bind(&Browser::SetAboutPanelOptions, browser))
|
base::Bind(&Browser::SetAboutPanelOptions, browser))
|
||||||
// .SetMethod("showCertificateTrust", &App::ShowCertificateTrust)
|
.SetMethod("showCertificateTrust", &App::ShowCertificateTrust)
|
||||||
#endif
|
#endif
|
||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
.SetMethod("setUserTasks", base::Bind(&Browser::SetUserTasks, browser))
|
.SetMethod("setUserTasks", base::Bind(&Browser::SetUserTasks, browser))
|
||||||
|
|
|
@ -156,7 +156,7 @@ class App : public AtomBrowserClient::Delegate,
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MACOSX)
|
||||||
void ShowCertificateTrust(atom::NativeWindow* parent_window,
|
void ShowCertificateTrust(atom::NativeWindow* parent_window,
|
||||||
const net::X509Certificate& cert,
|
const scoped_refptr<net::X509Certificate>& cert,
|
||||||
std::string message,
|
std::string message,
|
||||||
const ShowTrustCallback& callback,
|
const ShowTrustCallback& callback,
|
||||||
mate::Arguments* args);
|
mate::Arguments* args);
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "base/callback_forward.h"
|
#include "base/callback_forward.h"
|
||||||
|
#include "base/memory/ref_counted.h"
|
||||||
|
|
||||||
namespace net {
|
namespace net {
|
||||||
class X509Certificate;
|
class X509Certificate;
|
||||||
|
@ -22,7 +23,7 @@ namespace api {
|
||||||
typedef base::Callback<void(bool result)> ShowTrustCallback;
|
typedef base::Callback<void(bool result)> ShowTrustCallback;
|
||||||
|
|
||||||
void ShowCertificateTrustUI(atom::NativeWindow* parent_window,
|
void ShowCertificateTrustUI(atom::NativeWindow* parent_window,
|
||||||
const net::X509Certificate& cert,
|
const scoped_refptr<net::X509Certificate>& cert,
|
||||||
std::string message,
|
std::string message,
|
||||||
const ShowTrustCallback& callback);
|
const ShowTrustCallback& callback);
|
||||||
|
|
||||||
|
|
|
@ -21,12 +21,12 @@ namespace atom {
|
||||||
namespace api {
|
namespace api {
|
||||||
|
|
||||||
void ShowCertificateTrustUI(atom::NativeWindow* parent_window,
|
void ShowCertificateTrustUI(atom::NativeWindow* parent_window,
|
||||||
const net::X509Certificate& cert,
|
const scoped_refptr<net::X509Certificate>& cert,
|
||||||
std::string message,
|
std::string message,
|
||||||
const ShowTrustCallback& callback) {
|
const ShowTrustCallback& callback) {
|
||||||
auto sec_policy = SecPolicyCreateBasicX509();
|
auto sec_policy = SecPolicyCreateBasicX509();
|
||||||
SecTrustRef trust = nullptr;
|
SecTrustRef trust = nullptr;
|
||||||
SecTrustCreateWithCertificates(cert.CreateOSCertChainForCert(), sec_policy, &trust);
|
SecTrustCreateWithCertificates(cert->CreateOSCertChainForCert(), sec_policy, &trust);
|
||||||
// CFRelease(sec_policy);
|
// CFRelease(sec_policy);
|
||||||
|
|
||||||
NSWindow* window = parent_window ?
|
NSWindow* window = parent_window ?
|
||||||
|
|
Loading…
Reference in a new issue