mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-28 05:10:49 +00:00
Backout of bug 611503 because Android has some weird string code
This commit is contained in:
parent
12e76a497d
commit
396ec9d7bf
@ -8120,7 +8120,7 @@ nsDOMStringMapSH::Enumerate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
for (PRUint32 i = 0; i < properties.Length(); ++i) {
|
||||
nsString& prop(properties[i]);
|
||||
nsDependentString prop(properties[i]);
|
||||
*_retval = JS_DefineUCProperty(cx, obj, prop.get(), prop.Length(),
|
||||
JSVAL_VOID, nsnull, nsnull,
|
||||
JSPROP_ENUMERATE | JSPROP_SHARED);
|
||||
|
@ -922,7 +922,8 @@ nsCSSValue::AppendToString(nsCSSProperty aProperty, nsAString& aResult) const
|
||||
aResult.Append(NS_LITERAL_STRING("-moz-element(#"));
|
||||
nsAutoString tmpStr;
|
||||
GetStringValue(tmpStr);
|
||||
nsStyleUtil::AppendEscapedCSSIdent(tmpStr, aResult);
|
||||
nsStyleUtil::AppendEscapedCSSIdent(
|
||||
nsDependentString(tmpStr), aResult);
|
||||
aResult.Append(NS_LITERAL_STRING(")"));
|
||||
}
|
||||
else if (eCSSUnit_Percent == unit) {
|
||||
|
@ -95,9 +95,8 @@ CookieServiceParent::RecvSetCookieString(const IPC::URI& aHost,
|
||||
if (!hostURI)
|
||||
return false;
|
||||
|
||||
nsDependentCString cookieString(aCookieString, 0);
|
||||
mCookieService->SetCookieStringInternal(hostURI, aIsForeign,
|
||||
cookieString, aServerTime,
|
||||
aCookieString, aServerTime,
|
||||
aFromHttp);
|
||||
return true;
|
||||
}
|
||||
|
@ -1493,11 +1493,11 @@ nsCookieService::SetCookieStringCommon(nsIURI *aHostURI,
|
||||
}
|
||||
|
||||
void
|
||||
nsCookieService::SetCookieStringInternal(nsIURI *aHostURI,
|
||||
bool aIsForeign,
|
||||
nsDependentCString &aCookieHeader,
|
||||
const nsCString &aServerTime,
|
||||
PRBool aFromHttp)
|
||||
nsCookieService::SetCookieStringInternal(nsIURI *aHostURI,
|
||||
bool aIsForeign,
|
||||
const nsCString &aCookieHeader,
|
||||
const nsCString &aServerTime,
|
||||
PRBool aFromHttp)
|
||||
{
|
||||
NS_ASSERTION(aHostURI, "null host!");
|
||||
|
||||
@ -1550,8 +1550,9 @@ nsCookieService::SetCookieStringInternal(nsIURI *aHostURI,
|
||||
}
|
||||
|
||||
// process each cookie in the header
|
||||
while (SetCookieInternal(aHostURI, baseDomain, requireHostMatch, cookieStatus,
|
||||
aCookieHeader, serverTime, aFromHttp)) {
|
||||
nsDependentCString cookieHeader(aCookieHeader);
|
||||
while (SetCookieInternal(aHostURI, baseDomain, requireHostMatch,
|
||||
cookieStatus, cookieHeader, serverTime, aFromHttp)) {
|
||||
// document.cookie can only set one cookie at a time
|
||||
if (!aFromHttp)
|
||||
break;
|
||||
|
@ -263,7 +263,7 @@ class nsCookieService : public nsICookieService
|
||||
nsresult GetCookieStringCommon(nsIURI *aHostURI, nsIChannel *aChannel, bool aHttpBound, char** aCookie);
|
||||
void GetCookieStringInternal(nsIURI *aHostURI, bool aIsForeign, PRBool aHttpBound, nsCString &aCookie);
|
||||
nsresult SetCookieStringCommon(nsIURI *aHostURI, const char *aCookieHeader, const char *aServerTime, nsIChannel *aChannel, bool aFromHttp);
|
||||
void SetCookieStringInternal(nsIURI *aHostURI, bool aIsForeign, nsDependentCString &aCookieHeader, const nsCString &aServerTime, PRBool aFromHttp);
|
||||
void SetCookieStringInternal(nsIURI *aHostURI, bool aIsForeign, const nsCString &aCookieHeader, const nsCString &aServerTime, PRBool aFromHttp);
|
||||
PRBool SetCookieInternal(nsIURI *aHostURI, const nsCString& aBaseDomain, PRBool aRequireHostMatch, CookieStatus aStatus, nsDependentCString &aCookieHeader, PRInt64 aServerTime, PRBool aFromHttp);
|
||||
void AddInternal(const nsCString& aBaseDomain, nsCookie *aCookie, PRInt64 aCurrentTimeInUsec, nsIURI *aHostURI, const char *aCookieHeader, PRBool aFromHttp);
|
||||
void RemoveCookieFromList(const nsListIter &aIter, mozIStorageBindingParamsArray *aParamsArray = NULL);
|
||||
|
@ -330,7 +330,9 @@ nsXPLookAndFeel::ColorPrefChanged (unsigned int index, const char *prefName)
|
||||
if (!colorStr.IsEmpty()) {
|
||||
nscolor thecolor;
|
||||
if (colorStr[0] == PRUnichar('#')) {
|
||||
if (NS_HexToRGB(nsDependentString(colorStr, 1), &thecolor)) {
|
||||
if (NS_HexToRGB(nsDependentString(
|
||||
Substring(colorStr, 1, colorStr.Length() - 1)),
|
||||
&thecolor)) {
|
||||
PRInt32 id = NS_PTR_TO_INT32(index);
|
||||
CACHE_COLOR(id, thecolor);
|
||||
}
|
||||
|
@ -91,10 +91,11 @@ class nsTDependentString_CharT : public nsTString_CharT
|
||||
AssertValid();
|
||||
}
|
||||
|
||||
nsTDependentString_CharT( const string_type& str, PRUint32 startPos )
|
||||
: string_type()
|
||||
explicit
|
||||
nsTDependentString_CharT( const substring_type& str )
|
||||
: string_type(const_cast<char_type*>(str.Data()), str.Length(), F_TERMINATED)
|
||||
{
|
||||
Rebind(str, startPos);
|
||||
AssertValid();
|
||||
}
|
||||
|
||||
// Create a nsTDependentSubstring to be bound later
|
||||
@ -123,8 +124,6 @@ class nsTDependentString_CharT : public nsTString_CharT
|
||||
Rebind(start, PRUint32(end - start));
|
||||
}
|
||||
|
||||
void Rebind( const string_type&, PRUint32 startPos );
|
||||
|
||||
private:
|
||||
|
||||
// NOT USED
|
||||
|
@ -48,20 +48,3 @@ nsTDependentString_CharT::Rebind( const char_type* data, size_type length )
|
||||
SetDataFlags(F_TERMINATED);
|
||||
AssertValid();
|
||||
}
|
||||
|
||||
void
|
||||
nsTDependentString_CharT::Rebind( const string_type& str, PRUint32 startPos )
|
||||
{
|
||||
// If we currently own a buffer, release it.
|
||||
Finalize();
|
||||
|
||||
size_type strLength = str.Length();
|
||||
|
||||
if (startPos > strLength)
|
||||
startPos = strLength;
|
||||
|
||||
mData = const_cast<char_type*>(str.Data()) + startPos;
|
||||
mLength = strLength - startPos;
|
||||
|
||||
SetDataFlags(F_TERMINATED);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user