зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 78ef803f4f11 (bug 1170097)
This commit is contained in:
Родитель
f0ee9f83ac
Коммит
926283a9eb
|
@ -37,12 +37,6 @@ OriginAttributes::CreateSuffix(nsACString& aStr) const
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
OriginAttributes::CookieJar(nsACString& aStr)
|
||||
{
|
||||
mozilla::GetJarPrefix(mAppId, mInBrowser, aStr);
|
||||
}
|
||||
|
||||
void
|
||||
OriginAttributes::Serialize(nsIObjectOutputStream* aStream) const
|
||||
{
|
||||
|
@ -170,7 +164,7 @@ BasePrincipal::GetJarPrefix(nsACString& aJarPrefix)
|
|||
{
|
||||
MOZ_ASSERT(AppId() != nsIScriptSecurityManager::UNKNOWN_APP_ID);
|
||||
|
||||
mOriginAttributes.CookieJar(aJarPrefix);
|
||||
mozilla::GetJarPrefix(AppId(), IsInBrowserElement(), aJarPrefix);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -193,8 +187,10 @@ BasePrincipal::GetOriginSuffix(nsACString& aOriginAttributes)
|
|||
NS_IMETHODIMP
|
||||
BasePrincipal::GetCookieJar(nsACString& aCookieJar)
|
||||
{
|
||||
mOriginAttributes.CookieJar(aCookieJar);
|
||||
return NS_OK;
|
||||
// We just forward to .jarPrefix for now, which is a nice compact
|
||||
// stringification of the (appId, inBrowser) tuple. This will eventaully be
|
||||
// swapped out for an origin attribute - see the comment in nsIPrincipal.idl.
|
||||
return GetJarPrefix(aCookieJar);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -27,8 +27,6 @@ public:
|
|||
mAppId = aAppId;
|
||||
mInBrowser = aInBrowser;
|
||||
}
|
||||
OriginAttributes(const OriginAttributesDictionary& aOther)
|
||||
: OriginAttributesDictionary(aOther) {}
|
||||
|
||||
bool operator==(const OriginAttributes& aOther) const
|
||||
{
|
||||
|
@ -45,8 +43,6 @@ public:
|
|||
// returns an empty string.
|
||||
void CreateSuffix(nsACString& aStr) const;
|
||||
|
||||
void CookieJar(nsACString& aStr);
|
||||
|
||||
void Serialize(nsIObjectOutputStream* aStream) const;
|
||||
nsresult Deserialize(nsIObjectInputStream* aStream);
|
||||
};
|
||||
|
|
|
@ -28,15 +28,6 @@ interface ChromeUtils {
|
|||
*/
|
||||
[Throws, NewObject]
|
||||
static HeapSnapshot readHeapSnapshot(DOMString filePath);
|
||||
|
||||
/**
|
||||
* A helper that converts OriginAttributesDictionary to cookie jar opaque
|
||||
* identfier.
|
||||
*
|
||||
* @param originAttrs The originAttributes from the caller.
|
||||
*/
|
||||
static ByteString
|
||||
originAttributesToCookieJar(optional OriginAttributesDictionary originAttrs);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
#include "mozilla/devtools/HeapSnapshot.h"
|
||||
#include "mozilla/devtools/ZeroCopyNSIOutputStream.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/BasePrincipal.h"
|
||||
#include "mozilla/UniquePtr.h"
|
||||
|
||||
#include "nsCRTGlue.h"
|
||||
|
@ -429,14 +428,5 @@ ChromeUtils::ReadHeapSnapshot(GlobalObject& global,
|
|||
return HeapSnapshot::Create(cx, global, buffer.get(), size, rv);
|
||||
}
|
||||
|
||||
/* static */ void
|
||||
ChromeUtils::OriginAttributesToCookieJar(GlobalObject& aGlobal,
|
||||
const OriginAttributesDictionary& aAttrs,
|
||||
nsCString& aCookieJar)
|
||||
{
|
||||
OriginAttributes attrs(aAttrs);
|
||||
attrs.CookieJar(aCookieJar);
|
||||
}
|
||||
|
||||
} // namespace devtools
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -73,11 +73,6 @@ public:
|
|||
JSContext* cx,
|
||||
const nsAString& filePath,
|
||||
ErrorResult& rv);
|
||||
|
||||
static void
|
||||
OriginAttributesToCookieJar(dom::GlobalObject& aGlobal,
|
||||
const dom::OriginAttributesDictionary& aAttrs,
|
||||
nsCString& aCookieJar);
|
||||
};
|
||||
|
||||
} // namespace devtools
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
var ssm = Services.scriptSecurityManager;
|
||||
|
||||
function run_test() {
|
||||
const appId = 12;
|
||||
var browserAttrs = {appId: appId, inBrowser: true};
|
||||
|
||||
// ChromeUtils.originAttributesToCookieJar should return the same value with
|
||||
// the cookieJar of the principal created from the same origin attribute.
|
||||
var cookieJar_1 = ChromeUtils.originAttributesToCookieJar(browserAttrs);
|
||||
var dummy = Services.io.newURI("http://example.com", null, null);
|
||||
var cookieJar_2 = ssm.createCodebasePrincipal(dummy, browserAttrs).cookieJar;
|
||||
do_check_eq(cookieJar_1, cookieJar_2);
|
||||
|
||||
// App and mozbrowser shouldn't have the same cookieJar identifier.
|
||||
var appAttrs = {appId: appId, inBrowser: false};
|
||||
var cookieJar_3 = ChromeUtils.originAttributesToCookieJar(appAttrs);
|
||||
do_check_neq(cookieJar_1, cookieJar_3);
|
||||
|
||||
// If the attribute is null the cookieJar identifier should be empty.
|
||||
var cookieJar_4 = ChromeUtils.originAttributesToCookieJar();
|
||||
do_check_eq(cookieJar_4, "");
|
||||
}
|
|
@ -85,7 +85,6 @@ support-files =
|
|||
[test_promises_actor_list_promises.js]
|
||||
[test_promises_actor_onnewpromise.js]
|
||||
[test_promises_actor_onpromisesettled.js]
|
||||
[test_originAttributesToCookieJar.js]
|
||||
[test_protocol_abort.js]
|
||||
[test_protocol_async.js]
|
||||
[test_protocol_children.js]
|
||||
|
|
Загрузка…
Ссылка в новой задаче