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);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
for (PRUint32 i = 0; i < properties.Length(); ++i) {
|
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(),
|
*_retval = JS_DefineUCProperty(cx, obj, prop.get(), prop.Length(),
|
||||||
JSVAL_VOID, nsnull, nsnull,
|
JSVAL_VOID, nsnull, nsnull,
|
||||||
JSPROP_ENUMERATE | JSPROP_SHARED);
|
JSPROP_ENUMERATE | JSPROP_SHARED);
|
||||||
|
@ -922,7 +922,8 @@ nsCSSValue::AppendToString(nsCSSProperty aProperty, nsAString& aResult) const
|
|||||||
aResult.Append(NS_LITERAL_STRING("-moz-element(#"));
|
aResult.Append(NS_LITERAL_STRING("-moz-element(#"));
|
||||||
nsAutoString tmpStr;
|
nsAutoString tmpStr;
|
||||||
GetStringValue(tmpStr);
|
GetStringValue(tmpStr);
|
||||||
nsStyleUtil::AppendEscapedCSSIdent(tmpStr, aResult);
|
nsStyleUtil::AppendEscapedCSSIdent(
|
||||||
|
nsDependentString(tmpStr), aResult);
|
||||||
aResult.Append(NS_LITERAL_STRING(")"));
|
aResult.Append(NS_LITERAL_STRING(")"));
|
||||||
}
|
}
|
||||||
else if (eCSSUnit_Percent == unit) {
|
else if (eCSSUnit_Percent == unit) {
|
||||||
|
@ -95,9 +95,8 @@ CookieServiceParent::RecvSetCookieString(const IPC::URI& aHost,
|
|||||||
if (!hostURI)
|
if (!hostURI)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
nsDependentCString cookieString(aCookieString, 0);
|
|
||||||
mCookieService->SetCookieStringInternal(hostURI, aIsForeign,
|
mCookieService->SetCookieStringInternal(hostURI, aIsForeign,
|
||||||
cookieString, aServerTime,
|
aCookieString, aServerTime,
|
||||||
aFromHttp);
|
aFromHttp);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1493,11 +1493,11 @@ nsCookieService::SetCookieStringCommon(nsIURI *aHostURI,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
nsCookieService::SetCookieStringInternal(nsIURI *aHostURI,
|
nsCookieService::SetCookieStringInternal(nsIURI *aHostURI,
|
||||||
bool aIsForeign,
|
bool aIsForeign,
|
||||||
nsDependentCString &aCookieHeader,
|
const nsCString &aCookieHeader,
|
||||||
const nsCString &aServerTime,
|
const nsCString &aServerTime,
|
||||||
PRBool aFromHttp)
|
PRBool aFromHttp)
|
||||||
{
|
{
|
||||||
NS_ASSERTION(aHostURI, "null host!");
|
NS_ASSERTION(aHostURI, "null host!");
|
||||||
|
|
||||||
@ -1550,8 +1550,9 @@ nsCookieService::SetCookieStringInternal(nsIURI *aHostURI,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// process each cookie in the header
|
// process each cookie in the header
|
||||||
while (SetCookieInternal(aHostURI, baseDomain, requireHostMatch, cookieStatus,
|
nsDependentCString cookieHeader(aCookieHeader);
|
||||||
aCookieHeader, serverTime, aFromHttp)) {
|
while (SetCookieInternal(aHostURI, baseDomain, requireHostMatch,
|
||||||
|
cookieStatus, cookieHeader, serverTime, aFromHttp)) {
|
||||||
// document.cookie can only set one cookie at a time
|
// document.cookie can only set one cookie at a time
|
||||||
if (!aFromHttp)
|
if (!aFromHttp)
|
||||||
break;
|
break;
|
||||||
|
@ -263,7 +263,7 @@ class nsCookieService : public nsICookieService
|
|||||||
nsresult GetCookieStringCommon(nsIURI *aHostURI, nsIChannel *aChannel, bool aHttpBound, char** aCookie);
|
nsresult GetCookieStringCommon(nsIURI *aHostURI, nsIChannel *aChannel, bool aHttpBound, char** aCookie);
|
||||||
void GetCookieStringInternal(nsIURI *aHostURI, bool aIsForeign, PRBool aHttpBound, nsCString &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);
|
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);
|
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 AddInternal(const nsCString& aBaseDomain, nsCookie *aCookie, PRInt64 aCurrentTimeInUsec, nsIURI *aHostURI, const char *aCookieHeader, PRBool aFromHttp);
|
||||||
void RemoveCookieFromList(const nsListIter &aIter, mozIStorageBindingParamsArray *aParamsArray = NULL);
|
void RemoveCookieFromList(const nsListIter &aIter, mozIStorageBindingParamsArray *aParamsArray = NULL);
|
||||||
|
@ -330,7 +330,9 @@ nsXPLookAndFeel::ColorPrefChanged (unsigned int index, const char *prefName)
|
|||||||
if (!colorStr.IsEmpty()) {
|
if (!colorStr.IsEmpty()) {
|
||||||
nscolor thecolor;
|
nscolor thecolor;
|
||||||
if (colorStr[0] == PRUnichar('#')) {
|
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);
|
PRInt32 id = NS_PTR_TO_INT32(index);
|
||||||
CACHE_COLOR(id, thecolor);
|
CACHE_COLOR(id, thecolor);
|
||||||
}
|
}
|
||||||
|
@ -91,10 +91,11 @@ class nsTDependentString_CharT : public nsTString_CharT
|
|||||||
AssertValid();
|
AssertValid();
|
||||||
}
|
}
|
||||||
|
|
||||||
nsTDependentString_CharT( const string_type& str, PRUint32 startPos )
|
explicit
|
||||||
: string_type()
|
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
|
// Create a nsTDependentSubstring to be bound later
|
||||||
@ -123,8 +124,6 @@ class nsTDependentString_CharT : public nsTString_CharT
|
|||||||
Rebind(start, PRUint32(end - start));
|
Rebind(start, PRUint32(end - start));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Rebind( const string_type&, PRUint32 startPos );
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// NOT USED
|
// NOT USED
|
||||||
|
@ -48,20 +48,3 @@ nsTDependentString_CharT::Rebind( const char_type* data, size_type length )
|
|||||||
SetDataFlags(F_TERMINATED);
|
SetDataFlags(F_TERMINATED);
|
||||||
AssertValid();
|
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