refactor: create request context from network context (#14656)
* [ci skip] refactor: create request context from network context * [ci skip] refactor: subscribe to mojo cookiemanager for cookie changes * [ci skip] refactor: manage the lifetime of custom URLRequestJobFactory * refactor: use OOP mojo proxy resolver * revert: add support for kIgnoreCertificateErrorsSPKIList * build: provide service manifest overlays for content services * chore: gn format * fix: log-net-log switch not working as expected * spec: verify proxy settings are respected from pac script with session.setProxy * chore: use chrome constants where possible * fix: initialize request context for global cert fetcher * refactor: fix destruction of request context getters * spec: use custom session for proxy tests * fix: queue up additional stop callbacks while net log is being stopped * fix: Add CHECK for cookie manager retrieval * chore: add helper to retrieve logging state for net log module * fix: ui::ResourceBundle::GetRawDataResourceForScale => GetRawDataResource * style: comment unused parameters * build: move //components/certificate_transparency deps from //brightray * chore: update gritsettings_resource_ids patch * chore: update api for chromium 68 * fix: net log instance is now a property of session
This commit is contained in:
parent
27bbf6a3c6
commit
434a6e3561
73 changed files with 2031 additions and 1844 deletions
|
@ -21,6 +21,7 @@
|
|||
#include "atom/browser/atom_resource_dispatcher_host_delegate.h"
|
||||
#include "atom/browser/atom_speech_recognition_manager_delegate.h"
|
||||
#include "atom/browser/child_web_contents_tracker.h"
|
||||
#include "atom/browser/io_thread.h"
|
||||
#include "atom/browser/native_window.h"
|
||||
#include "atom/browser/session_preferences.h"
|
||||
#include "atom/browser/web_contents_permission_helper.h"
|
||||
|
@ -32,6 +33,7 @@
|
|||
#include "base/command_line.h"
|
||||
#include "base/environment.h"
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/json/json_reader.h"
|
||||
#include "base/no_destructor.h"
|
||||
#include "base/stl_util.h"
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
|
@ -39,6 +41,7 @@
|
|||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "chrome/browser/printing/printing_message_filter.h"
|
||||
#include "chrome/browser/speech/tts_message_filter.h"
|
||||
#include "components/net_log/chrome_net_log.h"
|
||||
#include "content/public/browser/browser_ppapi_host.h"
|
||||
#include "content/public/browser/client_certificate_delegate.h"
|
||||
#include "content/public/browser/render_frame_host.h"
|
||||
|
@ -49,15 +52,19 @@
|
|||
#include "content/public/browser/web_contents.h"
|
||||
#include "content/public/common/content_paths.h"
|
||||
#include "content/public/common/content_switches.h"
|
||||
#include "content/public/common/service_names.mojom.h"
|
||||
#include "content/public/common/url_constants.h"
|
||||
#include "content/public/common/web_preferences.h"
|
||||
#include "device/geolocation/public/cpp/location_provider.h"
|
||||
#include "electron/buildflags/buildflags.h"
|
||||
#include "electron/grit/electron_resources.h"
|
||||
#include "net/base/escape.h"
|
||||
#include "net/ssl/ssl_cert_request_info.h"
|
||||
#include "ppapi/host/ppapi_host.h"
|
||||
#include "services/network/public/cpp/resource_request_body.h"
|
||||
#include "services/proxy_resolver/public/mojom/proxy_resolver.mojom.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
#include "ui/base/resource/resource_bundle.h"
|
||||
#include "v8/include/v8.h"
|
||||
|
||||
#if defined(USE_NSS_CERTS)
|
||||
|
@ -518,10 +525,44 @@ AtomBrowserClient::OverrideSystemLocationProvider() {
|
|||
#endif
|
||||
}
|
||||
|
||||
network::mojom::NetworkContextPtr AtomBrowserClient::CreateNetworkContext(
|
||||
content::BrowserContext* browser_context,
|
||||
bool /*in_memory*/,
|
||||
const base::FilePath& /*relative_partition_path*/) {
|
||||
if (!browser_context)
|
||||
return nullptr;
|
||||
return static_cast<AtomBrowserContext*>(browser_context)->GetNetworkContext();
|
||||
}
|
||||
|
||||
void AtomBrowserClient::RegisterOutOfProcessServices(
|
||||
OutOfProcessServiceMap* services) {
|
||||
(*services)[proxy_resolver::mojom::kProxyResolverServiceName] =
|
||||
base::ASCIIToUTF16("V8 Proxy Resolver");
|
||||
}
|
||||
|
||||
std::unique_ptr<base::Value> AtomBrowserClient::GetServiceManifestOverlay(
|
||||
base::StringPiece name) {
|
||||
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
|
||||
int id = -1;
|
||||
if (name == content::mojom::kBrowserServiceName)
|
||||
id = IDR_ELECTRON_CONTENT_BROWSER_MANIFEST_OVERLAY;
|
||||
else if (name == content::mojom::kPackagedServicesServiceName)
|
||||
id = IDR_ELECTRON_CONTENT_PACKAGED_SERVICES_MANIFEST_OVERLAY;
|
||||
|
||||
if (id == -1)
|
||||
return nullptr;
|
||||
|
||||
base::StringPiece manifest_contents = rb.GetRawDataResource(id);
|
||||
return base::JSONReader::Read(manifest_contents);
|
||||
}
|
||||
|
||||
net::NetLog* AtomBrowserClient::GetNetLog() {
|
||||
return AtomBrowserMainParts::Get()->net_log();
|
||||
}
|
||||
|
||||
brightray::BrowserMainParts* AtomBrowserClient::OverrideCreateBrowserMainParts(
|
||||
const content::MainFunctionParams&) {
|
||||
v8::V8::Initialize(); // Init V8 before creating main parts.
|
||||
return new AtomBrowserMainParts;
|
||||
const content::MainFunctionParams& params) {
|
||||
return new AtomBrowserMainParts(params);
|
||||
}
|
||||
|
||||
void AtomBrowserClient::WebNotificationAllowed(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue