Backed out changeset a1fb4230b8b8 (bug 1034916) for non-unified bustage.

CLOSED TREE
This commit is contained in:
Ryan VanderMeulen 2014-07-30 16:56:53 -04:00
parent 8e306d4ad6
commit 46ae15d477
2 changed files with 13 additions and 5 deletions

View File

@ -9,14 +9,22 @@
//==============================================================
class nsUTF8ConverterService;
namespace mozilla {
template<>
struct HasDangerousPublicDestructor<nsUTF8ConverterService>
{
static const bool value = true;
};
}
class nsUTF8ConverterService: public nsIUTF8ConverterService {
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIUTF8CONVERTERSERVICE
public:
nsUTF8ConverterService() {}
private:
virtual ~nsUTF8ConverterService() {}
};

View File

@ -80,9 +80,9 @@ nsCookie::Create(const nsACString &aName,
{
// Ensure mValue contains a valid UTF-8 sequence. Otherwise XPConnect will
// truncate the string after the first invalid octet.
nsRefPtr<nsUTF8ConverterService> converter = new nsUTF8ConverterService();
nsUTF8ConverterService converter;
nsAutoCString aUTF8Value;
converter->ConvertStringToUTF8(aValue, "UTF-8", false, true, 1, aUTF8Value);
converter.ConvertStringToUTF8(aValue, "UTF-8", false, true, 1, aUTF8Value);
// find the required string buffer size, adding 4 for the terminating nulls
const uint32_t stringLength = aName.Length() + aUTF8Value.Length() +