summaryrefslogtreecommitdiffstats
path: root/netwerk/ipc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
commitfbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 (patch)
tree4c1ccaf5486d4f2009f9a338a98a83e886e29c97 /netwerk/ipc
parentReleasing progress-linux version 124.0.1-1~progress7.99u1. (diff)
downloadfirefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.tar.xz
firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.zip
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'netwerk/ipc')
-rw-r--r--netwerk/ipc/DocumentLoadListener.cpp33
-rw-r--r--netwerk/ipc/DocumentLoadListener.h1
-rw-r--r--netwerk/ipc/NeckoChannelParams.ipdlh7
-rw-r--r--netwerk/ipc/NeckoMessageUtils.h14
-rw-r--r--netwerk/ipc/NeckoParent.cpp2
5 files changed, 37 insertions, 20 deletions
diff --git a/netwerk/ipc/DocumentLoadListener.cpp b/netwerk/ipc/DocumentLoadListener.cpp
index ca1f59e884..d849eab750 100644
--- a/netwerk/ipc/DocumentLoadListener.cpp
+++ b/netwerk/ipc/DocumentLoadListener.cpp
@@ -303,12 +303,12 @@ class ParentProcessDocumentOpenInfo final : public nsDocumentOpenInfo,
nsresult rv = nsDocumentOpenInfo::OnStartRequest(request);
- // If we didn't find a content handler,
- // and we don't have a listener, then just forward to our
- // default listener. This happens when the channel is in
- // an error state, and we want to just forward that on to be
- // handled in the content process.
- if (NS_SUCCEEDED(rv) && !mUsedContentHandler && !m_targetStreamListener) {
+ // If we didn't find a content handler, and we don't have a listener, then
+ // just forward to our default listener. This happens when the channel is in
+ // an error state, and we want to just forward that on to be handled in the
+ // content process, or when DONT_RETARGET is set.
+ if ((NS_SUCCEEDED(rv) || rv == NS_ERROR_WONT_HANDLE_CONTENT) &&
+ !mUsedContentHandler && !m_targetStreamListener) {
m_targetStreamListener = mListener;
return m_targetStreamListener->OnStartRequest(request);
}
@@ -340,6 +340,17 @@ class ParentProcessDocumentOpenInfo final : public nsDocumentOpenInfo,
nsresult OnObjectStartRequest(nsIRequest* request) {
LOG(("ParentProcessDocumentOpenInfo OnObjectStartRequest [this=%p]", this));
+
+ // If this load will be treated as a document load, run through
+ // nsDocumentOpenInfo for consistency with other document loads.
+ //
+ // If the dom.navigation.object_embed.allow_retargeting pref is enabled,
+ // this may lead to the resource being downloaded.
+ if (nsCOMPtr<nsIChannel> channel = do_QueryInterface(request);
+ channel && channel->IsDocument()) {
+ return OnDocumentStartRequest(request);
+ }
+
// Just redirect to the nsObjectLoadingContent in the content process.
m_targetStreamListener = mListener;
return m_targetStreamListener->OnStartRequest(request);
@@ -815,11 +826,9 @@ auto DocumentLoadListener::Open(nsDocShellLoadState* aLoadState,
}
// Recalculate the openFlags, matching the logic in use in Content process.
- // NOTE: The only case not handled here to mirror Content process is
- // redirecting to re-use the channel.
MOZ_ASSERT(!aLoadState->GetPendingRedirectedChannel());
- uint32_t openFlags =
- nsDocShell::ComputeURILoaderFlags(loadingContext, aLoadState->LoadType());
+ uint32_t openFlags = nsDocShell::ComputeURILoaderFlags(
+ loadingContext, aLoadState->LoadType(), mIsDocumentLoad);
RefPtr<ParentProcessDocumentOpenInfo> openInfo =
new ParentProcessDocumentOpenInfo(mParentChannelListener, openFlags,
@@ -2377,8 +2386,8 @@ bool DocumentLoadListener::MaybeHandleLoadErrorWithURIFixup(nsresult aStatus) {
// we can downgrade the scheme to HTTP again.
bool isHTTPSFirstFixup = false;
if (!newURI) {
- newURI = nsHTTPSOnlyUtils::PotentiallyDowngradeHttpsFirstRequest(mChannel,
- aStatus);
+ newURI =
+ nsHTTPSOnlyUtils::PotentiallyDowngradeHttpsFirstRequest(this, aStatus);
isHTTPSFirstFixup = true;
}
diff --git a/netwerk/ipc/DocumentLoadListener.h b/netwerk/ipc/DocumentLoadListener.h
index 98aacc98f8..a8e4ffa7ab 100644
--- a/netwerk/ipc/DocumentLoadListener.h
+++ b/netwerk/ipc/DocumentLoadListener.h
@@ -300,6 +300,7 @@ class DocumentLoadListener : public nsIInterfaceRequestor,
uint32_t GetLoadType() const { return mLoadStateLoadType; }
bool IsDownload() const { return mIsDownload; }
bool IsLoadingJSURI() const { return mIsLoadingJSURI; }
+ nsDOMNavigationTiming* GetTiming() { return mTiming; }
mozilla::dom::LoadingSessionHistoryInfo* GetLoadingSessionHistoryInfo() {
return mLoadingSessionHistoryInfo.get();
diff --git a/netwerk/ipc/NeckoChannelParams.ipdlh b/netwerk/ipc/NeckoChannelParams.ipdlh
index 44af8d4808..c2948c7766 100644
--- a/netwerk/ipc/NeckoChannelParams.ipdlh
+++ b/netwerk/ipc/NeckoChannelParams.ipdlh
@@ -420,6 +420,7 @@ struct HttpConnectionInfoCloneArgs
nsCString topWindowOrigin;
bool isHttp3;
bool webTransport;
+ uint64_t webTransportId;
bool hasIPHintAddress;
nsCString echConfig;
ProxyInfoCloneArgs[] proxyInfo;
@@ -454,6 +455,12 @@ struct CookieStruct
uint8_t schemeMap;
};
+struct CookieStructTable
+{
+ OriginAttributes attrs;
+ CookieStruct[] cookies;
+};
+
struct DocumentCreationArgs {
bool uriModified;
bool isEmbeddingBlockedError;
diff --git a/netwerk/ipc/NeckoMessageUtils.h b/netwerk/ipc/NeckoMessageUtils.h
index a15398330e..a0729a94a0 100644
--- a/netwerk/ipc/NeckoMessageUtils.h
+++ b/netwerk/ipc/NeckoMessageUtils.h
@@ -10,15 +10,15 @@
#include "ipc/EnumSerializer.h"
#include "ipc/IPCMessageUtils.h"
+#include "ipc/IPCMessageUtilsSpecializations.h"
+#include "mozilla/net/DNS.h"
#include "nsExceptionHandler.h"
+#include "nsIDNSService.h"
#include "nsIHttpChannel.h"
+#include "nsITRRSkipReason.h"
#include "nsPrintfCString.h"
#include "nsString.h"
#include "prio.h"
-#include "mozilla/net/DNS.h"
-#include "ipc/IPCMessageUtilsSpecializations.h"
-#include "nsITRRSkipReason.h"
-#include "nsIDNSService.h"
namespace IPC {
@@ -92,9 +92,9 @@ struct ParamTraits<mozilla::net::NetAddr> {
#endif
} else {
if (XRE_IsParentProcess()) {
- nsPrintfCString msg("%d", aParam.raw.family);
- CrashReporter::AnnotateCrashReport(
- CrashReporter::Annotation::UnknownNetAddrSocketFamily, msg);
+ CrashReporter::RecordAnnotationU32(
+ CrashReporter::Annotation::UnknownNetAddrSocketFamily,
+ aParam.raw.family);
}
MOZ_CRASH("Unknown socket family");
diff --git a/netwerk/ipc/NeckoParent.cpp b/netwerk/ipc/NeckoParent.cpp
index 102b46a378..727aea4660 100644
--- a/netwerk/ipc/NeckoParent.cpp
+++ b/netwerk/ipc/NeckoParent.cpp
@@ -123,7 +123,7 @@ const char* NeckoParent::GetValidatedOriginAttributes(
if (!aSerialized.IsNotNull()) {
// If serialized is null, we cannot validate anything. We have to assume
// that this requests comes from a SystemPrincipal.
- aAttrs = OriginAttributes(false);
+ aAttrs = OriginAttributes();
} else {
aAttrs = aSerialized.mOriginAttributes;
}