зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1374629 - Add mozilla::NotNull to mozilla::Encoding constant declarations. r=froydnj,hsivonen
MozReview-Commit-ID: s1sYrq6tqm --HG-- extra : rebase_source : 5803e385fcc5deb0f74304b304979227e374d07e
This commit is contained in:
Родитель
a30f1505c7
Коммит
7faf369167
|
@ -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) {
|
||||
|
|
|
@ -889,7 +889,7 @@ GetSubmitEncoding(nsGenericHTMLElement* aForm)
|
|||
if (doc) {
|
||||
return Encoding::ForName(doc->GetDocumentCharacterSet());
|
||||
}
|
||||
return WrapNotNull(UTF_8_ENCODING);
|
||||
return UTF_8_ENCODING;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -27,6 +27,7 @@ class Encoder;
|
|||
}; // namespace mozilla
|
||||
|
||||
#define ENCODING_RS_ENCODING mozilla::Encoding
|
||||
#define ENCODING_RS_NOT_NULL_CONST_ENCODING_PTR mozilla::NotNull<const mozilla::Encoding*>
|
||||
#define ENCODING_RS_ENCODER mozilla::Encoder
|
||||
#define ENCODING_RS_DECODER mozilla::Decoder
|
||||
|
||||
|
|
|
@ -4,11 +4,17 @@
|
|||
#include "gtest/gtest.h"
|
||||
|
||||
#include "mozilla/Encoding.h"
|
||||
#include <type_traits>
|
||||
|
||||
#define ENCODING_TEST(name) TEST(EncodingTest, name)
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
static_assert(std::is_trivially_copyable<NotNull<const Encoding*>>::value,
|
||||
"NotNull<const Encoding*> must be trivially copyable.");
|
||||
static_assert(std::is_standard_layout<NotNull<const Encoding*>>::value,
|
||||
"NotNull<const Encoding*> 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.
|
||||
|
|
Загрузка…
Ссылка в новой задаче