summaryrefslogtreecommitdiffstats
path: root/src/core/net
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/net')
-rw-r--r--src/core/net/client_cert_override.cpp10
-rw-r--r--src/core/net/custom_url_loader_factory.cpp4
-rw-r--r--src/core/net/plugin_response_interceptor_url_loader_throttle.cpp10
-rw-r--r--src/core/net/proxying_restricted_cookie_manager_qt.cpp12
-rw-r--r--src/core/net/proxying_restricted_cookie_manager_qt.h3
-rw-r--r--src/core/net/proxying_url_loader_factory_qt.cpp6
-rw-r--r--src/core/net/system_network_context_manager.cpp21
-rw-r--r--src/core/net/webui_controller_factory_qt.cpp8
8 files changed, 47 insertions, 27 deletions
diff --git a/src/core/net/client_cert_override.cpp b/src/core/net/client_cert_override.cpp
index 875918c57..f79aae482 100644
--- a/src/core/net/client_cert_override.cpp
+++ b/src/core/net/client_cert_override.cpp
@@ -24,11 +24,11 @@
#include "net/ssl/client_cert_store_nss.h"
#endif
-#if defined(OS_WIN)
+#if defined(Q_OS_WIN)
#include "net/ssl/client_cert_store_win.h"
#endif
-#if defined(OS_MAC)
+#if BUILDFLAG(IS_MAC)
#include "net/ssl/client_cert_store_mac.h"
#endif
@@ -46,7 +46,7 @@ public:
std::move(private_key_callback).Run(m_key);
}
-#if defined(OS_MAC)
+#if BUILDFLAG(IS_MAC)
SecIdentityRef sec_identity_ref() const override
{
return nullptr;
@@ -125,9 +125,9 @@ std::unique_ptr<net::ClientCertStore> ClientCertOverrideStore::createNativeStore
{
#if defined(USE_NSS_CERTS)
return std::unique_ptr<net::ClientCertStore>(new net::ClientCertStoreNSS(net::ClientCertStoreNSS::PasswordDelegateFactory()));
-#elif defined(OS_WIN)
+#elif defined(Q_OS_WIN)
return std::unique_ptr<net::ClientCertStore>(new net::ClientCertStoreWin());
-#elif defined(OS_MAC)
+#elif BUILDFLAG(IS_MAC)
return std::unique_ptr<net::ClientCertStore>(new net::ClientCertStoreMac());
#else
return nullptr;
diff --git a/src/core/net/custom_url_loader_factory.cpp b/src/core/net/custom_url_loader_factory.cpp
index a41ece61b..e06d55373 100644
--- a/src/core/net/custom_url_loader_factory.cpp
+++ b/src/core/net/custom_url_loader_factory.cpp
@@ -286,7 +286,7 @@ private:
m_head->mime_type = m_mimeType;
m_head->charset = m_charset;
m_headerBytesRead = m_head->headers->raw_headers().length();
- m_client->OnReceiveResponse(std::move(m_head));
+ m_client->OnReceiveResponse(std::move(m_head), mojo::ScopedDataPipeConsumerHandle());
m_client->OnStartLoadingResponseBody(std::move(m_pipeConsumerHandle));
m_head = nullptr;
@@ -338,7 +338,7 @@ private:
m_head->headers = base::MakeRefCounted<net::HttpResponseHeaders>(net::HttpUtil::AssembleRawHeaders(headers));
m_head->encoded_data_length = m_head->headers->raw_headers().length();
m_head->content_length = m_head->encoded_body_length = -1;
- m_client->OnReceiveResponse(std::move(m_head));
+ m_client->OnReceiveResponse(std::move(m_head), mojo::ScopedDataPipeConsumerHandle());
CompleteWithFailure(net::Error(error));
}
void notifyReadyRead() override
diff --git a/src/core/net/plugin_response_interceptor_url_loader_throttle.cpp b/src/core/net/plugin_response_interceptor_url_loader_throttle.cpp
index e0e9bc80a..2a063cd7c 100644
--- a/src/core/net/plugin_response_interceptor_url_loader_throttle.cpp
+++ b/src/core/net/plugin_response_interceptor_url_loader_throttle.cpp
@@ -28,6 +28,7 @@
#include "web_engine_settings.h"
#include <string>
+#include <tuple>
namespace QtWebEngineCore {
@@ -81,7 +82,7 @@ void PluginResponseInterceptorURLLoaderThrottle::WillProcessResponse(const GURL
std::string payload = view_id;
mojo::PendingRemote<network::mojom::URLLoader> dummy_new_loader;
- ignore_result(dummy_new_loader.InitWithNewPipeAndPassReceiver());
+ std::ignore = dummy_new_loader.InitWithNewPipeAndPassReceiver();
mojo::Remote<network::mojom::URLLoaderClient> new_client;
mojo::PendingReceiver<network::mojom::URLLoaderClient> new_client_receiver =
new_client.BindNewPipeAndPassReceiver();
@@ -115,9 +116,11 @@ void PluginResponseInterceptorURLLoaderThrottle::WillProcessResponse(const GURL
mojo::PendingRemote<network::mojom::URLLoader> original_loader;
mojo::PendingReceiver<network::mojom::URLLoaderClient> original_client;
+ mojo::ScopedDataPipeConsumerHandle body;
delegate_->InterceptResponse(std::move(dummy_new_loader),
- std::move(new_client_receiver), &original_loader,
- &original_client);
+ std::move(new_client_receiver),
+ &original_loader, &original_client,
+ &body);
// Make a deep copy of URLResponseHead before passing it cross-thread.
auto deep_copied_response = response_head->Clone();
@@ -135,6 +138,7 @@ void PluginResponseInterceptorURLLoaderThrottle::WillProcessResponse(const GURL
transferrable_loader->url_loader_client = std::move(original_client);
transferrable_loader->head = std::move(deep_copied_response);
transferrable_loader->head->intercepted_by_plugin = true;
+ transferrable_loader->body = std::move(body);
bool embedded = m_request_destination !=
network::mojom::RequestDestination::kDocument;
diff --git a/src/core/net/proxying_restricted_cookie_manager_qt.cpp b/src/core/net/proxying_restricted_cookie_manager_qt.cpp
index 0109f5697..02de152fa 100644
--- a/src/core/net/proxying_restricted_cookie_manager_qt.cpp
+++ b/src/core/net/proxying_restricted_cookie_manager_qt.cpp
@@ -69,12 +69,14 @@ void ProxyingRestrictedCookieManagerQt::GetAllForUrl(const GURL &url,
const net::SiteForCookies &site_for_cookies,
const url::Origin &top_frame_origin,
network::mojom::CookieManagerGetOptionsPtr options,
+ bool partitioned_cookies_runtime_feature_enabled,
GetAllForUrlCallback callback)
{
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
if (allowCookies(url, site_for_cookies)) {
- underlying_restricted_cookie_manager_->GetAllForUrl(url, site_for_cookies, top_frame_origin, std::move(options), std::move(callback));
+ underlying_restricted_cookie_manager_->GetAllForUrl(url, site_for_cookies, top_frame_origin, std::move(options),
+ partitioned_cookies_runtime_feature_enabled, std::move(callback));
} else {
std::move(callback).Run(std::vector<net::CookieWithAccessResult>());
}
@@ -109,12 +111,14 @@ void ProxyingRestrictedCookieManagerQt::SetCookieFromString(const GURL &url,
const net::SiteForCookies &site_for_cookies,
const url::Origin &top_frame_origin,
const std::string &cookie,
+ bool partitioned_cookies_runtime_feature_enabled,
SetCookieFromStringCallback callback)
{
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
if (allowCookies(url, site_for_cookies)) {
- underlying_restricted_cookie_manager_->SetCookieFromString(url, site_for_cookies, top_frame_origin, cookie, std::move(callback));
+ underlying_restricted_cookie_manager_->SetCookieFromString(url, site_for_cookies, top_frame_origin, cookie,
+ partitioned_cookies_runtime_feature_enabled, std::move(callback));
} else {
std::move(callback).Run();
}
@@ -123,12 +127,14 @@ void ProxyingRestrictedCookieManagerQt::SetCookieFromString(const GURL &url,
void ProxyingRestrictedCookieManagerQt::GetCookiesString(const GURL &url,
const net::SiteForCookies &site_for_cookies,
const url::Origin &top_frame_origin,
+ bool partitioned_cookies_runtime_feature_enabled,
GetCookiesStringCallback callback)
{
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
if (allowCookies(url, site_for_cookies)) {
- underlying_restricted_cookie_manager_->GetCookiesString(url, site_for_cookies, top_frame_origin, std::move(callback));
+ underlying_restricted_cookie_manager_->GetCookiesString(url, site_for_cookies, top_frame_origin,
+ partitioned_cookies_runtime_feature_enabled, std::move(callback));
} else {
std::move(callback).Run("");
}
diff --git a/src/core/net/proxying_restricted_cookie_manager_qt.h b/src/core/net/proxying_restricted_cookie_manager_qt.h
index 7b897e5a4..bd7bc300f 100644
--- a/src/core/net/proxying_restricted_cookie_manager_qt.h
+++ b/src/core/net/proxying_restricted_cookie_manager_qt.h
@@ -28,6 +28,7 @@ public:
const net::SiteForCookies &site_for_cookies,
const url::Origin &top_frame_origin,
network::mojom::CookieManagerGetOptionsPtr options,
+ bool partitioned_cookies_runtime_feature_enabled,
GetAllForUrlCallback callback) override;
void SetCanonicalCookie(const net::CanonicalCookie& cookie,
const GURL &url,
@@ -43,10 +44,12 @@ public:
const net::SiteForCookies &site_for_cookies,
const url::Origin &top_frame_origin,
const std::string &cookie,
+ bool partitioned_cookies_runtime_feature_enabled,
SetCookieFromStringCallback callback) override;
void GetCookiesString(const GURL &url,
const net::SiteForCookies &site_for_cookies,
const url::Origin &top_frame_origin,
+ bool partitioned_cookies_runtime_feature_enabled,
GetCookiesStringCallback callback) override;
void CookiesEnabledFor(const GURL &url,
const net::SiteForCookies &site_for_cookies,
diff --git a/src/core/net/proxying_url_loader_factory_qt.cpp b/src/core/net/proxying_url_loader_factory_qt.cpp
index 43fba5583..a4713150b 100644
--- a/src/core/net/proxying_url_loader_factory_qt.cpp
+++ b/src/core/net/proxying_url_loader_factory_qt.cpp
@@ -86,7 +86,7 @@ public:
void Restart();
// network::mojom::URLLoaderClient
- void OnReceiveResponse(network::mojom::URLResponseHeadPtr head) override;
+ void OnReceiveResponse(network::mojom::URLResponseHeadPtr head, mojo::ScopedDataPipeConsumerHandle) override;
void OnReceiveRedirect(const net::RedirectInfo &redirect_info, network::mojom::URLResponseHeadPtr head) override;
void OnUploadProgress(int64_t current_position, int64_t total_size, OnUploadProgressCallback callback) override;
void OnReceiveCachedMetadata(mojo_base::BigBuffer data) override;
@@ -376,11 +376,11 @@ void InterceptedRequest::ContinueAfterIntercept()
// URLLoaderClient methods.
-void InterceptedRequest::OnReceiveResponse(network::mojom::URLResponseHeadPtr head)
+void InterceptedRequest::OnReceiveResponse(network::mojom::URLResponseHeadPtr head, mojo::ScopedDataPipeConsumerHandle handle)
{
current_response_ = head.Clone();
- target_client_->OnReceiveResponse(std::move(head));
+ target_client_->OnReceiveResponse(std::move(head), std::move(handle));
}
void InterceptedRequest::OnReceiveRedirect(const net::RedirectInfo &redirect_info, network::mojom::URLResponseHeadPtr head)
diff --git a/src/core/net/system_network_context_manager.cpp b/src/core/net/system_network_context_manager.cpp
index a804ff8f7..beafa6a6d 100644
--- a/src/core/net/system_network_context_manager.cpp
+++ b/src/core/net/system_network_context_manager.cpp
@@ -39,7 +39,7 @@ network::mojom::HttpAuthStaticParamsPtr CreateHttpAuthStaticParams()
{
network::mojom::HttpAuthStaticParamsPtr auth_static_params = network::mojom::HttpAuthStaticParams::New();
- auth_static_params->supported_schemes = { "basic", "digest", "ntlm", "negotiate" };
+ auth_static_params->allowed_schemes = { "basic", "digest", "ntlm", "negotiate" };
return auth_static_params;
}
@@ -186,22 +186,33 @@ void SystemNetworkContextManager::OnNetworkServiceCreated(network::mojom::Networ
network_service->ConfigureHttpAuthPrefs(CreateHttpAuthDynamicParams());
// Configure the Certificate Transparency logs.
- std::vector<std::pair<std::string, base::TimeDelta>> disqualified_logs =
+ std::vector<std::pair<std::string, base::Time>> disqualified_logs =
certificate_transparency::GetDisqualifiedLogs();
std::vector<network::mojom::CTLogInfoPtr> log_list_mojo;
for (const auto &ct_log : certificate_transparency::GetKnownLogs()) {
network::mojom::CTLogInfoPtr log_info = network::mojom::CTLogInfo::New();
log_info->public_key = std::string(ct_log.log_key, ct_log.log_key_length);
+ log_info->id = crypto::SHA256HashString(log_info->public_key);
log_info->name = ct_log.log_name;
+ log_info->current_operator = ct_log.current_operator;
- std::string log_id = crypto::SHA256HashString(log_info->public_key);
auto it = std::lower_bound(
- std::begin(disqualified_logs), std::end(disqualified_logs), log_id,
+ std::begin(disqualified_logs), std::end(disqualified_logs), log_info->id,
[](const auto& disqualified_log, const std::string& log_id) {
return disqualified_log.first < log_id;
});
- if (it != std::end(disqualified_logs) && it->first == log_id)
+ if (it != std::end(disqualified_logs) && it->first == log_info->id)
log_info->disqualified_at = it->second;
+
+ for (size_t i = 0; i < ct_log.previous_operators_length; i++) {
+ const auto& op = ct_log.previous_operators[i];
+ network::mojom::PreviousOperatorEntryPtr previous_operator =
+ network::mojom::PreviousOperatorEntry::New();
+ previous_operator->name = op.name;
+ previous_operator->end_time = op.end_time;
+ log_info->previous_operators.push_back(std::move(previous_operator));
+ }
+
log_list_mojo.push_back(std::move(log_info));
}
network_service->UpdateCtLogList(
diff --git a/src/core/net/webui_controller_factory_qt.cpp b/src/core/net/webui_controller_factory_qt.cpp
index acb0b3fcc..68bbb42fa 100644
--- a/src/core/net/webui_controller_factory_qt.cpp
+++ b/src/core/net/webui_controller_factory_qt.cpp
@@ -17,7 +17,6 @@
#include "chrome/browser/ui/webui/device_log_ui.h"
#include "chrome/browser/ui/webui/devtools_ui.h"
#include "chrome/browser/ui/webui/net_internals/net_internals_ui.h"
-#include "chrome/browser/ui/webui/quota_internals/quota_internals_ui.h"
#include "chrome/browser/ui/webui/user_actions/user_actions_ui.h"
#include "chrome/common/url_constants.h"
#include "content/public/browser/web_ui.h"
@@ -27,7 +26,7 @@
#include "printing/buildflags/buildflags.h"
#include "url/gurl.h"
-#if defined(OS_LINUX) || defined(OS_ANDROID)
+#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX)
#include "chrome/browser/ui/webui/sandbox/sandbox_internals_ui.h"
#endif
@@ -93,9 +92,6 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI *web_ui, Profile *profile, co
if (url.host() == chrome::kChromeUINetInternalsHost)
return &NewWebUI<NetInternalsUI>;
- if (url.host() == chrome::kChromeUIQuotaInternalsHost)
- return &NewWebUI<QuotaInternalsUI>;
-
if (url.SchemeIs(content::kChromeDevToolsScheme)) {
// if (!DevToolsUIBindings::IsValidFrontendURL(url))
// return nullptr;
@@ -131,7 +127,7 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI *web_ui, Profile *profile, co
if (url.host_piece() == chrome::kChromeUIWebRtcLogsHost)
return &NewWebUI<WebRtcLogsUI>;
#endif
-#if defined(OS_LINUX) || defined(OS_ANDROID)
+#if BUILDFLAG(IS_LINUX) // Consider enabling for BUILDFLAG(IS_WIN)
if (url.host_piece() == chrome::kChromeUISandboxHost)
return &NewWebUI<SandboxInternalsUI>;
#endif