From eee4e46aea64fbf882cb9dda2088a8a1082ed208 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 04:42:18 +0200 Subject: Merging upstream version 115.10.0esr. Signed-off-by: Daniel Baumann --- dom/base/Navigator.cpp | 3 +++ dom/media/MediaData.h | 12 ++++++++-- dom/media/webrtc/transport/test/ice_unittest.cpp | 19 ++++++++++------ .../featurepolicy/test/mochitest/mochitest.ini | 1 + .../test/mochitest/test_initial_aboutblank.html | 26 ++++++++++++++++++++++ 5 files changed, 52 insertions(+), 9 deletions(-) create mode 100644 dom/security/featurepolicy/test/mochitest/test_initial_aboutblank.html (limited to 'dom') diff --git a/dom/base/Navigator.cpp b/dom/base/Navigator.cpp index 151d992d6f..c4636f6d8b 100644 --- a/dom/base/Navigator.cpp +++ b/dom/base/Navigator.cpp @@ -167,6 +167,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Navigator) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mVRServiceTest) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSharePromise) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mXRSystem) + NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mClipboard) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END void Navigator::Invalidate() { @@ -246,6 +247,8 @@ void Navigator::Invalidate() { } mSharePromise = nullptr; + + mClipboard = nullptr; } void Navigator::GetUserAgent(nsAString& aUserAgent, CallerType aCallerType, diff --git a/dom/media/MediaData.h b/dom/media/MediaData.h index 4040f368ba..6b7e0ff84d 100644 --- a/dom/media/MediaData.h +++ b/dom/media/MediaData.h @@ -94,8 +94,16 @@ class AlignedBuffer { } AlignedBuffer& operator=(AlignedBuffer&& aOther) { - this->~AlignedBuffer(); - new (this) AlignedBuffer(std::move(aOther)); + if (&aOther == this) { + return *this; + } + mData = aOther.mData; + mLength = aOther.mLength; + mBuffer = std::move(aOther.mBuffer); + mCapacity = aOther.mCapacity; + aOther.mData = nullptr; + aOther.mLength = 0; + aOther.mCapacity = 0; return *this; } diff --git a/dom/media/webrtc/transport/test/ice_unittest.cpp b/dom/media/webrtc/transport/test/ice_unittest.cpp index d87fa0b0da..9931071d16 100644 --- a/dom/media/webrtc/transport/test/ice_unittest.cpp +++ b/dom/media/webrtc/transport/test/ice_unittest.cpp @@ -58,9 +58,9 @@ using namespace mozilla; static unsigned int kDefaultTimeout = 7000; -// TODO(nils@mozilla.com): This should get replaced with some non-external -// solution like discussed in bug 860775. -const std::string kDefaultStunServerHostname((char*)"stun.l.google.com"); +// TODO: It would be nice to have a test STUN/TURN server that can run with +// gtest. +const std::string kDefaultStunServerHostname((char*)""); const std::string kBogusStunServerHostname( (char*)"stun-server-nonexistent.invalid"); const uint16_t kDefaultStunServerPort = 19305; @@ -1576,12 +1576,17 @@ class WebRtcIceConnectTest : public StunTest { peer->SetMappingType(mapping_type_); peer->SetBlockUdp(block_udp_); } else if (setup_stun_servers) { - std::vector stun_servers; + if (stun_server_address_.empty()) { + InitTestStunServer(); + peer->UseTestStunServer(); + } else { + std::vector stun_servers; - stun_servers.push_back(*NrIceStunServer::Create( - stun_server_address_, kDefaultStunServerPort, kNrIceTransportUdp)); + stun_servers.push_back(*NrIceStunServer::Create( + stun_server_address_, kDefaultStunServerPort, kNrIceTransportUdp)); - peer->SetStunServers(stun_servers); + peer->SetStunServers(stun_servers); + } } } diff --git a/dom/security/featurepolicy/test/mochitest/mochitest.ini b/dom/security/featurepolicy/test/mochitest/mochitest.ini index 3c1850cc2e..22250e3303 100644 --- a/dom/security/featurepolicy/test/mochitest/mochitest.ini +++ b/dom/security/featurepolicy/test/mochitest/mochitest.ini @@ -9,3 +9,4 @@ support-files = [test_parser.html] fail-if = xorigin [test_featureList.html] +[test_initial_aboutblank.html] diff --git a/dom/security/featurepolicy/test/mochitest/test_initial_aboutblank.html b/dom/security/featurepolicy/test/mochitest/test_initial_aboutblank.html new file mode 100644 index 0000000000..79d1bfd4c4 --- /dev/null +++ b/dom/security/featurepolicy/test/mochitest/test_initial_aboutblank.html @@ -0,0 +1,26 @@ + + + + Test feature policy - Initial about:blank + + + + + + + + + -- cgit v1.2.3