feat: HTTP preconnect feature minimal for electronjs (#18671)

This commit is contained in:
Kuts Alexey 2019-08-26 19:47:32 +03:00 committed by Jeremy Apthorp
parent c57db7f163
commit cddbddc543
17 changed files with 377 additions and 1 deletions

View file

@ -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)