Bug 759257: Remove InfallableCopyCString [sic], r=hurley

This commit is contained in:
Brian Smith 2013-06-24 16:46:08 -07:00
parent 72fa33bb6e
commit c72dd4e458
5 changed files with 7 additions and 44 deletions

View File

@ -110,13 +110,6 @@ struct ParamTraits<nsHttpHeaderArray::nsEntry>
};
template<>
struct ParamTraits<mozilla::net::InfallableCopyCString>
: public ParamTraits<nsCString>
{
};
template<>
struct ParamTraits<nsHttpHeaderArray>
{

View File

@ -251,10 +251,10 @@ private:
const uint32_t mLoadFlags;
const bool mCacheForOfflineUse;
const bool mFallbackChannel;
const InfallableCopyCString mClientID;
const nsCString mClientID;
const nsCacheStoragePolicy mStoragePolicy;
const bool mUsingPrivateBrowsing;
const InfallableCopyCString mCacheKey;
const nsCString mCacheKey;
const nsCacheAccessMode mAccessToRequest;
const bool mNoWait;
const bool mUsingSSL;

View File

@ -14,36 +14,6 @@
#include "nsCOMPtr.h"
#include "nsString.h"
namespace mozilla { namespace net {
// A nsCString that aborts if it fails to successfully copy its input during
// copy construction and/or assignment. This is useful for building classes
// that are safely copy-constructable and safely assignable using the compiler-
// generated copy constructor and assignment operator.
class InfallableCopyCString : public nsCString
{
public:
InfallableCopyCString() { }
InfallableCopyCString(const nsACString & other)
: nsCString(other)
{
if (Length() != other.Length())
NS_RUNTIMEABORT("malloc");
}
InfallableCopyCString & operator=(const nsACString & other)
{
nsCString::operator=(other);
if (Length() != other.Length())
NS_RUNTIMEABORT("malloc");
return *this;
}
};
} } // namespace mozilla::net
class nsHttpHeaderArray
{
public:
@ -93,7 +63,7 @@ public:
struct nsEntry
{
nsHttpAtom header;
mozilla::net::InfallableCopyCString value;
nsCString value;
struct MatchHeader {
bool Equals(const nsEntry &entry, const nsHttpAtom &header) const {

View File

@ -67,7 +67,7 @@ private:
nsHttpHeaderArray mHeaders;
nsHttpAtom mMethod;
nsHttpVersion mVersion;
mozilla::net::InfallableCopyCString mRequestURI;
nsCString mRequestURI;
};
#endif // nsHttpRequestHead_h__

View File

@ -121,10 +121,10 @@ private:
nsHttpHeaderArray mHeaders;
nsHttpVersion mVersion;
uint16_t mStatus;
mozilla::net::InfallableCopyCString mStatusText;
nsCString mStatusText;
int64_t mContentLength;
mozilla::net::InfallableCopyCString mContentType;
mozilla::net::InfallableCopyCString mContentCharset;
nsCString mContentType;
nsCString mContentCharset;
bool mCacheControlNoStore;
bool mCacheControlNoCache;
bool mPragmaNoCache;