NetworkService: Implement URLLoader::OnCertificateRequested
https://chromium-review.googlesource.com/c/chromium/src/+/848303
This commit is contained in:
parent
b268e37663
commit
27cb84eee0
4 changed files with 27 additions and 27 deletions
|
@ -52,6 +52,16 @@
|
||||||
#include "ui/base/l10n/l10n_util.h"
|
#include "ui/base/l10n/l10n_util.h"
|
||||||
#include "v8/include/v8.h"
|
#include "v8/include/v8.h"
|
||||||
|
|
||||||
|
#if defined(USE_NSS_CERTS)
|
||||||
|
#include "net/ssl/client_cert_store_nss.h"
|
||||||
|
#elif defined(OS_WIN)
|
||||||
|
#include "net/ssl/client_cert_store_win.h"
|
||||||
|
#elif defined(OS_MACOSX)
|
||||||
|
#include "net/ssl/client_cert_store_mac.h"
|
||||||
|
#elif defined(USE_OPENSSL)
|
||||||
|
#include "net/ssl/client_cert_store.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
using content::BrowserThread;
|
using content::BrowserThread;
|
||||||
|
|
||||||
namespace atom {
|
namespace atom {
|
||||||
|
@ -167,7 +177,7 @@ bool AtomBrowserClient::RendererDisablesPopups(int process_id) {
|
||||||
|
|
||||||
void AtomBrowserClient::RenderProcessWillLaunch(
|
void AtomBrowserClient::RenderProcessWillLaunch(
|
||||||
content::RenderProcessHost* host,
|
content::RenderProcessHost* host,
|
||||||
service_manager::mojom::ServiceRequest* service_request)) {
|
service_manager::mojom::ServiceRequest* service_request) {
|
||||||
// When a render process is crashed, it might be reused.
|
// When a render process is crashed, it might be reused.
|
||||||
int process_id = host->GetID();
|
int process_id = host->GetID();
|
||||||
if (IsProcessObserved(process_id))
|
if (IsProcessObserved(process_id))
|
||||||
|
@ -473,6 +483,20 @@ void AtomBrowserClient::SiteInstanceDeleting(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unique_ptr<net::ClientCertStore> AtomBrowserClient::CreateClientCertStore(
|
||||||
|
content::ResourceContext* resource_context) {
|
||||||
|
#if defined(USE_NSS_CERTS)
|
||||||
|
return std::unique_ptr<net::ClientCertStore>(new net::ClientCertStoreNSS(
|
||||||
|
net::ClientCertStoreNSS::PasswordDelegateFactory()));
|
||||||
|
#elif defined(OS_WIN)
|
||||||
|
return std::unique_ptr<net::ClientCertStore>(new net::ClientCertStoreWin());
|
||||||
|
#elif defined(OS_MACOSX)
|
||||||
|
return std::unique_ptr<net::ClientCertStore>(new net::ClientCertStoreMac());
|
||||||
|
#elif defined(USE_OPENSSL)
|
||||||
|
return std::unique_ptr<net::ClientCertStore>();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
brightray::BrowserMainParts* AtomBrowserClient::OverrideCreateBrowserMainParts(
|
brightray::BrowserMainParts* AtomBrowserClient::OverrideCreateBrowserMainParts(
|
||||||
const content::MainFunctionParams&) {
|
const content::MainFunctionParams&) {
|
||||||
v8::V8::Initialize(); // Init V8 before creating main parts.
|
v8::V8::Initialize(); // Init V8 before creating main parts.
|
||||||
|
|
|
@ -104,6 +104,8 @@ class AtomBrowserClient : public brightray::BrowserClient,
|
||||||
void GetAdditionalAllowedSchemesForFileSystem(
|
void GetAdditionalAllowedSchemesForFileSystem(
|
||||||
std::vector<std::string>* schemes) override;
|
std::vector<std::string>* schemes) override;
|
||||||
void SiteInstanceDeleting(content::SiteInstance* site_instance) override;
|
void SiteInstanceDeleting(content::SiteInstance* site_instance) override;
|
||||||
|
std::unique_ptr<net::ClientCertStore> CreateClientCertStore(
|
||||||
|
content::ResourceContext* resource_context) override;
|
||||||
|
|
||||||
// brightray::BrowserClient:
|
// brightray::BrowserClient:
|
||||||
brightray::BrowserMainParts* OverrideCreateBrowserMainParts(
|
brightray::BrowserMainParts* OverrideCreateBrowserMainParts(
|
||||||
|
|
|
@ -14,17 +14,8 @@
|
||||||
#include "content/public/browser/download_manager.h"
|
#include "content/public/browser/download_manager.h"
|
||||||
#include "content/public/browser/render_frame_host.h"
|
#include "content/public/browser/render_frame_host.h"
|
||||||
#include "net/base/escape.h"
|
#include "net/base/escape.h"
|
||||||
#include "net/ssl/client_cert_store.h"
|
|
||||||
#include "url/gurl.h"
|
#include "url/gurl.h"
|
||||||
|
|
||||||
#if defined(USE_NSS_CERTS)
|
|
||||||
#include "net/ssl/client_cert_store_nss.h"
|
|
||||||
#elif defined(OS_WIN)
|
|
||||||
#include "net/ssl/client_cert_store_win.h"
|
|
||||||
#elif defined(OS_MACOSX)
|
|
||||||
#include "net/ssl/client_cert_store_mac.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(ENABLE_PDF_VIEWER)
|
#if defined(ENABLE_PDF_VIEWER)
|
||||||
#include "atom/common/atom_constants.h"
|
#include "atom/common/atom_constants.h"
|
||||||
#include "base/strings/stringprintf.h"
|
#include "base/strings/stringprintf.h"
|
||||||
|
@ -130,21 +121,6 @@ AtomResourceDispatcherHostDelegate::CreateLoginDelegate(
|
||||||
return new LoginHandler(auth_info, request);
|
return new LoginHandler(auth_info, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<net::ClientCertStore>
|
|
||||||
AtomResourceDispatcherHostDelegate::CreateClientCertStore(
|
|
||||||
content::ResourceContext* resource_context) {
|
|
||||||
#if defined(USE_NSS_CERTS)
|
|
||||||
return std::make_unique<net::ClientCertStoreNSS>(
|
|
||||||
net::ClientCertStoreNSS::PasswordDelegateFactory());
|
|
||||||
#elif defined(OS_WIN)
|
|
||||||
return std::make_unique<net::ClientCertStoreWin>();
|
|
||||||
#elif defined(OS_MACOSX)
|
|
||||||
return std::make_unique<net::ClientCertStoreMac>();
|
|
||||||
#elif defined(USE_OPENSSL)
|
|
||||||
return std::unique_ptr<net::ClientCertStore>();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AtomResourceDispatcherHostDelegate::ShouldInterceptResourceAsStream(
|
bool AtomResourceDispatcherHostDelegate::ShouldInterceptResourceAsStream(
|
||||||
net::URLRequest* request,
|
net::URLRequest* request,
|
||||||
const std::string& mime_type,
|
const std::string& mime_type,
|
||||||
|
|
|
@ -22,8 +22,6 @@ class AtomResourceDispatcherHostDelegate
|
||||||
content::ResourceDispatcherHostLoginDelegate* CreateLoginDelegate(
|
content::ResourceDispatcherHostLoginDelegate* CreateLoginDelegate(
|
||||||
net::AuthChallengeInfo* auth_info,
|
net::AuthChallengeInfo* auth_info,
|
||||||
net::URLRequest* request) override;
|
net::URLRequest* request) override;
|
||||||
std::unique_ptr<net::ClientCertStore> CreateClientCertStore(
|
|
||||||
content::ResourceContext* resource_context) override;
|
|
||||||
bool ShouldInterceptResourceAsStream(net::URLRequest* request,
|
bool ShouldInterceptResourceAsStream(net::URLRequest* request,
|
||||||
const std::string& mime_type,
|
const std::string& mime_type,
|
||||||
GURL* origin,
|
GURL* origin,
|
||||||
|
|
Loading…
Add table
Reference in a new issue