mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
Backed out changeset 93efae7712c8 (bug 1748138) for causing bc failures at browser_devices_get_user_media_in_xorigin_frame.js
This commit is contained in:
parent
1468978431
commit
9d049ade00
@ -30,21 +30,11 @@ export class PageInfoChild extends JSWindowActorChild {
|
||||
mediaItems: await this.getDocumentMedia(document),
|
||||
});
|
||||
}
|
||||
case "PageInfo:getPartitionKey": {
|
||||
return Promise.resolve({
|
||||
partitionKey: await this.getPartitionKey(document),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
getPartitionKey(document) {
|
||||
let partitionKey = document.cookieJarSettings.partitionKey;
|
||||
return partitionKey;
|
||||
}
|
||||
|
||||
getMetaInfo(document) {
|
||||
let metaViewRows = [];
|
||||
|
||||
|
@ -271,7 +271,11 @@ const cacheService = Cc[
|
||||
"@mozilla.org/netwerk/cache-storage-service;1"
|
||||
].getService(nsICacheStorageService);
|
||||
|
||||
var diskStorage = null;
|
||||
var loadContextInfo = Services.loadContextInfo.fromLoadContext(
|
||||
window.docShell.QueryInterface(Ci.nsILoadContext),
|
||||
false
|
||||
);
|
||||
var diskStorage = cacheService.diskCacheStorage(loadContextInfo);
|
||||
|
||||
const nsICookiePermission = Ci.nsICookiePermission;
|
||||
|
||||
@ -460,20 +464,6 @@ async function loadTab(args) {
|
||||
let browsingContext = args?.browsingContext;
|
||||
let browser = args?.browser;
|
||||
|
||||
// Check if diskStorage has not be created yet if it has not been, get
|
||||
// partitionKey from content process and create diskStorage with said partitionKey
|
||||
if (!diskStorage) {
|
||||
let oaWithPartitionKey = await getOaWithPartitionKey(
|
||||
browsingContext,
|
||||
browser
|
||||
);
|
||||
let loadContextInfo = Services.loadContextInfo.custom(
|
||||
false,
|
||||
oaWithPartitionKey
|
||||
);
|
||||
diskStorage = cacheService.diskCacheStorage(loadContextInfo);
|
||||
}
|
||||
|
||||
/* Load the page info */
|
||||
await loadPageInfo(browsingContext, imageElement, browser);
|
||||
|
||||
@ -1180,16 +1170,3 @@ function checkProtocol(img) {
|
||||
/^(https?|file|about|chrome|resource):/.test(url)
|
||||
);
|
||||
}
|
||||
|
||||
async function getOaWithPartitionKey(browsingContext, browser) {
|
||||
browser = browser || window.opener.gBrowser.selectedBrowser;
|
||||
browsingContext = browsingContext || browser.browsingContext;
|
||||
|
||||
let actor = browsingContext.currentWindowGlobal.getActor("PageInfo");
|
||||
let partitionKeyFromChild = await actor.sendQuery("PageInfo:getPartitionKey");
|
||||
|
||||
let oa = browser.contentPrincipal.originAttributes;
|
||||
oa.partitionKey = partitionKeyFromChild.partitionKey;
|
||||
|
||||
return oa;
|
||||
}
|
||||
|
@ -91,22 +91,3 @@ add_task(async function test_view_image_info() {
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
add_task(async function test_image_size() {
|
||||
await BrowserTestUtils.withNewTab(
|
||||
TEST_PATH + "all_images.html",
|
||||
async function () {
|
||||
let pageInfo = BrowserPageInfo(
|
||||
gBrowser.selectedBrowser.currentURI.spec,
|
||||
"mediaTab"
|
||||
);
|
||||
await BrowserTestUtils.waitForEvent(pageInfo, "page-info-init");
|
||||
|
||||
let imageSize = pageInfo.document.getElementById("imagesizetext");
|
||||
|
||||
Assert.notEqual("media-unknown-not-cached", imageSize.value);
|
||||
|
||||
pageInfo.close();
|
||||
}
|
||||
);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user