mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Bug 1320404 - Remove appId from origin attributes - part 4 - necko, r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D29356 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
181c865701
commit
7a0fabb9f6
@ -57,7 +57,7 @@ typedef nsClassHashtable<nsCStringHashKey, CacheEntryTable> GlobalEntryTables;
|
||||
/**
|
||||
* Keeps tables of entries. There is one entries table for each distinct load
|
||||
* context type. The distinction is based on following load context info
|
||||
* states: <isPrivate|isAnon|appId|inIsolatedMozBrowser> which builds a mapping
|
||||
* states: <isPrivate|isAnon|inIsolatedMozBrowser> which builds a mapping
|
||||
* key.
|
||||
*
|
||||
* Thread-safe to access, protected by the service mutex.
|
||||
|
@ -100,12 +100,10 @@ nsresult nsAboutCache::Channel::Init(nsIURI* aURI, nsILoadInfo* aLoadInfo) {
|
||||
"<label><input id='priv' type='checkbox'/> Private</label>\n"
|
||||
"<label><input id='anon' type='checkbox'/> Anonymous</label>\n");
|
||||
|
||||
// Visit scoping by browser and appid is not implemented for
|
||||
// the old cache, simply don't add these controls.
|
||||
// The appid/inbrowser entries are already mixed in the default
|
||||
// view anyway.
|
||||
// Visit scoping by browseris not implemented for the old cache, simply don't
|
||||
// add these controls. The inbrowser entries are already mixed in the
|
||||
// default view anyway.
|
||||
mBuffer.AppendLiteral(
|
||||
"<label><input id='appid' type='text' size='6'/> AppID</label>\n"
|
||||
"<label><input id='inbrowser' type='checkbox'/> In Browser "
|
||||
"Element</label>\n");
|
||||
|
||||
|
@ -548,7 +548,7 @@ class nsHttpChannel final : public HttpBaseChannel,
|
||||
|
||||
bool IsIsolated();
|
||||
|
||||
const nsCString &GetTopWindowOrigin();
|
||||
const nsCString& GetTopWindowOrigin();
|
||||
|
||||
already_AddRefed<nsChannelClassifier> GetOrCreateChannelClassifier();
|
||||
|
||||
@ -697,7 +697,7 @@ class nsHttpChannel final : public HttpBaseChannel,
|
||||
// true iff there is AutoRedirectVetoNotifier on the stack
|
||||
uint32_t mHasAutoRedirectVetoNotifier : 1;
|
||||
// consumers set this to true to use cache pinning, this has effect
|
||||
// only when the channel is in an app context (load context has an appid)
|
||||
// only when the channel is in an app context
|
||||
uint32_t mPinCacheContent : 1;
|
||||
// True if CORS preflight has been performed
|
||||
uint32_t mIsCorsPreflightDone : 1;
|
||||
|
@ -30,12 +30,6 @@ var firstTests = [
|
||||
[false, 0, 1], [true, 0, 1], [false, 1, 1], [true, 1, 1],
|
||||
];
|
||||
var secondTests = [
|
||||
[false, 0, 0], [true, 0, 0], [false, 1, 0], [true, 1, 0],
|
||||
];
|
||||
var thirdTests = [
|
||||
[false, 0, 0], [true, 0, 0], [false, 1, 0], [true, 1, 0],
|
||||
];
|
||||
var fourthTests = [
|
||||
[false, 0, 0], [true, 0, 0], [false, 1, 1], [true, 1, 0],
|
||||
];
|
||||
|
||||
@ -51,27 +45,9 @@ async function run_all_tests() {
|
||||
if (procType != Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT)
|
||||
return;
|
||||
|
||||
let attrs_inBrowser = { inIsolatedMozBrowser:true };
|
||||
let attrs_notInBrowser = { };
|
||||
|
||||
Services.clearData.deleteDataFromOriginAttributesPattern(attrs_inBrowser);
|
||||
|
||||
for (let test of secondTests) {
|
||||
handlers_called = 0;
|
||||
await test_channel(...test);
|
||||
}
|
||||
|
||||
Services.clearData.deleteDataFromOriginAttributesPattern(attrs_notInBrowser);
|
||||
Services.clearData.deleteDataFromOriginAttributesPattern(attrs_inBrowser);
|
||||
|
||||
for (let test of thirdTests) {
|
||||
handlers_called = 0;
|
||||
await test_channel(...test);
|
||||
}
|
||||
|
||||
Services.clearData.deleteDataFromOriginAttributesPattern({ userContextId: 1 });
|
||||
|
||||
for (let test of fourthTests) {
|
||||
for (let test of secondTests) {
|
||||
handlers_called = 0;
|
||||
await test_channel(...test);
|
||||
}
|
||||
|
@ -11,10 +11,7 @@ var cacheContext = searchParams.get("context");
|
||||
|
||||
// The context is in a format as used by the HTTP cache v2 back end
|
||||
if (cacheContext)
|
||||
var [context, isAnon, isInBrowser, appId, isPrivate] = cacheContext.match(/(a,)?(b,)?(i\d+,)?(p,)?/);
|
||||
if (appId)
|
||||
appId = appId.match(/i(\d+),/)[1];
|
||||
|
||||
var [context, isAnon, isInBrowser, isPrivate] = cacheContext.match(/(a,)?(b,)?(p,)?/);
|
||||
|
||||
function $(id) { return document.getElementById(id) || {}; }
|
||||
|
||||
@ -22,7 +19,6 @@ function $(id) { return document.getElementById(id) || {}; }
|
||||
addEventListener("DOMContentLoaded", function() {
|
||||
$("anon").checked = !!isAnon;
|
||||
$("inbrowser").checked = !!isInBrowser;
|
||||
$("appid").value = appId || "";
|
||||
$("priv").checked = !!isPrivate;
|
||||
}, false);
|
||||
|
||||
@ -34,8 +30,6 @@ function navigate() {
|
||||
context += "a,";
|
||||
if ($("inbrowser").checked)
|
||||
context += "b,";
|
||||
if ($("appid").value)
|
||||
context += "i" + $("appid").value + ",";
|
||||
if ($("priv").checked)
|
||||
context += "p,";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user