diff --git a/dom/base/FormData.cpp b/dom/base/FormData.cpp index 9ad3da915a41..2370fb3bac44 100644 --- a/dom/base/FormData.cpp +++ b/dom/base/FormData.cpp @@ -18,7 +18,7 @@ using namespace mozilla; using namespace mozilla::dom; FormData::FormData(nsISupports* aOwner) - : HTMLFormSubmission(WrapNotNull(UTF_8_ENCODING), nullptr) + : HTMLFormSubmission(UTF_8_ENCODING, nullptr) , mOwner(aOwner) { } @@ -402,7 +402,7 @@ NS_IMETHODIMP FormData::GetSendInfo(nsIInputStream** aBody, uint64_t* aContentLength, nsACString& aContentTypeWithCharset, nsACString& aCharset) { - FSMultipartFormData fs(WrapNotNull(UTF_8_ENCODING), nullptr); + FSMultipartFormData fs(UTF_8_ENCODING, nullptr); for (uint32_t i = 0; i < mFormData.Length(); ++i) { if (mFormData[i].wasNullBlob) { diff --git a/dom/html/HTMLFormSubmission.cpp b/dom/html/HTMLFormSubmission.cpp index ad8acd0f44a6..0f62eecb5b80 100644 --- a/dom/html/HTMLFormSubmission.cpp +++ b/dom/html/HTMLFormSubmission.cpp @@ -889,7 +889,7 @@ GetSubmitEncoding(nsGenericHTMLElement* aForm) if (doc) { return Encoding::ForName(doc->GetDocumentCharacterSet()); } - return WrapNotNull(UTF_8_ENCODING); + return UTF_8_ENCODING; } void diff --git a/intl/Encoding.h b/intl/Encoding.h index ef2f8b68cea5..123dee9aedcc 100644 --- a/intl/Encoding.h +++ b/intl/Encoding.h @@ -27,6 +27,7 @@ class Encoder; }; // namespace mozilla #define ENCODING_RS_ENCODING mozilla::Encoding +#define ENCODING_RS_NOT_NULL_CONST_ENCODING_PTR mozilla::NotNull #define ENCODING_RS_ENCODER mozilla::Encoder #define ENCODING_RS_DECODER mozilla::Decoder diff --git a/intl/gtest/TestEncoding.cpp b/intl/gtest/TestEncoding.cpp index 8c710c293b0a..a8d5d59c226f 100644 --- a/intl/gtest/TestEncoding.cpp +++ b/intl/gtest/TestEncoding.cpp @@ -4,11 +4,15 @@ #include "gtest/gtest.h" #include "mozilla/Encoding.h" +#include #define ENCODING_TEST(name) TEST(EncodingTest, name) using namespace mozilla; +static_assert(std::is_standard_layout>::value, + "NotNull must be a standard layout type."); + // These tests mainly test that the C++ interface seems to // reach the Rust code. More thorough testing of the back // end is done in Rust.