Files
palemoon27/dom/base/PostMessageEvent.h
T
roytam1 6e01dc26a1 import changes from `dev' branch of rmottola/Arctic-Fox:
- Bug 1199466 - part 1 - Expose originAttributes in nsICookie, r=jduell (a2273aad63)
- Bug 1216150 - Split xpc::InitGlobalObject into an options-setting component and a global-object-modifying component, with the options-setting component being called before global object creation in all callers. r=bz (5393e6a522)
- Bug 1139849 - postMessage to incorrect target domain should print a console security error r=bz (df179f78cf)
- Bug 920169 - Remove references to C++ constants in Histograms.json. r=gfritzsche (4f287dfbd9)
- Bug 1234526 - Don't track healthreport.sqlite statements from Telemetry. r=gfritzsche (aaf0e88c25)
- Bug 1241508 - Have TelemetryImpl::RecordIceCandidates check for mCanRecordExtended. r=drno (9729fdd17b)
2023-12-15 13:57:16 +08:00

55 lines
1.5 KiB
C++

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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/. */
#ifndef mozilla_dom_PostMessageEvent_h
#define mozilla_dom_PostMessageEvent_h
#include "mozilla/dom/StructuredCloneHolder.h"
#include "nsCOMPtr.h"
#include "mozilla/RefPtr.h"
#include "nsTArray.h"
#include "nsThreadUtils.h"
class nsGlobalWindow;
class nsIPrincipal;
class nsPIDOMWindow;
namespace mozilla {
namespace dom {
/**
* Class used to represent events generated by calls to Window.postMessage,
* which asynchronously creates and dispatches events.
*/
class PostMessageEvent final : public nsRunnable
, public StructuredCloneHolder
{
public:
NS_DECL_NSIRUNNABLE
PostMessageEvent(nsGlobalWindow* aSource,
const nsAString& aCallerOrigin,
nsGlobalWindow* aTargetWindow,
nsIPrincipal* aProvidedPrincipal,
nsIDocument* aSourceDocument,
bool aTrustedCaller);
private:
~PostMessageEvent();
RefPtr<nsGlobalWindow> mSource;
nsString mCallerOrigin;
RefPtr<nsGlobalWindow> mTargetWindow;
nsCOMPtr<nsIPrincipal> mProvidedPrincipal;
nsCOMPtr<nsIDocument> mSourceDocument;
bool mTrustedCaller;
};
} // namespace dom
} // namespace mozilla
#endif // mozilla_dom_PostMessageEvent_h