mirror of
https://github.com/electron/electron.git
synced 2026-05-02 03:00:22 -04:00
feat: HTTP preconnect feature minimal for electronjs (#18671)
This commit is contained in:
committed by
Jeremy Apthorp
parent
c57db7f163
commit
cddbddc543
@@ -11,6 +11,7 @@
|
||||
#include "base/command_line.h"
|
||||
#include "base/strings/string_split.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "components/network_hints/renderer/prescient_networking_dispatcher.h"
|
||||
#include "content/common/buildflags.h"
|
||||
#include "content/public/common/content_constants.h"
|
||||
#include "content/public/common/content_switches.h"
|
||||
@@ -201,6 +202,9 @@ void RendererClientBase::RenderThreadStarted() {
|
||||
blink::WebSecurityPolicy::RegisterURLSchemeAsAllowingServiceWorkers("file");
|
||||
blink::SchemeRegistry::RegisterURLSchemeAsSupportingFetchAPI("file");
|
||||
|
||||
prescient_networking_dispatcher_.reset(
|
||||
new network_hints::PrescientNetworkingDispatcher());
|
||||
|
||||
#if defined(OS_WIN)
|
||||
// Set ApplicationUserModelID in renderer process.
|
||||
base::string16 app_id =
|
||||
@@ -318,6 +322,10 @@ void RendererClientBase::DidSetUserAgent(const std::string& user_agent) {
|
||||
#endif
|
||||
}
|
||||
|
||||
blink::WebPrescientNetworking* RendererClientBase::GetPrescientNetworking() {
|
||||
return prescient_networking_dispatcher_.get();
|
||||
}
|
||||
|
||||
void RendererClientBase::RunScriptsAtDocumentStart(
|
||||
content::RenderFrame* render_frame) {
|
||||
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
|
||||
|
||||
Reference in New Issue
Block a user