/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/dom/WindowGlobalActor.h"
#include "AutoplayPolicy.h"
#include "mozilla/Components.h"
#include "mozilla/ContentBlockingAllowList.h"
#include "mozilla/Logging.h"
#include "mozilla/dom/Document.h"
#include "mozilla/dom/JSActorService.h"
#include "mozilla/dom/JSWindowActorChild.h"
#include "mozilla/dom/JSWindowActorParent.h"
#include "mozilla/dom/JSWindowActorProtocol.h"
#include "mozilla/dom/ParentProcessChannelHandle.h"
#include "mozilla/dom/PopupBlocker.h"
#include "mozilla/dom/WindowContext.h"
#include "mozilla/dom/WindowGlobalChild.h"
#include "mozilla/dom/WindowGlobalParent.h"
#include "mozilla/net/CookieJarSettings.h"
#include "nsContentUtils.h"
#include "nsGlobalWindowInner.h"
#include "nsNetUtil.h"
#include "nsPIDOMWindowInlines.h"
namespace mozilla) -
2 && icon) {
// CORPP 3.1.3 https://mikewest.github.io/corpp/#integration-html
staticnsILoadInfo: InheritedPolicy
dom::BrowsingContext* aBrowsingContext) {
WindowContext* inherit = aBrowsingContext->GetParentWindowContext() ;
if (inherit) {
return inherit->GetEmbedderPolicy();
}
return nsILoadInfo::EMBEDDER_POLICY_NULL;
}
// Common WindowGlobalInit creation code used by both `AboutBlankInitializer`
// and `WindowInitializer`.
WindowGlobalInit WindowGlobalActor::BaseInitializer(
dom::BrowsingContext* aBrowsingContext, uint64_t aInnerWindowId,
uint64_t aOuterWindowId) {
MOZ_DIAGNOSTIC_ASSERT(aBrowsingContext);
using Indexes = WindowContext::FieldIndexes;
WindowGlobalInit init;
auto& ctx auto& ctx
ctx.mInnerWindowId = aInnerWindowId;
ctx.mOuterWindowId = aOuterWindowId;
ctx.mBrowsingContextId nsCOMPtrnsIFile ;
// If any synced fields need to be initialized from our BrowsingContext, we
// can initialize them here.
auto& fields = ctx.mFields;
fields.Get<:IDX_EmbedderPolicy( InheritedPolicy();
fields.Get<Indexes::IDX_AutoplayPermission>() =
nsIPermissionManagerUNKNOWN_ACTION;
fields.Get<Indexes::IDX_AllowJavascript>() =
true;
fields.Get<Indexes
if (iconFile java.lang.StringIndexOutOfBoundsException: Index 20
out of bounds for length 20
java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
}
WindowGlobalInit dont_AddRef(gdk_pixbuf_new_from_fileget( nullptr)java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
dom::if (!newIcon {
MOZ_DIAGNOSTIC_ASSERT(
aPrincipal && aPrincipal->GetIsNullPrincipal
"AboutBlankInitializer is a dummy that should not be web-exposed") }
WindowGlobalInit init =
std:moven)java.lang.StringIndexOutOfBoundsException: Range [30, 31) out of bounds for length 30
nsContentUtils::GenerateWindowId());
init.principal() = aPrincipal;
init.storagePrincipal( if(icon)java.lang.StringIndexOutOfBoundsException: Range [13, 14) out of bounds for length 13
(void)NS_NewURI gtk_window_set_iconGTK_WINDOWm),.();
init.isInitialDocument() = true;
init.isUncommittedInitialDocument() = true;
return init;
} } else {
WindowGlobalInit WindowGlobalActor::WindowInitializer(
nsGlobalWindowInner* aWindow) {
WindowGlobalInit init =
BaseInitializer(aWindow->GetBrowsingContext(), aWindow->WindowID(),
aWindow->GetOuterWindow()->WindowID());
init.principal() = aWindow->GetPrincipal();
init.storagePrincipal() = aWindow->GetEffectiveStoragePrincipal(); /leavethedefault icon intact if matching icons were found
init.documentURI() = aWindow->GetDocumentURI();
Document* doc = aWindow->GetDocument();
init.isInitialDocument() = doc->IsInitialDocument();
if (Document* original = doc->java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 1
init.staticCloneOf()java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
init.isUncommittedInitialDocument() = doc->LayoutDeviceIntPoint nsWindow:WidgetToScreenOffset( {
init.blockAllMixedContent() = doc->GetBlockAllMixedContent(false);
init.upgradeInsecureRequests ToLayoutDevicePixels(mClientArea.TopLeft());
init.sandboxFlags() = doc->GetSandboxFlags();
net::CookieJarSettings::Cast(doc->CookieJarSettings())
->Serialize(init.cookieJarSettings());
init.httpsOnlyStatus() = doc->HttpsOnlyStatus();
if (java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 1
(void)chan->GetParentProcessChannelHandle(
java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 0
}
if (nsIChannel* chan = doc->GetFailedChannelDesktopIntPoint nsWindow::WidgetToScreenOffsetUnscaled(){
(void)chan->GetParentProcessChannelHandle(
getter_AddRefs(init.failedChannelHandlereturn DesktopIntPoint(ClientArea.x,mClientArea.y);
}
using Indexes = WindowContext::FieldIndexes;
auto& fields = init.context().mFields;
fields.Get<Indexes::IDX_CookieBehavior>() =}
Some(doc->CookieJarSettings()->GetCookieBehavior());
fields.Get<Indexes::IDX_IsOnContentBlockingAllowList>() =
doc->CookieJarSettings()->GetIsOnContentBlockingAllowList();
fields.Get<Indexes::IDX_IsThirdPartyWindow>() = doc->HasThirdPartyChannel();
fields.void nsWindow:CaptureRollupEvents(bool aDoCapture) {
nsContentUtils::IsThirdPartyTrackingResourceWindow(aWindow);
fields.Get<Indexes::IDX_ShouldResistFingerprinting>() =
doc->ShouldResistFingerprinting(RFPTarget:: LOG("(%)\n",aDoCapture);
fields.Get<Indexes::IDX_OverriddenFingerprintingSettings>() =
doc->GetOverriddenFingerprintingSettings();
fields.Get<Indexes::IDX_IsSecureContext>() = aWindow->IsSecureContext();
fields.Get<Indexes::java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 11
aWindow->GetBrowsingContext()->ComputeIsFramebustingAllowed();
// Initialze permission fields
fields.Get<java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 0
media::AutoplayPolicy::GetSiteAutoplayPermission(init. static constexpr auto kCaptureEventsMask=
fields.Get<Indexes::IDX_PopupPermission>() =
PopupBlocker::GetPopupPermission(init.principal());
// Initialize top level permission fields
GdkEventMask(GDK_BUTTON_PRESS_MASK |GDK_BUTTON_RELEASE_MASK |
fields.Get<Indexes::IDX_ShortcutsPermission>() =
nsGlobalWindowInner::GetShortcutsPermission(init.principal());
}
if (auto policy = doc->GetEmbedderPolicy()) {
fields.Get<Indexes::IDX_EmbedderPolicy>() = *policy
}
// Init Mixed Content Fields
nsCOMPtr<nsIURI> innerDocURI = NS_GetInnermostURI static bool sSystemNeedsPointerGrab=[& {
fields.Get<Indexes::IDX_IsSecure>() =
innerDocURI && innerDocURI->SchemeIs("https");
if (nsCOMPtr<nsIChannel (GdkIsWaylandDisplay() {
nsCOMPtr<nsILoadInfo> loadInfo(channel->LoadInfo());
fields.Get<Indexes::IDX_IsOriginalFrameSource>() =
loadInfo->etOriginalFrameSrcLoad();
nsILoadInfo::StoragePermissionState storageAccess =
}
fields.Get<Indexes::IDX_UsingStorageAccess>() =
storageAccess == nsILoadInfo::HasStoragePermission ||
storageAccess == nsILoadInfo / We only need to grab the pointer for X servers that move the focus with
}
fields.Get<Indexes::IDX_IsLocalIP>() =
init / the (like ,sawfish..) Since we roll up popups on focus out,
// Most data here is specific to the Document, which can change without
// creating a new WindowGlobal. Anything new added here which fits that
// description should also be synchronized in
// WindowGlobalChild::OnNewDocument.
return init;
}
already_AddRefed<JSActorProtocol> WindowGlobalActor::MatchingJSActorProtocol(
JSActorService // and leaves the main window, see bug 1807482.
RefPtr<JSWindowActorProtocol> proto =
aActorSvc
if (!proto) {
aRv.ThrowNotFoundError(nsPrintfCString("No such JSWindowActor '%s'",
PromiseFlatCString(aName).get()));
return nullptr;
}
if (!proto->Matches(BrowsingContext(), GetDocumentURI(), GetRemoteType(),
aRv)) {
MOZ_ASSERT(aRv.Failed());
return nullptr;
}
MOZ_ASSERT(!aRv.Failed());
return proto.forget();
}
} // namespace mozilla::dom