Backed out changeset f00b7bf7b9f8 (bug 1196371) for build bustage CLOSED TREE

This commit is contained in:
Wes Kocher 2015-08-19 15:49:30 -07:00
parent 91184fe12b
commit 33bb841610
3 changed files with 6 additions and 25 deletions

View File

@ -19,7 +19,6 @@
#include "nsServiceManagerUtils.h"
#include "mozilla/dom/CSPDictionariesBinding.h"
#include "mozilla/dom/quota/QuotaManager.h"
#include "mozilla/dom/ToJSValue.h"
#include "mozilla/dom/URLSearchParams.h"
@ -35,13 +34,6 @@ OriginAttributes::CreateSuffix(nsACString& aStr) const
UniquePtr<URLParams> params(new URLParams());
nsAutoString value;
//
// Important: While serializing any string-valued attributes, perform a
// release-mode assertion to make sure that they don't contain characters that
// will break the quota manager when it uses the serialization for file
// naming (see addonId below).
//
if (mAppId != nsIScriptSecurityManager::NO_APP_ID) {
value.AppendInt(mAppId);
params->Set(NS_LITERAL_STRING("appId"), value);
@ -52,7 +44,6 @@ OriginAttributes::CreateSuffix(nsACString& aStr) const
}
if (!mAddonId.IsEmpty()) {
MOZ_RELEASE_ASSERT(mAddonId.FindCharInSet(dom::quota::QuotaManager::kReplaceChars) == kNotFound);
params->Set(NS_LITERAL_STRING("addonId"), mAddonId);
}
@ -69,13 +60,6 @@ OriginAttributes::CreateSuffix(nsACString& aStr) const
aStr.AppendLiteral("^");
aStr.Append(NS_ConvertUTF16toUTF8(value));
}
// In debug builds, check the whole string for illegal characters too (just in case).
#ifdef DEBUG
nsAutoCString str;
str.Assign(aStr);
MOZ_ASSERT(str.FindCharInSet(dom::quota::QuotaManager::kReplaceChars) == kNotFound);
#endif
}
namespace {

View File

@ -92,12 +92,6 @@ namespace mozilla {
namespace dom {
namespace quota {
// We want profiles to be platform-independent so we always need to replace
// the same characters on every platform. Windows has the most extensive set
// of illegal characters so we use its FILE_ILLEGAL_CHARACTERS and
// FILE_PATH_SEPARATOR.
const char QuotaManager::kReplaceChars[] = CONTROL_CHARACTERS "/:*?\"<>|\\";
namespace {
/*******************************************************************************
@ -1081,6 +1075,11 @@ public:
void
SanitizeOriginString(nsCString& aOrigin)
{
// We want profiles to be platform-independent so we always need to replace
// the same characters on every platform. Windows has the most extensive set
// of illegal characters so we use its FILE_ILLEGAL_CHARACTERS and
// FILE_PATH_SEPARATOR.
static const char kReplaceChars[] = CONTROL_CHARACTERS "/:*?\"<>|\\";
#ifdef XP_WIN
NS_ASSERTION(!strcmp(kReplaceChars,
@ -1088,7 +1087,7 @@ SanitizeOriginString(nsCString& aOrigin)
"Illegal file characters have changed!");
#endif
aOrigin.ReplaceChar(QuotaManager::kReplaceChars, '+');
aOrigin.ReplaceChar(kReplaceChars, '+');
}
bool

View File

@ -124,8 +124,6 @@ public:
NS_DECL_NSIQUOTAMANAGER
NS_DECL_NSIOBSERVER
static const char kReplaceChars[];
// Returns a non-owning reference.
static QuotaManager*
GetOrCreate();