mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Merge m-i to m-c, a=merge
This commit is contained in:
commit
7f435e44fe
2
CLOBBER
2
CLOBBER
@ -22,4 +22,4 @@
|
|||||||
# changes to stick? As of bug 928195, this shouldn't be necessary! Please
|
# changes to stick? As of bug 928195, this shouldn't be necessary! Please
|
||||||
# don't change CLOBBER for WebIDL changes any more.
|
# don't change CLOBBER for WebIDL changes any more.
|
||||||
|
|
||||||
Bug 1178215 requires clobber for libvpx file moves.
|
Bug 1178892 requires clobber for profiler file moves.
|
||||||
|
@ -1265,7 +1265,7 @@ nsAccessibilityService::Init()
|
|||||||
logging::CheckEnv();
|
logging::CheckEnv();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Default)
|
if (XRE_IsParentProcess())
|
||||||
gApplicationAccessible = new ApplicationAccessibleWrap();
|
gApplicationAccessible = new ApplicationAccessibleWrap();
|
||||||
else
|
else
|
||||||
gApplicationAccessible = new ApplicationAccessible();
|
gApplicationAccessible = new ApplicationAccessible();
|
||||||
@ -1286,7 +1286,7 @@ nsAccessibilityService::Init()
|
|||||||
gIsShutdown = false;
|
gIsShutdown = false;
|
||||||
|
|
||||||
// Now its safe to start platform accessibility.
|
// Now its safe to start platform accessibility.
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Default)
|
if (XRE_IsParentProcess())
|
||||||
PlatformInit();
|
PlatformInit();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -1329,7 +1329,7 @@ nsAccessibilityService::Shutdown()
|
|||||||
|
|
||||||
gIsShutdown = true;
|
gIsShutdown = true;
|
||||||
|
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Default)
|
if (XRE_IsParentProcess())
|
||||||
PlatformShutdown();
|
PlatformShutdown();
|
||||||
|
|
||||||
gApplicationAccessible->Shutdown();
|
gApplicationAccessible->Shutdown();
|
||||||
|
@ -282,7 +282,7 @@ IPCAccessibilityActive()
|
|||||||
#ifdef MOZ_B2G
|
#ifdef MOZ_B2G
|
||||||
return false;
|
return false;
|
||||||
#else
|
#else
|
||||||
return XRE_GetProcessType() == GeckoProcessType_Content &&
|
return XRE_IsContentProcess() &&
|
||||||
mozilla::Preferences::GetBool("accessibility.ipc_architecture.enabled", true);
|
mozilla::Preferences::GetBool("accessibility.ipc_architecture.enabled", true);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -425,7 +425,7 @@ nsCoreUtils::IsTabDocument(nsIDocument* aDocumentNode)
|
|||||||
treeItem->GetParent(getter_AddRefs(parentTreeItem));
|
treeItem->GetParent(getter_AddRefs(parentTreeItem));
|
||||||
|
|
||||||
// Tab document running in own process doesn't have parent.
|
// Tab document running in own process doesn't have parent.
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Content)
|
if (XRE_IsContentProcess())
|
||||||
return !parentTreeItem;
|
return !parentTreeItem;
|
||||||
|
|
||||||
// Parent of docshell for tab document running in chrome process is root.
|
// Parent of docshell for tab document running in chrome process is root.
|
||||||
|
@ -64,7 +64,7 @@ nsWinUtils::MaybeStartWindowEmulation()
|
|||||||
|
|
||||||
if (Compatibility::IsJAWS() || Compatibility::IsWE() ||
|
if (Compatibility::IsJAWS() || Compatibility::IsWE() ||
|
||||||
Compatibility::IsDolphin() ||
|
Compatibility::IsDolphin() ||
|
||||||
XRE_GetProcessType() == GeckoProcessType_Content) {
|
XRE_IsContentProcess()) {
|
||||||
RegisterNativeWindow(kClassNameTabContent);
|
RegisterNativeWindow(kClassNameTabContent);
|
||||||
sHWNDCache = new nsRefPtrHashtable<nsPtrHashKey<void>, DocAccessible>(2);
|
sHWNDCache = new nsRefPtrHashtable<nsPtrHashKey<void>, DocAccessible>(2);
|
||||||
return true;
|
return true;
|
||||||
|
@ -355,11 +355,10 @@ var FullScreen = {
|
|||||||
"fullscreen",
|
"fullscreen",
|
||||||
Services.perms.ALLOW_ACTION,
|
Services.perms.ALLOW_ACTION,
|
||||||
Services.perms.EXPIRE_SESSION);
|
Services.perms.EXPIRE_SESSION);
|
||||||
let host = uri.host;
|
|
||||||
var onFullscreenchange = function onFullscreenchange(event) {
|
var onFullscreenchange = function onFullscreenchange(event) {
|
||||||
if (event.target == document && document.mozFullScreenElement == null) {
|
if (event.target == document && document.mozFullScreenElement == null) {
|
||||||
// The chrome document has left fullscreen. Remove the temporary permission grant.
|
// The chrome document has left fullscreen. Remove the temporary permission grant.
|
||||||
Services.perms.remove(host, "fullscreen");
|
Services.perms.remove(uri, "fullscreen");
|
||||||
document.removeEventListener("mozfullscreenchange", onFullscreenchange);
|
document.removeEventListener("mozfullscreenchange", onFullscreenchange);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,7 @@ let TrackingProtection = {
|
|||||||
// Remove the current host from the 'trackingprotection' consumer
|
// Remove the current host from the 'trackingprotection' consumer
|
||||||
// of the permission manager. This effectively removes this host
|
// of the permission manager. This effectively removes this host
|
||||||
// from the tracking protection allowlist.
|
// from the tracking protection allowlist.
|
||||||
Services.perms.remove(gBrowser.selectedBrowser.currentURI.host,
|
Services.perms.remove(gBrowser.selectedBrowser.currentURI,
|
||||||
"trackingprotection");
|
"trackingprotection");
|
||||||
|
|
||||||
// Telemetry for enable protection.
|
// Telemetry for enable protection.
|
||||||
|
@ -862,7 +862,7 @@ function onBlockImage()
|
|||||||
if (checkbox.checked)
|
if (checkbox.checked)
|
||||||
permissionManager.add(uri, "image", nsIPermissionManager.DENY_ACTION);
|
permissionManager.add(uri, "image", nsIPermissionManager.DENY_ACTION);
|
||||||
else
|
else
|
||||||
permissionManager.remove(uri.host, "image");
|
permissionManager.remove(uri, "image");
|
||||||
}
|
}
|
||||||
|
|
||||||
function onImageSelect()
|
function onImageSelect()
|
||||||
|
@ -283,7 +283,7 @@ function test_whitelisted_install() {
|
|||||||
is(aInstalls.length, 1, "Should be one pending install");
|
is(aInstalls.length, 1, "Should be one pending install");
|
||||||
aInstalls[0].cancel();
|
aInstalls[0].cancel();
|
||||||
|
|
||||||
Services.perms.remove("example.com", "install");
|
Services.perms.remove(makeURI("http://example.com/"), "install");
|
||||||
wait_for_notification_close(runNextTest);
|
wait_for_notification_close(runNextTest);
|
||||||
gBrowser.removeTab(gBrowser.selectedTab);
|
gBrowser.removeTab(gBrowser.selectedTab);
|
||||||
});
|
});
|
||||||
@ -315,7 +315,7 @@ function test_failed_download() {
|
|||||||
"The add-on could not be downloaded because of a connection failure.",
|
"The add-on could not be downloaded because of a connection failure.",
|
||||||
"Should have seen the right message");
|
"Should have seen the right message");
|
||||||
|
|
||||||
Services.perms.remove("example.com", "install");
|
Services.perms.remove(makeURI("http://example.com/"), "install");
|
||||||
wait_for_notification_close(runNextTest);
|
wait_for_notification_close(runNextTest);
|
||||||
gBrowser.removeTab(gBrowser.selectedTab);
|
gBrowser.removeTab(gBrowser.selectedTab);
|
||||||
});
|
});
|
||||||
@ -342,7 +342,7 @@ function test_corrupt_file() {
|
|||||||
"because it appears to be corrupt.",
|
"because it appears to be corrupt.",
|
||||||
"Should have seen the right message");
|
"Should have seen the right message");
|
||||||
|
|
||||||
Services.perms.remove("example.com", "install");
|
Services.perms.remove(makeURI("http://example.com/"), "install");
|
||||||
wait_for_notification_close(runNextTest);
|
wait_for_notification_close(runNextTest);
|
||||||
gBrowser.removeTab(gBrowser.selectedTab);
|
gBrowser.removeTab(gBrowser.selectedTab);
|
||||||
});
|
});
|
||||||
@ -369,7 +369,7 @@ function test_incompatible() {
|
|||||||
gApp + " " + gVersion + ".",
|
gApp + " " + gVersion + ".",
|
||||||
"Should have seen the right message");
|
"Should have seen the right message");
|
||||||
|
|
||||||
Services.perms.remove("example.com", "install");
|
Services.perms.remove(makeURI("http://example.com/"), "install");
|
||||||
wait_for_notification_close(runNextTest);
|
wait_for_notification_close(runNextTest);
|
||||||
gBrowser.removeTab(gBrowser.selectedTab);
|
gBrowser.removeTab(gBrowser.selectedTab);
|
||||||
});
|
});
|
||||||
@ -403,7 +403,7 @@ function test_restartless() {
|
|||||||
AddonManager.getAddonByID("restartless-xpi@tests.mozilla.org", function(aAddon) {
|
AddonManager.getAddonByID("restartless-xpi@tests.mozilla.org", function(aAddon) {
|
||||||
aAddon.uninstall();
|
aAddon.uninstall();
|
||||||
|
|
||||||
Services.perms.remove("example.com", "install");
|
Services.perms.remove(makeURI("http://example.com/"), "install");
|
||||||
wait_for_notification_close(runNextTest);
|
wait_for_notification_close(runNextTest);
|
||||||
gBrowser.removeTab(gBrowser.selectedTab);
|
gBrowser.removeTab(gBrowser.selectedTab);
|
||||||
});
|
});
|
||||||
@ -444,7 +444,7 @@ function test_multiple() {
|
|||||||
AddonManager.getAddonByID("restartless-xpi@tests.mozilla.org", function(aAddon) {
|
AddonManager.getAddonByID("restartless-xpi@tests.mozilla.org", function(aAddon) {
|
||||||
aAddon.uninstall();
|
aAddon.uninstall();
|
||||||
|
|
||||||
Services.perms.remove("example.com", "install");
|
Services.perms.remove(makeURI("http://example.com/"), "install");
|
||||||
wait_for_notification_close(runNextTest);
|
wait_for_notification_close(runNextTest);
|
||||||
gBrowser.removeTab(gBrowser.selectedTab);
|
gBrowser.removeTab(gBrowser.selectedTab);
|
||||||
});
|
});
|
||||||
@ -516,7 +516,7 @@ function test_sequential() {
|
|||||||
is(container.childNodes.length, 1, "Should be one item listed");
|
is(container.childNodes.length, 1, "Should be one item listed");
|
||||||
is(container.childNodes[0].firstChild.getAttribute("value"), "Theme Test", "Should have the right add-on");
|
is(container.childNodes[0].firstChild.getAttribute("value"), "Theme Test", "Should have the right add-on");
|
||||||
|
|
||||||
Services.perms.remove("example.com", "install");
|
Services.perms.remove(makeURI("http://example.com"), "install");
|
||||||
wait_for_notification_close(() => {
|
wait_for_notification_close(() => {
|
||||||
gBrowser.removeTab(gBrowser.selectedTab);
|
gBrowser.removeTab(gBrowser.selectedTab);
|
||||||
runNextTest();
|
runNextTest();
|
||||||
@ -580,7 +580,7 @@ function test_someunverified() {
|
|||||||
t.userDisabled = true;
|
t.userDisabled = true;
|
||||||
t.uninstall();
|
t.uninstall();
|
||||||
|
|
||||||
Services.perms.remove("example.com", "install");
|
Services.perms.remove(makeURI("http://example.com/"), "install");
|
||||||
wait_for_notification_close(runNextTest);
|
wait_for_notification_close(runNextTest);
|
||||||
gBrowser.removeTab(gBrowser.selectedTab);
|
gBrowser.removeTab(gBrowser.selectedTab);
|
||||||
});
|
});
|
||||||
@ -628,7 +628,7 @@ function test_allunverified() {
|
|||||||
AddonManager.getAddonByID("restartless-xpi@tests.mozilla.org", function(aAddon) {
|
AddonManager.getAddonByID("restartless-xpi@tests.mozilla.org", function(aAddon) {
|
||||||
aAddon.uninstall();
|
aAddon.uninstall();
|
||||||
|
|
||||||
Services.perms.remove("example.com", "install");
|
Services.perms.remove(makeURI("http://example.com/"), "install");
|
||||||
wait_for_notification_close(runNextTest);
|
wait_for_notification_close(runNextTest);
|
||||||
gBrowser.removeTab(gBrowser.selectedTab);
|
gBrowser.removeTab(gBrowser.selectedTab);
|
||||||
});
|
});
|
||||||
@ -795,7 +795,7 @@ function test_reload() {
|
|||||||
is(aInstalls.length, 1, "Should be one pending install");
|
is(aInstalls.length, 1, "Should be one pending install");
|
||||||
aInstalls[0].cancel();
|
aInstalls[0].cancel();
|
||||||
|
|
||||||
Services.perms.remove("example.com", "install");
|
Services.perms.remove(makeURI("http://example.com/"), "install");
|
||||||
wait_for_notification_close(runNextTest);
|
wait_for_notification_close(runNextTest);
|
||||||
gBrowser.removeTab(gBrowser.selectedTab);
|
gBrowser.removeTab(gBrowser.selectedTab);
|
||||||
});
|
});
|
||||||
@ -839,7 +839,7 @@ function test_theme() {
|
|||||||
isnot(aAddon, null, "Test theme will have been installed");
|
isnot(aAddon, null, "Test theme will have been installed");
|
||||||
aAddon.uninstall();
|
aAddon.uninstall();
|
||||||
|
|
||||||
Services.perms.remove("example.com", "install");
|
Services.perms.remove(makeURI("http://example.com/"), "install");
|
||||||
wait_for_notification_close(runNextTest);
|
wait_for_notification_close(runNextTest);
|
||||||
gBrowser.removeTab(gBrowser.selectedTab);
|
gBrowser.removeTab(gBrowser.selectedTab);
|
||||||
});
|
});
|
||||||
@ -918,7 +918,7 @@ function test_renotify_installed() {
|
|||||||
is(aInstalls.length, 1, "Should be one pending installs");
|
is(aInstalls.length, 1, "Should be one pending installs");
|
||||||
aInstalls[0].cancel();
|
aInstalls[0].cancel();
|
||||||
|
|
||||||
Services.perms.remove("example.com", "install");
|
Services.perms.remove(makeURI("http://example.com/"), "install");
|
||||||
wait_for_notification_close(runNextTest);
|
wait_for_notification_close(runNextTest);
|
||||||
gBrowser.removeTab(gBrowser.selectedTab);
|
gBrowser.removeTab(gBrowser.selectedTab);
|
||||||
});
|
});
|
||||||
@ -986,7 +986,7 @@ function test_cancel() {
|
|||||||
AddonManager.getAllInstalls(function(aInstalls) {
|
AddonManager.getAllInstalls(function(aInstalls) {
|
||||||
is(aInstalls.length, 0, "Should be no pending install");
|
is(aInstalls.length, 0, "Should be no pending install");
|
||||||
|
|
||||||
Services.perms.remove("example.com", "install");
|
Services.perms.remove(makeURI("http://example.com/"), "install");
|
||||||
gBrowser.removeTab(gBrowser.selectedTab);
|
gBrowser.removeTab(gBrowser.selectedTab);
|
||||||
runNextTest();
|
runNextTest();
|
||||||
});
|
});
|
||||||
|
@ -37,7 +37,7 @@ function test_install_http() {
|
|||||||
|
|
||||||
gBrowser.removeTab(gBrowser.selectedTab);
|
gBrowser.removeTab(gBrowser.selectedTab);
|
||||||
|
|
||||||
pm.remove("example.org", "install");
|
pm.remove(makeURI("http://example.org/"), "install");
|
||||||
|
|
||||||
runNextTest();
|
runNextTest();
|
||||||
});
|
});
|
||||||
@ -66,7 +66,7 @@ function test_install_lwtheme() {
|
|||||||
LightweightThemeManager.currentTheme = null;
|
LightweightThemeManager.currentTheme = null;
|
||||||
gBrowser.removeTab(gBrowser.selectedTab);
|
gBrowser.removeTab(gBrowser.selectedTab);
|
||||||
|
|
||||||
Services.perms.remove("example.com", "install");
|
Services.perms.remove(makeURI("http://example.com/"), "install");
|
||||||
|
|
||||||
runNextTest();
|
runNextTest();
|
||||||
});
|
});
|
||||||
@ -106,7 +106,7 @@ function test_lwtheme_switch_theme() {
|
|||||||
|
|
||||||
gBrowser.removeTab(gBrowser.selectedTab);
|
gBrowser.removeTab(gBrowser.selectedTab);
|
||||||
|
|
||||||
Services.perms.remove("example.com", "install");
|
Services.perms.remove(makeURI("http://example.com"), "install");
|
||||||
|
|
||||||
runNextTest();
|
runNextTest();
|
||||||
});
|
});
|
||||||
|
@ -567,7 +567,7 @@ let gTests = [
|
|||||||
is(devicePerms, aExpected ? Perms.ALLOW_ACTION : Perms.DENY_ACTION,
|
is(devicePerms, aExpected ? Perms.ALLOW_ACTION : Perms.DENY_ACTION,
|
||||||
aDevice + " persistently " + (aExpected ? "allowed" : "denied"));
|
aDevice + " persistently " + (aExpected ? "allowed" : "denied"));
|
||||||
}
|
}
|
||||||
Perms.remove(uri.host, aDevice);
|
Perms.remove(uri, aDevice);
|
||||||
}
|
}
|
||||||
checkDevicePermissions("microphone", aExpectedAudioPerm);
|
checkDevicePermissions("microphone", aExpectedAudioPerm);
|
||||||
checkDevicePermissions("camera", aExpectedVideoPerm);
|
checkDevicePermissions("camera", aExpectedVideoPerm);
|
||||||
@ -673,8 +673,8 @@ let gTests = [
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Perms.remove(uri.host, "camera");
|
Perms.remove(uri, "camera");
|
||||||
Perms.remove(uri.host, "microphone");
|
Perms.remove(uri, "microphone");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set both permissions identically
|
// Set both permissions identically
|
||||||
@ -794,8 +794,8 @@ let gTests = [
|
|||||||
// Cleanup.
|
// Cleanup.
|
||||||
yield closeStream(true);
|
yield closeStream(true);
|
||||||
|
|
||||||
Perms.remove(uri.host, "camera");
|
Perms.remove(uri, "camera");
|
||||||
Perms.remove(uri.host, "microphone");
|
Perms.remove(uri, "microphone");
|
||||||
}
|
}
|
||||||
|
|
||||||
info("request audio+video, stop sharing resets both");
|
info("request audio+video, stop sharing resets both");
|
||||||
@ -888,8 +888,8 @@ let gTests = [
|
|||||||
|
|
||||||
// Cleanup.
|
// Cleanup.
|
||||||
yield closeStream(true);
|
yield closeStream(true);
|
||||||
Perms.remove(uri.host, "camera");
|
Perms.remove(uri, "camera");
|
||||||
Perms.remove(uri.host, "microphone");
|
Perms.remove(uri, "microphone");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ function test () {
|
|||||||
|
|
||||||
let pm = Services.perms;
|
let pm = Services.perms;
|
||||||
registerCleanupFunction(function() {
|
registerCleanupFunction(function() {
|
||||||
pm.remove(notificationURL, "desktop-notification");
|
pm.remove(makeURI(notificationURL), "desktop-notification");
|
||||||
gBrowser.removeTab(tab);
|
gBrowser.removeTab(tab);
|
||||||
window.restore();
|
window.restore();
|
||||||
});
|
});
|
||||||
|
@ -44,7 +44,7 @@ add_task(function*() {
|
|||||||
"remote-troubleshooting",
|
"remote-troubleshooting",
|
||||||
Services.perms.ALLOW_ACTION);
|
Services.perms.ALLOW_ACTION);
|
||||||
registerCleanupFunction(() => {
|
registerCleanupFunction(() => {
|
||||||
Services.perms.remove(TEST_URI_GOOD.spec, "remote-troubleshooting");
|
Services.perms.remove(TEST_URI_GOOD, "remote-troubleshooting");
|
||||||
});
|
});
|
||||||
|
|
||||||
// Try again - now we are expecting a response with the actual data.
|
// Try again - now we are expecting a response with the actual data.
|
||||||
|
@ -177,7 +177,7 @@ function clearAllPermissionsByPrefix(aPrefix) {
|
|||||||
while (perms.hasMoreElements()) {
|
while (perms.hasMoreElements()) {
|
||||||
let perm = perms.getNext();
|
let perm = perms.getNext();
|
||||||
if (perm.type.startsWith(aPrefix)) {
|
if (perm.type.startsWith(aPrefix)) {
|
||||||
Services.perms.remove(perm.host, perm.type);
|
Services.perms.removePermission(perm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -38,8 +38,8 @@ function pageInfoObserve(win, topic, data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function finishTest() {
|
function finishTest() {
|
||||||
gPermissionManager.remove("127.0.0.1:8888", gTestPermissionString);
|
gPermissionManager.remove(makeURI("http://127.0.0.1:8888/"), gTestPermissionString);
|
||||||
gPermissionManager.remove("127.0.0.1:8888", gSecondTestPermissionString);
|
gPermissionManager.remove(makeURI("http://127.0.0.1:8888/"), gSecondTestPermissionString);
|
||||||
Services.prefs.clearUserPref("plugins.click_to_play");
|
Services.prefs.clearUserPref("plugins.click_to_play");
|
||||||
gBrowser.removeCurrentTab();
|
gBrowser.removeCurrentTab();
|
||||||
|
|
||||||
@ -59,8 +59,8 @@ function test() {
|
|||||||
setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Second Test Plug-in");
|
setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Second Test Plug-in");
|
||||||
gBrowser.selectedTab = gBrowser.addTab();
|
gBrowser.selectedTab = gBrowser.addTab();
|
||||||
gTestBrowser = gBrowser.selectedBrowser;
|
gTestBrowser = gBrowser.selectedBrowser;
|
||||||
gPermissionManager.remove("127.0.0.1:8888", gTestPermissionString);
|
gPermissionManager.remove(makeURI("http://127.0.0.1:8888/"), gTestPermissionString);
|
||||||
gPermissionManager.remove("127.0.0.1:8888", gSecondTestPermissionString);
|
gPermissionManager.remove(makeURI("http://127.0.0.1:8888/"), gSecondTestPermissionString);
|
||||||
doOnPageLoad(gHttpTestRoot + "plugin_two_types.html", testPart1a);
|
doOnPageLoad(gHttpTestRoot + "plugin_two_types.html", testPart1a);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,8 +141,8 @@ function testPart3() {
|
|||||||
"part 3: Second test plugin should be marked as PLUGIN_DISABLED");
|
"part 3: Second test plugin should be marked as PLUGIN_DISABLED");
|
||||||
|
|
||||||
// reset permissions
|
// reset permissions
|
||||||
gPermissionManager.remove("127.0.0.1:8888", gTestPermissionString);
|
gPermissionManager.remove(makeURI("http://127.0.0.1:8888/"), gTestPermissionString);
|
||||||
gPermissionManager.remove("127.0.0.1:8888", gSecondTestPermissionString);
|
gPermissionManager.remove(makeURI("http://127.0.0.1:8888/"), gSecondTestPermissionString);
|
||||||
// check that changing the permissions affects the radio state in the
|
// check that changing the permissions affects the radio state in the
|
||||||
// open Page Info window
|
// open Page Info window
|
||||||
let testRadioGroup = gPageInfo.document.getElementById(gTestPermissionString + "RadioGroup");
|
let testRadioGroup = gPageInfo.document.getElementById(gTestPermissionString + "RadioGroup");
|
||||||
|
@ -239,7 +239,7 @@ function clearAllPluginPermissions() {
|
|||||||
let perm = perms.getNext();
|
let perm = perms.getNext();
|
||||||
if (perm.type.startsWith('plugin')) {
|
if (perm.type.startsWith('plugin')) {
|
||||||
info("removing permission:" + perm.host + " " + perm.type + "\n");
|
info("removing permission:" + perm.host + " " + perm.type + "\n");
|
||||||
Services.perms.remove(perm.host, perm.type);
|
Services.perms.removePermission(perm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2435,7 +2435,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|||||||
// Remove the current host from the 'trackingprotection' consumer
|
// Remove the current host from the 'trackingprotection' consumer
|
||||||
// of the permission manager. This effectively removes this host
|
// of the permission manager. This effectively removes this host
|
||||||
// from the tracking protection allowlist.
|
// from the tracking protection allowlist.
|
||||||
Services.perms.remove(gBrowser.selectedBrowser.currentURI.host,
|
Services.perms.remove(gBrowser.selectedBrowser.currentURI,
|
||||||
"trackingprotection");
|
"trackingprotection");
|
||||||
BrowserReload();
|
BrowserReload();
|
||||||
]]></body>
|
]]></body>
|
||||||
|
@ -179,7 +179,7 @@ Site.prototype = {
|
|||||||
* e.g. "cookie", "geo", "indexedDB", "popup", "image"
|
* e.g. "cookie", "geo", "indexedDB", "popup", "image"
|
||||||
*/
|
*/
|
||||||
clearPermission: function Site_clearPermission(aType) {
|
clearPermission: function Site_clearPermission(aType) {
|
||||||
Services.perms.remove(this.host, aType);
|
Services.perms.remove(this.httpURI, aType);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -458,7 +458,7 @@ var gAdvancedPane = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
// XXX: duplicated in browser.js
|
// XXX: duplicated in browser.js
|
||||||
_getOfflineAppUsage: function (host, groups)
|
_getOfflineAppUsage: function (perm, groups)
|
||||||
{
|
{
|
||||||
var cacheService = Components.classes["@mozilla.org/network/application-cache-service;1"].
|
var cacheService = Components.classes["@mozilla.org/network/application-cache-service;1"].
|
||||||
getService(Components.interfaces.nsIApplicationCacheService);
|
getService(Components.interfaces.nsIApplicationCacheService);
|
||||||
@ -471,7 +471,7 @@ var gAdvancedPane = {
|
|||||||
var usage = 0;
|
var usage = 0;
|
||||||
for (var i = 0; i < groups.length; i++) {
|
for (var i = 0; i < groups.length; i++) {
|
||||||
var uri = ios.newURI(groups[i], null, null);
|
var uri = ios.newURI(groups[i], null, null);
|
||||||
if (uri.asciiHost == host) {
|
if (uri.asciiHost == perm.host) {
|
||||||
var cache = cacheService.getActiveCache(groups[i]);
|
var cache = cacheService.getActiveCache(groups[i]);
|
||||||
usage += cache.usage;
|
usage += cache.usage;
|
||||||
}
|
}
|
||||||
@ -510,7 +510,7 @@ var gAdvancedPane = {
|
|||||||
row.className = "offlineapp";
|
row.className = "offlineapp";
|
||||||
row.setAttribute("host", perm.host);
|
row.setAttribute("host", perm.host);
|
||||||
var converted = DownloadUtils.
|
var converted = DownloadUtils.
|
||||||
convertByteUnits(this._getOfflineAppUsage(perm.host, groups));
|
convertByteUnits(this._getOfflineAppUsage(perm, groups));
|
||||||
row.setAttribute("usage",
|
row.setAttribute("usage",
|
||||||
bundle.getFormattedString("offlineAppUsage",
|
bundle.getFormattedString("offlineAppUsage",
|
||||||
converted));
|
converted));
|
||||||
@ -557,7 +557,7 @@ var gAdvancedPane = {
|
|||||||
getService(Components.interfaces.nsIIOService);
|
getService(Components.interfaces.nsIIOService);
|
||||||
var groups = cacheService.getGroups();
|
var groups = cacheService.getGroups();
|
||||||
for (var i = 0; i < groups.length; i++) {
|
for (var i = 0; i < groups.length; i++) {
|
||||||
var uri = ios.newURI(groups[i], null, null);
|
let uri = ios.newURI(groups[i], null, null);
|
||||||
if (uri.asciiHost == host) {
|
if (uri.asciiHost == host) {
|
||||||
var cache = cacheService.getActiveCache(groups[i]);
|
var cache = cacheService.getActiveCache(groups[i]);
|
||||||
cache.discard();
|
cache.discard();
|
||||||
@ -567,10 +567,15 @@ var gAdvancedPane = {
|
|||||||
// remove the permission
|
// remove the permission
|
||||||
var pm = Components.classes["@mozilla.org/permissionmanager;1"]
|
var pm = Components.classes["@mozilla.org/permissionmanager;1"]
|
||||||
.getService(Components.interfaces.nsIPermissionManager);
|
.getService(Components.interfaces.nsIPermissionManager);
|
||||||
pm.remove(host, "offline-app",
|
let uri;
|
||||||
Components.interfaces.nsIPermissionManager.ALLOW_ACTION);
|
try {
|
||||||
pm.remove(host, "offline-app",
|
// file:// URIs are stored with their scheme. We try to parse them first, as
|
||||||
Components.interfaces.nsIOfflineCacheUpdateService.ALLOW_NO_WARN);
|
// URIs like http://file:///foo/bar/baz.html will parse as HTTP URIs.
|
||||||
|
uri = ios.newURI(host, null, null);
|
||||||
|
} catch (e) {
|
||||||
|
uri = ios.newURI("http://" + host, null, null);
|
||||||
|
}
|
||||||
|
pm.remove(uri, "offline-app");
|
||||||
|
|
||||||
list.removeChild(item);
|
list.removeChild(item);
|
||||||
gAdvancedPane.offlineAppSelected();
|
gAdvancedPane.offlineAppSelected();
|
||||||
|
@ -492,7 +492,7 @@ var gAdvancedPane = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
// XXX: duplicated in browser.js
|
// XXX: duplicated in browser.js
|
||||||
_getOfflineAppUsage: function (host, groups)
|
_getOfflineAppUsage: function (perm, groups)
|
||||||
{
|
{
|
||||||
var cacheService = Components.classes["@mozilla.org/network/application-cache-service;1"].
|
var cacheService = Components.classes["@mozilla.org/network/application-cache-service;1"].
|
||||||
getService(Components.interfaces.nsIApplicationCacheService);
|
getService(Components.interfaces.nsIApplicationCacheService);
|
||||||
@ -502,7 +502,7 @@ var gAdvancedPane = {
|
|||||||
var usage = 0;
|
var usage = 0;
|
||||||
for (var i = 0; i < groups.length; i++) {
|
for (var i = 0; i < groups.length; i++) {
|
||||||
var uri = ios.newURI(groups[i], null, null);
|
var uri = ios.newURI(groups[i], null, null);
|
||||||
if (uri.asciiHost == host) {
|
if (uri.asciiHost == perm.host) {
|
||||||
var cache = cacheService.getActiveCache(groups[i]);
|
var cache = cacheService.getActiveCache(groups[i]);
|
||||||
usage += cache.usage;
|
usage += cache.usage;
|
||||||
}
|
}
|
||||||
@ -546,7 +546,7 @@ var gAdvancedPane = {
|
|||||||
row.className = "offlineapp";
|
row.className = "offlineapp";
|
||||||
row.setAttribute("host", perm.host);
|
row.setAttribute("host", perm.host);
|
||||||
var converted = DownloadUtils.
|
var converted = DownloadUtils.
|
||||||
convertByteUnits(this._getOfflineAppUsage(perm.host, groups));
|
convertByteUnits(this._getOfflineAppUsage(perm, groups));
|
||||||
row.setAttribute("usage",
|
row.setAttribute("usage",
|
||||||
bundle.getFormattedString("offlineAppUsage",
|
bundle.getFormattedString("offlineAppUsage",
|
||||||
converted));
|
converted));
|
||||||
@ -594,7 +594,7 @@ var gAdvancedPane = {
|
|||||||
getService(Components.interfaces.nsIIOService);
|
getService(Components.interfaces.nsIIOService);
|
||||||
var groups = cacheService.getGroups();
|
var groups = cacheService.getGroups();
|
||||||
for (var i = 0; i < groups.length; i++) {
|
for (var i = 0; i < groups.length; i++) {
|
||||||
var uri = ios.newURI(groups[i], null, null);
|
let uri = ios.newURI(groups[i], null, null);
|
||||||
if (uri.asciiHost == host) {
|
if (uri.asciiHost == host) {
|
||||||
var cache = cacheService.getActiveCache(groups[i]);
|
var cache = cacheService.getActiveCache(groups[i]);
|
||||||
cache.discard();
|
cache.discard();
|
||||||
@ -605,10 +605,15 @@ var gAdvancedPane = {
|
|||||||
// remove the permission
|
// remove the permission
|
||||||
var pm = Components.classes["@mozilla.org/permissionmanager;1"]
|
var pm = Components.classes["@mozilla.org/permissionmanager;1"]
|
||||||
.getService(Components.interfaces.nsIPermissionManager);
|
.getService(Components.interfaces.nsIPermissionManager);
|
||||||
pm.remove(host, "offline-app",
|
let uri;
|
||||||
Components.interfaces.nsIPermissionManager.ALLOW_ACTION);
|
try {
|
||||||
pm.remove(host, "offline-app",
|
// file:// URIs are stored with their scheme. We try to parse them first, as
|
||||||
Components.interfaces.nsIOfflineCacheUpdateService.ALLOW_NO_WARN);
|
// URIs like http://file:///foo/bar/baz.html will parse as HTTP URIs.
|
||||||
|
uri = ios.newURI(host, null, null);
|
||||||
|
} catch (e) {
|
||||||
|
uri = ios.newURI("http://" + host, null, null);
|
||||||
|
}
|
||||||
|
pm.remove(uri, "offline-app");
|
||||||
|
|
||||||
list.removeChild(item);
|
list.removeChild(item);
|
||||||
gAdvancedPane.offlineAppSelected();
|
gAdvancedPane.offlineAppSelected();
|
||||||
|
@ -368,7 +368,8 @@ var gPermissionManager = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (let p of this._permissionsToDelete.values()) {
|
for (let p of this._permissionsToDelete.values()) {
|
||||||
Services.perms.remove(p.host, p.type);
|
let uri = Services.io.newURI("http://" + p.host, null, null);
|
||||||
|
Services.perms.remove(uri, p.type);
|
||||||
}
|
}
|
||||||
|
|
||||||
window.close();
|
window.close();
|
||||||
|
@ -54,9 +54,9 @@ function setup(aCallback) {
|
|||||||
function cleanUp() {
|
function cleanUp() {
|
||||||
for (let type in TEST_PERMS) {
|
for (let type in TEST_PERMS) {
|
||||||
if (type != "password") {
|
if (type != "password") {
|
||||||
Services.perms.remove(TEST_URI_1.host, type);
|
Services.perms.remove(TEST_URI_1, type);
|
||||||
Services.perms.remove(TEST_URI_2.host, type);
|
Services.perms.remove(TEST_URI_2, type);
|
||||||
Services.perms.remove(TEST_URI_3.host, type);
|
Services.perms.remove(TEST_URI_3, type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,8 @@ var testRunner = {
|
|||||||
observances: [{ type: "popup", host: "test.com", data: "added",
|
observances: [{ type: "popup", host: "test.com", data: "added",
|
||||||
capability: Ci.nsIPermissionManager.DENY_ACTION }],
|
capability: Ci.nsIPermissionManager.DENY_ACTION }],
|
||||||
cleanUp: function(params) {
|
cleanUp: function(params) {
|
||||||
params.pm.remove("test.com", "popup");
|
let uri = params.ioService.newURI("http://test.com", null, null);
|
||||||
|
params.pm.remove(uri, "popup");
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
@ -188,8 +188,10 @@ let gTranslationExceptions = {
|
|||||||
|
|
||||||
onSiteDeleted: function() {
|
onSiteDeleted: function() {
|
||||||
let removedSites = this._siteTree.getSelectedItems();
|
let removedSites = this._siteTree.getSelectedItems();
|
||||||
for (let host of removedSites)
|
for (let host of removedSites) {
|
||||||
Services.perms.remove(host, kPermissionType);
|
let uri = Services.io.newURI("http://" + host, null, null);
|
||||||
|
Services.perms.remove(uri, kPermissionType);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onAllSitesDeleted: function() {
|
onAllSitesDeleted: function() {
|
||||||
@ -199,8 +201,10 @@ let gTranslationExceptions = {
|
|||||||
let removedSites = this._sites.splice(0, this._sites.length);
|
let removedSites = this._sites.splice(0, this._sites.length);
|
||||||
this._siteTree.boxObject.rowCountChanged(0, -removedSites.length);
|
this._siteTree.boxObject.rowCountChanged(0, -removedSites.length);
|
||||||
|
|
||||||
for (let host of removedSites)
|
for (let host of removedSites) {
|
||||||
Services.perms.remove(host, kPermissionType);
|
let uri = Services.io.newURI("http://" + host, null, null);
|
||||||
|
Services.perms.remove(uri, kPermissionType);
|
||||||
|
}
|
||||||
|
|
||||||
this.onSiteSelected();
|
this.onSiteSelected();
|
||||||
},
|
},
|
||||||
|
@ -194,7 +194,7 @@ let gTests = [
|
|||||||
"The 'Never translate French' item is disabled");
|
"The 'Never translate French' item is disabled");
|
||||||
|
|
||||||
// Cleanup.
|
// Cleanup.
|
||||||
Services.perms.remove("example.com", "translate");
|
Services.perms.remove(makeURI("http://example.com"), "translate");
|
||||||
notif.close();
|
notif.close();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -287,8 +287,8 @@ let gTests = [
|
|||||||
is(getDomainExceptions().length, 1, "One exception in the permissions");
|
is(getDomainExceptions().length, 1, "One exception in the permissions");
|
||||||
|
|
||||||
// Clear the permissions, and check the last item is removed from the display.
|
// Clear the permissions, and check the last item is removed from the display.
|
||||||
perms.remove("example.org", "translate");
|
perms.remove(makeURI("http://example.org"), "translate");
|
||||||
perms.remove("example.com", "translate");
|
perms.remove(makeURI("http://example.com"), "translate");
|
||||||
is(tree.view.rowCount, 0, "The site exceptions list is empty");
|
is(tree.view.rowCount, 0, "The site exceptions list is empty");
|
||||||
ok(remove.disabled, "The 'Remove Site' button is disabled");
|
ok(remove.disabled, "The 'Remove Site' button is disabled");
|
||||||
ok(removeAll.disabled, "The 'Remove All Site' button is disabled");
|
ok(removeAll.disabled, "The 'Remove All Site' button is disabled");
|
||||||
|
@ -212,7 +212,7 @@ function UITourTest() {
|
|||||||
gBrowser.removeTab(gTestTab);
|
gBrowser.removeTab(gTestTab);
|
||||||
delete window.gTestTab;
|
delete window.gTestTab;
|
||||||
Services.prefs.clearUserPref("browser.uitour.enabled", true);
|
Services.prefs.clearUserPref("browser.uitour.enabled", true);
|
||||||
Services.perms.remove("example.com", "uitour");
|
Services.perms.remove(testUri, "uitour");
|
||||||
});
|
});
|
||||||
|
|
||||||
function done() {
|
function done() {
|
||||||
|
@ -93,7 +93,7 @@ this.SitePermissions = {
|
|||||||
if (!this.isSupportedURI(aURI))
|
if (!this.isSupportedURI(aURI))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Services.perms.remove(aURI.host, aPermissionID);
|
Services.perms.remove(aURI, aPermissionID);
|
||||||
},
|
},
|
||||||
|
|
||||||
/* Returns the localized label for the permission with the given ID, to be
|
/* Returns the localized label for the permission with the given ID, to be
|
||||||
|
@ -112,7 +112,7 @@ add_task(function* setupEnvironment() {
|
|||||||
Services.perms.add(pageURI, "uitour", Services.perms.ALLOW_ACTION);
|
Services.perms.add(pageURI, "uitour", Services.perms.ALLOW_ACTION);
|
||||||
|
|
||||||
registerCleanupFunction(() => {
|
registerCleanupFunction(() => {
|
||||||
Services.perms.remove("example.com", "uitour");
|
Services.perms.remove(pageURI, "uitour");
|
||||||
Preferences.set(PREF_SELFSUPPORT_ENABLED, selfSupportEnabled);
|
Preferences.set(PREF_SELFSUPPORT_ENABLED, selfSupportEnabled);
|
||||||
Preferences.set(PREF_UITOUR_ENABLED, uitourEnabled);
|
Preferences.set(PREF_UITOUR_ENABLED, uitourEnabled);
|
||||||
Preferences.set(PREF_SELFSUPPORT_URL, selfSupportURL);
|
Preferences.set(PREF_SELFSUPPORT_URL, selfSupportURL);
|
||||||
|
@ -749,14 +749,13 @@ function updateBrowserSpecificIndicator(aBrowser, aState) {
|
|||||||
accessKey: stringBundle.getString("getUserMedia.stopSharing.accesskey"),
|
accessKey: stringBundle.getString("getUserMedia.stopSharing.accesskey"),
|
||||||
callback: function () {
|
callback: function () {
|
||||||
let uri = Services.io.newURI(aState.documentURI, null, null);
|
let uri = Services.io.newURI(aState.documentURI, null, null);
|
||||||
let host = getHost(uri);
|
|
||||||
let perms = Services.perms;
|
let perms = Services.perms;
|
||||||
if (aState.camera &&
|
if (aState.camera &&
|
||||||
perms.testExactPermission(uri, "camera") == perms.ALLOW_ACTION)
|
perms.testExactPermission(uri, "camera") == perms.ALLOW_ACTION)
|
||||||
perms.remove(host, "camera");
|
perms.remove(uri, "camera");
|
||||||
if (aState.microphone &&
|
if (aState.microphone &&
|
||||||
perms.testExactPermission(uri, "microphone") == perms.ALLOW_ACTION)
|
perms.testExactPermission(uri, "microphone") == perms.ALLOW_ACTION)
|
||||||
perms.remove(host, "microphone");
|
perms.remove(uri, "microphone");
|
||||||
|
|
||||||
let mm = notification.browser.messageManager;
|
let mm = notification.browser.messageManager;
|
||||||
mm.sendAsyncMessage("webrtc:StopSharing", windowId);
|
mm.sendAsyncMessage("webrtc:StopSharing", windowId);
|
||||||
|
@ -2913,6 +2913,7 @@ toolbarbutton.chevron > .toolbarbutton-menu-dropmarker {
|
|||||||
.tabbrowser-arrowscrollbox > .scrollbutton-down:not([disabled]):hover:active,
|
.tabbrowser-arrowscrollbox > .scrollbutton-down:not([disabled]):hover:active,
|
||||||
#TabsToolbar .toolbarbutton-1:not([type="menu-button"]):not([disabled=true]):hover:active,
|
#TabsToolbar .toolbarbutton-1:not([type="menu-button"]):not([disabled=true]):hover:active,
|
||||||
#TabsToolbar .toolbarbutton-1[type="menu"][open],
|
#TabsToolbar .toolbarbutton-1[type="menu"][open],
|
||||||
|
#TabsToolbar .toolbarbutton-1[type="panel"][open],
|
||||||
#TabsToolbar .toolbarbutton-1 > .toolbarbutton-menubutton-button:not([disabled=true]):hover:active,
|
#TabsToolbar .toolbarbutton-1 > .toolbarbutton-menubutton-button:not([disabled=true]):hover:active,
|
||||||
#TabsToolbar .toolbarbutton-1[open]:not([disabled=true]):hover > .toolbarbutton-menubutton-dropmarker {
|
#TabsToolbar .toolbarbutton-1[open]:not([disabled=true]):hover > .toolbarbutton-menubutton-dropmarker {
|
||||||
background-image: linear-gradient(transparent, rgba(0,0,0,.3)) !important;
|
background-image: linear-gradient(transparent, rgba(0,0,0,.3)) !important;
|
||||||
|
@ -642,6 +642,7 @@ toolbar[brighttext] .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker {
|
|||||||
-moz-padding-end: 5px;
|
-moz-padding-end: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#nav-bar .toolbarbutton-1[type=panel]:not(#back-button):not(#forward-button):not(#feed-button):not(#PanelUI-menu-button),
|
||||||
#nav-bar .toolbarbutton-1[type=menu]:not(#back-button):not(#forward-button):not(#feed-button):not(#PanelUI-menu-button) {
|
#nav-bar .toolbarbutton-1[type=menu]:not(#back-button):not(#forward-button):not(#feed-button):not(#PanelUI-menu-button) {
|
||||||
padding-left: 5px;
|
padding-left: 5px;
|
||||||
padding-right: 5px;
|
padding-right: 5px;
|
||||||
@ -753,7 +754,10 @@ toolbarbutton[constrain-size="true"][cui-areatype="toolbar"] > .toolbarbutton-ba
|
|||||||
width: 32px;
|
width: 32px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#nav-bar .toolbarbutton-1[type=panel]:not(#back-button):not(#forward-button):not(#feed-button):not(#PanelUI-menu-button) > .toolbarbutton-icon,
|
||||||
|
#nav-bar .toolbarbutton-1[type=panel]:not(#back-button):not(#forward-button):not(#feed-button):not(#PanelUI-menu-button) > .toolbarbutton-badge-container,
|
||||||
#nav-bar .toolbarbutton-1[type=menu]:not(#back-button):not(#forward-button):not(#feed-button):not(#PanelUI-menu-button) > .toolbarbutton-icon,
|
#nav-bar .toolbarbutton-1[type=menu]:not(#back-button):not(#forward-button):not(#feed-button):not(#PanelUI-menu-button) > .toolbarbutton-icon,
|
||||||
|
#nav-bar .toolbarbutton-1[type=menu]:not(#back-button):not(#forward-button):not(#feed-button):not(#PanelUI-menu-button) > .toolbarbutton-badge-container,
|
||||||
#nav-bar .toolbarbutton-1[type=menu] > .toolbarbutton-text /* hack for add-ons that forcefully display the label */ {
|
#nav-bar .toolbarbutton-1[type=menu] > .toolbarbutton-text /* hack for add-ons that forcefully display the label */ {
|
||||||
-moz-padding-end: 17px;
|
-moz-padding-end: 17px;
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ static nsresult
|
|||||||
BroadcastDomainSetChange(DomainSetType aSetType, DomainSetChangeType aChangeType,
|
BroadcastDomainSetChange(DomainSetType aSetType, DomainSetChangeType aChangeType,
|
||||||
nsIURI* aDomain = nullptr)
|
nsIURI* aDomain = nullptr)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(XRE_GetProcessType() == GeckoProcessType_Default,
|
MOZ_ASSERT(XRE_IsParentProcess(),
|
||||||
"DomainPolicy should only be exposed to the chrome process.");
|
"DomainPolicy should only be exposed to the chrome process.");
|
||||||
|
|
||||||
nsTArray<ContentParent*> parents;
|
nsTArray<ContentParent*> parents;
|
||||||
@ -45,7 +45,7 @@ DomainPolicy::DomainPolicy() : mBlacklist(new DomainSet(BLACKLIST))
|
|||||||
, mWhitelist(new DomainSet(WHITELIST))
|
, mWhitelist(new DomainSet(WHITELIST))
|
||||||
, mSuperWhitelist(new DomainSet(SUPER_WHITELIST))
|
, mSuperWhitelist(new DomainSet(SUPER_WHITELIST))
|
||||||
{
|
{
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Default) {
|
if (XRE_IsParentProcess()) {
|
||||||
BroadcastDomainSetChange(NO_TYPE, ACTIVATE_POLICY);
|
BroadcastDomainSetChange(NO_TYPE, ACTIVATE_POLICY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -112,7 +112,7 @@ DomainPolicy::Deactivate()
|
|||||||
if (ssm) {
|
if (ssm) {
|
||||||
ssm->DeactivateDomainPolicy();
|
ssm->DeactivateDomainPolicy();
|
||||||
}
|
}
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Default) {
|
if (XRE_IsParentProcess()) {
|
||||||
BroadcastDomainSetChange(NO_TYPE, DEACTIVATE_POLICY);
|
BroadcastDomainSetChange(NO_TYPE, DEACTIVATE_POLICY);
|
||||||
}
|
}
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
@ -170,7 +170,7 @@ DomainSet::Add(nsIURI* aDomain)
|
|||||||
nsCOMPtr<nsIURI> clone = GetCanonicalClone(aDomain);
|
nsCOMPtr<nsIURI> clone = GetCanonicalClone(aDomain);
|
||||||
NS_ENSURE_TRUE(clone, NS_ERROR_FAILURE);
|
NS_ENSURE_TRUE(clone, NS_ERROR_FAILURE);
|
||||||
mHashTable.PutEntry(clone);
|
mHashTable.PutEntry(clone);
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Default)
|
if (XRE_IsParentProcess())
|
||||||
return BroadcastDomainSetChange(mType, ADD_DOMAIN, aDomain);
|
return BroadcastDomainSetChange(mType, ADD_DOMAIN, aDomain);
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
@ -182,7 +182,7 @@ DomainSet::Remove(nsIURI* aDomain)
|
|||||||
nsCOMPtr<nsIURI> clone = GetCanonicalClone(aDomain);
|
nsCOMPtr<nsIURI> clone = GetCanonicalClone(aDomain);
|
||||||
NS_ENSURE_TRUE(clone, NS_ERROR_FAILURE);
|
NS_ENSURE_TRUE(clone, NS_ERROR_FAILURE);
|
||||||
mHashTable.RemoveEntry(clone);
|
mHashTable.RemoveEntry(clone);
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Default)
|
if (XRE_IsParentProcess())
|
||||||
return BroadcastDomainSetChange(mType, REMOVE_DOMAIN, aDomain);
|
return BroadcastDomainSetChange(mType, REMOVE_DOMAIN, aDomain);
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
@ -192,7 +192,7 @@ NS_IMETHODIMP
|
|||||||
DomainSet::Clear()
|
DomainSet::Clear()
|
||||||
{
|
{
|
||||||
mHashTable.Clear();
|
mHashTable.Clear();
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Default)
|
if (XRE_IsParentProcess())
|
||||||
return BroadcastDomainSetChange(mType, CLEAR_DOMAINS);
|
return BroadcastDomainSetChange(mType, CLEAR_DOMAINS);
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
@ -1283,7 +1283,7 @@ nsScriptSecurityManager::~nsScriptSecurityManager(void)
|
|||||||
// ContentChild might hold a reference to the domain policy,
|
// ContentChild might hold a reference to the domain policy,
|
||||||
// and it might release it only after the security manager is
|
// and it might release it only after the security manager is
|
||||||
// gone. But we can still assert this for the main process.
|
// gone. But we can still assert this for the main process.
|
||||||
MOZ_ASSERT_IF(XRE_GetProcessType() == GeckoProcessType_Default,
|
MOZ_ASSERT_IF(XRE_IsParentProcess(),
|
||||||
!mDomainPolicy);
|
!mDomainPolicy);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1500,7 +1500,7 @@ nsScriptSecurityManager::GetDomainPolicyActive(bool *aRv)
|
|||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsScriptSecurityManager::ActivateDomainPolicy(nsIDomainPolicy** aRv)
|
nsScriptSecurityManager::ActivateDomainPolicy(nsIDomainPolicy** aRv)
|
||||||
{
|
{
|
||||||
if (XRE_GetProcessType() != GeckoProcessType_Default) {
|
if (!XRE_IsParentProcess()) {
|
||||||
return NS_ERROR_SERVICE_NOT_AVAILABLE;
|
return NS_ERROR_SERVICE_NOT_AVAILABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -416,7 +416,7 @@ nsDefaultURIFixup::KeywordToURI(const nsACString& aKeyword,
|
|||||||
}
|
}
|
||||||
keyword.Trim(" ");
|
keyword.Trim(" ");
|
||||||
|
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Content) {
|
if (XRE_IsContentProcess()) {
|
||||||
dom::ContentChild* contentChild = dom::ContentChild::GetSingleton();
|
dom::ContentChild* contentChild = dom::ContentChild::GetSingleton();
|
||||||
if (!contentChild) {
|
if (!contentChild) {
|
||||||
return NS_ERROR_NOT_AVAILABLE;
|
return NS_ERROR_NOT_AVAILABLE;
|
||||||
|
@ -824,7 +824,7 @@ IncreasePrivateDocShellCount()
|
|||||||
{
|
{
|
||||||
gNumberOfPrivateDocShells++;
|
gNumberOfPrivateDocShells++;
|
||||||
if (gNumberOfPrivateDocShells > 1 ||
|
if (gNumberOfPrivateDocShells > 1 ||
|
||||||
XRE_GetProcessType() != GeckoProcessType_Content) {
|
!XRE_IsContentProcess()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -838,7 +838,7 @@ DecreasePrivateDocShellCount()
|
|||||||
MOZ_ASSERT(gNumberOfPrivateDocShells > 0);
|
MOZ_ASSERT(gNumberOfPrivateDocShells > 0);
|
||||||
gNumberOfPrivateDocShells--;
|
gNumberOfPrivateDocShells--;
|
||||||
if (!gNumberOfPrivateDocShells) {
|
if (!gNumberOfPrivateDocShells) {
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Content) {
|
if (XRE_IsContentProcess()) {
|
||||||
dom::ContentChild* cc = dom::ContentChild::GetSingleton();
|
dom::ContentChild* cc = dom::ContentChild::GetSingleton();
|
||||||
cc->SendPrivateDocShellsExist(false);
|
cc->SendPrivateDocShellsExist(false);
|
||||||
return;
|
return;
|
||||||
@ -5020,7 +5020,7 @@ nsDocShell::DisplayLoadError(nsresult aError, nsIURI* aURI,
|
|||||||
mInPrivateBrowsing ? nsISocketProvider::NO_PERMANENT_STORAGE : 0;
|
mInPrivateBrowsing ? nsISocketProvider::NO_PERMANENT_STORAGE : 0;
|
||||||
bool isStsHost = false;
|
bool isStsHost = false;
|
||||||
bool isPinnedHost = false;
|
bool isPinnedHost = false;
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Default) {
|
if (XRE_IsParentProcess()) {
|
||||||
nsCOMPtr<nsISiteSecurityService> sss =
|
nsCOMPtr<nsISiteSecurityService> sss =
|
||||||
do_GetService(NS_SSSERVICE_CONTRACTID, &rv);
|
do_GetService(NS_SSSERVICE_CONTRACTID, &rv);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
@ -9448,7 +9448,7 @@ nsDocShell::CopyFavicon(nsIURI* aOldURI,
|
|||||||
nsIURI* aNewURI,
|
nsIURI* aNewURI,
|
||||||
bool aInPrivateBrowsing)
|
bool aInPrivateBrowsing)
|
||||||
{
|
{
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Content) {
|
if (XRE_IsContentProcess()) {
|
||||||
dom::ContentChild* contentChild = dom::ContentChild::GetSingleton();
|
dom::ContentChild* contentChild = dom::ContentChild::GetSingleton();
|
||||||
if (contentChild) {
|
if (contentChild) {
|
||||||
mozilla::ipc::URIParams oldURI, newURI;
|
mozilla::ipc::URIParams oldURI, newURI;
|
||||||
@ -13991,7 +13991,7 @@ nsDocShell::MaybeNotifyKeywordSearchLoading(const nsString& aProvider,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Content) {
|
if (XRE_IsContentProcess()) {
|
||||||
dom::ContentChild* contentChild = dom::ContentChild::GetSingleton();
|
dom::ContentChild* contentChild = dom::ContentChild::GetSingleton();
|
||||||
if (contentChild) {
|
if (contentChild) {
|
||||||
contentChild->SendNotifyKeywordSearchLoading(aProvider, aKeyword);
|
contentChild->SendNotifyKeywordSearchLoading(aProvider, aKeyword);
|
||||||
|
@ -57,12 +57,6 @@ namespace asmjscache {
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
bool
|
|
||||||
IsMainProcess()
|
|
||||||
{
|
|
||||||
return XRE_GetProcessType() == GeckoProcessType_Default;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Anything smaller should compile fast enough that caching will just add
|
// Anything smaller should compile fast enough that caching will just add
|
||||||
// overhead.
|
// overhead.
|
||||||
static const size_t sMinCachedModuleLength = 10000;
|
static const size_t sMinCachedModuleLength = 10000;
|
||||||
@ -504,7 +498,7 @@ public:
|
|||||||
mIsApp(false),
|
mIsApp(false),
|
||||||
mEnforcingQuota(true)
|
mEnforcingQuota(true)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(IsMainProcess());
|
MOZ_ASSERT(XRE_IsParentProcess());
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ~MainProcessRunnable()
|
virtual ~MainProcessRunnable()
|
||||||
@ -1147,7 +1141,7 @@ public:
|
|||||||
: MainProcessRunnable(aPrincipal, aOpenMode, aWriteParams),
|
: MainProcessRunnable(aPrincipal, aOpenMode, aWriteParams),
|
||||||
mReadParams(aReadParams)
|
mReadParams(aReadParams)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(IsMainProcess());
|
MOZ_ASSERT(XRE_IsParentProcess());
|
||||||
MOZ_ASSERT(!NS_IsMainThread());
|
MOZ_ASSERT(!NS_IsMainThread());
|
||||||
MOZ_COUNT_CTOR(SingleProcessRunnable);
|
MOZ_COUNT_CTOR(SingleProcessRunnable);
|
||||||
}
|
}
|
||||||
@ -1229,7 +1223,7 @@ public:
|
|||||||
mOpened(false),
|
mOpened(false),
|
||||||
mFinished(false)
|
mFinished(false)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(IsMainProcess());
|
MOZ_ASSERT(XRE_IsParentProcess());
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
MOZ_COUNT_CTOR(ParentProcessRunnable);
|
MOZ_COUNT_CTOR(ParentProcessRunnable);
|
||||||
}
|
}
|
||||||
@ -1408,7 +1402,7 @@ public:
|
|||||||
mActorDestroyed(false),
|
mActorDestroyed(false),
|
||||||
mState(eInitial)
|
mState(eInitial)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(!IsMainProcess());
|
MOZ_ASSERT(!XRE_IsParentProcess());
|
||||||
MOZ_ASSERT(!NS_IsMainThread());
|
MOZ_ASSERT(!NS_IsMainThread());
|
||||||
MOZ_COUNT_CTOR(ChildProcessRunnable);
|
MOZ_COUNT_CTOR(ChildProcessRunnable);
|
||||||
}
|
}
|
||||||
@ -1604,7 +1598,7 @@ OpenFile(nsIPrincipal* aPrincipal,
|
|||||||
// parent process to open the file and interact with the QuotaManager. The
|
// parent process to open the file and interact with the QuotaManager. The
|
||||||
// child can then map the file into its address space to perform I/O.
|
// child can then map the file into its address space to perform I/O.
|
||||||
nsRefPtr<File> file;
|
nsRefPtr<File> file;
|
||||||
if (IsMainProcess()) {
|
if (XRE_IsParentProcess()) {
|
||||||
file = new SingleProcessRunnable(aPrincipal, aOpenMode, aWriteParams,
|
file = new SingleProcessRunnable(aPrincipal, aOpenMode, aWriteParams,
|
||||||
aReadParams);
|
aReadParams);
|
||||||
} else {
|
} else {
|
||||||
|
@ -70,7 +70,7 @@ AudioChannelService::GetAudioChannelService()
|
|||||||
{
|
{
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
|
|
||||||
if (XRE_GetProcessType() != GeckoProcessType_Default) {
|
if (!XRE_IsParentProcess()) {
|
||||||
return AudioChannelServiceChild::GetAudioChannelService();
|
return AudioChannelServiceChild::GetAudioChannelService();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -84,7 +84,7 @@ AudioChannelService::GetOrCreateAudioChannelService()
|
|||||||
{
|
{
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
|
|
||||||
if (XRE_GetProcessType() != GeckoProcessType_Default) {
|
if (!XRE_IsParentProcess()) {
|
||||||
return AudioChannelServiceChild::GetOrCreateAudioChannelService();
|
return AudioChannelServiceChild::GetOrCreateAudioChannelService();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -104,7 +104,7 @@ AudioChannelService::GetOrCreateAudioChannelService()
|
|||||||
void
|
void
|
||||||
AudioChannelService::Shutdown()
|
AudioChannelService::Shutdown()
|
||||||
{
|
{
|
||||||
if (XRE_GetProcessType() != GeckoProcessType_Default) {
|
if (!XRE_IsParentProcess()) {
|
||||||
return AudioChannelServiceChild::Shutdown();
|
return AudioChannelServiceChild::Shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -122,7 +122,7 @@ AudioChannelService::AudioChannelService()
|
|||||||
, mDisabled(false)
|
, mDisabled(false)
|
||||||
, mDefChannelChildID(CONTENT_PROCESS_ID_UNKNOWN)
|
, mDefChannelChildID(CONTENT_PROCESS_ID_UNKNOWN)
|
||||||
{
|
{
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Default) {
|
if (XRE_IsParentProcess()) {
|
||||||
nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
|
nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
|
||||||
if (obs) {
|
if (obs) {
|
||||||
obs->AddObserver(this, "ipc:content-shutdown", false);
|
obs->AddObserver(this, "ipc:content-shutdown", false);
|
||||||
@ -180,7 +180,7 @@ AudioChannelService::RegisterType(AudioChannel aChannel, uint64_t aChildID,
|
|||||||
AudioChannelInternalType type = GetInternalType(aChannel, true);
|
AudioChannelInternalType type = GetInternalType(aChannel, true);
|
||||||
mChannelCounters[type].AppendElement(aChildID);
|
mChannelCounters[type].AppendElement(aChildID);
|
||||||
|
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Default) {
|
if (XRE_IsParentProcess()) {
|
||||||
|
|
||||||
// We must keep the childIds in order to decide which app is allowed to play
|
// We must keep the childIds in order to decide which app is allowed to play
|
||||||
// with then telephony channel.
|
// with then telephony channel.
|
||||||
@ -272,7 +272,7 @@ AudioChannelService::UnregisterType(AudioChannel aChannel,
|
|||||||
// There are two reasons to defer the decrease of telephony channel.
|
// There are two reasons to defer the decrease of telephony channel.
|
||||||
// 1. User can have time to remove device from his ear before music resuming.
|
// 1. User can have time to remove device from his ear before music resuming.
|
||||||
// 2. Give BT SCO to be disconnected before starting to connect A2DP.
|
// 2. Give BT SCO to be disconnected before starting to connect A2DP.
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Default) {
|
if (XRE_IsParentProcess()) {
|
||||||
|
|
||||||
if (aChannel == AudioChannel::Telephony) {
|
if (aChannel == AudioChannel::Telephony) {
|
||||||
UnregisterTelephonyChild(aChildID);
|
UnregisterTelephonyChild(aChildID);
|
||||||
@ -306,7 +306,7 @@ AudioChannelService::UnregisterTypeInternal(AudioChannel aChannel,
|
|||||||
|
|
||||||
// In order to avoid race conditions, it's safer to notify any existing
|
// In order to avoid race conditions, it's safer to notify any existing
|
||||||
// agent any time a new one is registered.
|
// agent any time a new one is registered.
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Default) {
|
if (XRE_IsParentProcess()) {
|
||||||
// No hidden content channel is playable if the original playable hidden
|
// No hidden content channel is playable if the original playable hidden
|
||||||
// process does not need to play audio from background anymore.
|
// process does not need to play audio from background anymore.
|
||||||
if (aChannel == AudioChannel::Content &&
|
if (aChannel == AudioChannel::Content &&
|
||||||
@ -547,7 +547,7 @@ AudioChannelService::SetDefaultVolumeControlChannelInternal(int32_t aChannel,
|
|||||||
bool aVisible,
|
bool aVisible,
|
||||||
uint64_t aChildID)
|
uint64_t aChildID)
|
||||||
{
|
{
|
||||||
if (XRE_GetProcessType() != GeckoProcessType_Default) {
|
if (!XRE_IsParentProcess()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -590,7 +590,7 @@ AudioChannelService::SetDefaultVolumeControlChannelInternal(int32_t aChannel,
|
|||||||
void
|
void
|
||||||
AudioChannelService::SendAudioChannelChangedNotification(uint64_t aChildID)
|
AudioChannelService::SendAudioChannelChangedNotification(uint64_t aChildID)
|
||||||
{
|
{
|
||||||
if (XRE_GetProcessType() != GeckoProcessType_Default) {
|
if (!XRE_IsParentProcess()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ Crypto::GetRandomValues(JSContext* aCx, const ArrayBufferView& aArray,
|
|||||||
|
|
||||||
uint8_t* data = aArray.Data();
|
uint8_t* data = aArray.Data();
|
||||||
|
|
||||||
if (XRE_GetProcessType() != GeckoProcessType_Default) {
|
if (!XRE_IsParentProcess()) {
|
||||||
InfallibleTArray<uint8_t> randomValues;
|
InfallibleTArray<uint8_t> randomValues;
|
||||||
// Tell the parent process to generate random values via PContent
|
// Tell the parent process to generate random values via PContent
|
||||||
ContentChild* cc = ContentChild::GetSingleton();
|
ContentChild* cc = ContentChild::GetSingleton();
|
||||||
|
@ -1481,7 +1481,7 @@ Navigator::GetFeature(const nsAString& aName, ErrorResult& aRv)
|
|||||||
#if defined(XP_LINUX)
|
#if defined(XP_LINUX)
|
||||||
if (aName.EqualsLiteral("hardware.memory")) {
|
if (aName.EqualsLiteral("hardware.memory")) {
|
||||||
// with seccomp enabled, fopen() should be in a non-sandboxed process
|
// with seccomp enabled, fopen() should be in a non-sandboxed process
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Default) {
|
if (XRE_IsParentProcess()) {
|
||||||
uint32_t memLevel = mozilla::hal::GetTotalSystemMemoryLevel();
|
uint32_t memLevel = mozilla::hal::GetTotalSystemMemoryLevel();
|
||||||
if (memLevel == 0) {
|
if (memLevel == 0) {
|
||||||
p->MaybeReject(NS_ERROR_NOT_AVAILABLE);
|
p->MaybeReject(NS_ERROR_NOT_AVAILABLE);
|
||||||
@ -2549,7 +2549,7 @@ Navigator::HasTVSupport(JSContext* aCx, JSObject* aGlobal)
|
|||||||
bool
|
bool
|
||||||
Navigator::IsE10sEnabled(JSContext* aCx, JSObject* aGlobal)
|
Navigator::IsE10sEnabled(JSContext* aCx, JSObject* aGlobal)
|
||||||
{
|
{
|
||||||
return XRE_GetProcessType() == GeckoProcessType_Content;
|
return XRE_IsContentProcess();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
@ -141,7 +141,7 @@ static void
|
|||||||
MarkMessageManagers()
|
MarkMessageManagers()
|
||||||
{
|
{
|
||||||
// The global message manager only exists in the root process.
|
// The global message manager only exists in the root process.
|
||||||
if (XRE_GetProcessType() != GeckoProcessType_Default) {
|
if (!XRE_IsParentProcess()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
nsCOMPtr<nsIMessageBroadcaster> strongGlobalMM =
|
nsCOMPtr<nsIMessageBroadcaster> strongGlobalMM =
|
||||||
|
@ -336,7 +336,7 @@ nsContentPermissionUtils::AskPermission(nsIContentPermissionRequest* aRequest, n
|
|||||||
NS_ENSURE_STATE(aWindow && aWindow->IsCurrentInnerWindow());
|
NS_ENSURE_STATE(aWindow && aWindow->IsCurrentInnerWindow());
|
||||||
|
|
||||||
// for content process
|
// for content process
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Content) {
|
if (XRE_IsContentProcess()) {
|
||||||
|
|
||||||
nsRefPtr<RemotePermissionRequest> req =
|
nsRefPtr<RemotePermissionRequest> req =
|
||||||
new RemotePermissionRequest(aRequest, aWindow);
|
new RemotePermissionRequest(aRequest, aWindow);
|
||||||
|
@ -10658,7 +10658,7 @@ PLDHashOperator UnlockEnumerator(imgIRequest* aKey,
|
|||||||
nsresult
|
nsresult
|
||||||
nsDocument::SetImageLockingState(bool aLocked)
|
nsDocument::SetImageLockingState(bool aLocked)
|
||||||
{
|
{
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Content &&
|
if (XRE_IsContentProcess() &&
|
||||||
!Preferences::GetBool("image.mem.allow_locking_in_content_processes", true)) {
|
!Preferences::GetBool("image.mem.allow_locking_in_content_processes", true)) {
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
@ -11161,8 +11161,17 @@ ExitFullscreenInDocTree(nsIDocument* aMaybeNotARootDoc)
|
|||||||
if (!root) {
|
if (!root) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
NS_ASSERTION(root->IsFullScreenDoc(),
|
if (!root->IsFullScreenDoc()) {
|
||||||
"Fullscreen root should be a fullscreen doc...");
|
// If a document was detached before exiting from fullscreen, it is
|
||||||
|
// possible that the root had left fullscreen state. In this case,
|
||||||
|
// we would not get anything from the ResetFullScreen() call. Root's
|
||||||
|
// not being a fullscreen doc also means the widget should have
|
||||||
|
// exited fullscreen state. It means even if we do not return here,
|
||||||
|
// we would actually do nothing below except crashing ourselves via
|
||||||
|
// dispatching the "MozDOMFullscreen:Exited" event to an nonexistent
|
||||||
|
// document.
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Stores a list of documents to which we must dispatch "mozfullscreenchange".
|
// Stores a list of documents to which we must dispatch "mozfullscreenchange".
|
||||||
// We're required by the spec to dispatch the events in leaf-to-root
|
// We're required by the spec to dispatch the events in leaf-to-root
|
||||||
|
@ -697,7 +697,7 @@ nsFocusManager::WindowRaised(nsIDOMWindow* aWindow)
|
|||||||
// If this is a parent or single process window, send the activate event.
|
// If this is a parent or single process window, send the activate event.
|
||||||
// Events for child process windows will be sent when ParentActivated
|
// Events for child process windows will be sent when ParentActivated
|
||||||
// is called.
|
// is called.
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Default) {
|
if (XRE_IsParentProcess()) {
|
||||||
ActivateOrDeactivate(window, true);
|
ActivateOrDeactivate(window, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -760,7 +760,7 @@ nsFocusManager::WindowLowered(nsIDOMWindow* aWindow)
|
|||||||
// If this is a parent or single process window, send the deactivate event.
|
// If this is a parent or single process window, send the deactivate event.
|
||||||
// Events for child process windows will be sent when ParentActivated
|
// Events for child process windows will be sent when ParentActivated
|
||||||
// is called.
|
// is called.
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Default) {
|
if (XRE_IsParentProcess()) {
|
||||||
ActivateOrDeactivate(window, false);
|
ActivateOrDeactivate(window, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1600,12 +1600,12 @@ nsFrameLoader::ShouldUseRemoteProcess()
|
|||||||
|
|
||||||
// Don't try to launch nested children if we don't have OMTC.
|
// Don't try to launch nested children if we don't have OMTC.
|
||||||
// They won't render!
|
// They won't render!
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Content &&
|
if (XRE_IsContentProcess() &&
|
||||||
!CompositorChild::ChildProcessHasCompositor()) {
|
!CompositorChild::ChildProcessHasCompositor()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Content &&
|
if (XRE_IsContentProcess() &&
|
||||||
!(PR_GetEnv("MOZ_NESTED_OOP_TABS") ||
|
!(PR_GetEnv("MOZ_NESTED_OOP_TABS") ||
|
||||||
Preferences::GetBool("dom.ipc.tabs.nested.enabled", false))) {
|
Preferences::GetBool("dom.ipc.tabs.nested.enabled", false))) {
|
||||||
return false;
|
return false;
|
||||||
@ -2649,7 +2649,7 @@ nsFrameLoader::ResetPermissionManagerStatus()
|
|||||||
{
|
{
|
||||||
// The resetting of the permissions status can run only
|
// The resetting of the permissions status can run only
|
||||||
// in the main process.
|
// in the main process.
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Content) {
|
if (XRE_IsContentProcess()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -902,7 +902,7 @@ nsFrameMessageManager::Dump(const nsAString& aStr)
|
|||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsFrameMessageManager::PrivateNoteIntentionalCrash()
|
nsFrameMessageManager::PrivateNoteIntentionalCrash()
|
||||||
{
|
{
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Content) {
|
if (XRE_IsContentProcess()) {
|
||||||
mozilla::NoteIntentionalCrash("tab");
|
mozilla::NoteIntentionalCrash("tab");
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
} else {
|
} else {
|
||||||
@ -1576,7 +1576,7 @@ MessageManagerReporter::CollectReports(nsIMemoryReporterCallback* aCb,
|
|||||||
{
|
{
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
|
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Default) {
|
if (XRE_IsParentProcess()) {
|
||||||
nsCOMPtr<nsIMessageBroadcaster> globalmm =
|
nsCOMPtr<nsIMessageBroadcaster> globalmm =
|
||||||
do_GetService("@mozilla.org/globalmessagemanager;1");
|
do_GetService("@mozilla.org/globalmessagemanager;1");
|
||||||
if (globalmm) {
|
if (globalmm) {
|
||||||
@ -1612,7 +1612,7 @@ MessageManagerReporter::CollectReports(nsIMemoryReporterCallback* aCb,
|
|||||||
nsresult
|
nsresult
|
||||||
NS_NewGlobalMessageManager(nsIMessageBroadcaster** aResult)
|
NS_NewGlobalMessageManager(nsIMessageBroadcaster** aResult)
|
||||||
{
|
{
|
||||||
NS_ENSURE_TRUE(XRE_GetProcessType() == GeckoProcessType_Default,
|
NS_ENSURE_TRUE(XRE_IsParentProcess(),
|
||||||
NS_ERROR_NOT_AVAILABLE);
|
NS_ERROR_NOT_AVAILABLE);
|
||||||
nsRefPtr<nsFrameMessageManager> mm = new nsFrameMessageManager(nullptr,
|
nsRefPtr<nsFrameMessageManager> mm = new nsFrameMessageManager(nullptr,
|
||||||
nullptr,
|
nullptr,
|
||||||
@ -2141,7 +2141,7 @@ NS_NewChildProcessMessageManager(nsISyncMessageSender** aResult)
|
|||||||
"Re-creating sChildProcessManager");
|
"Re-creating sChildProcessManager");
|
||||||
|
|
||||||
MessageManagerCallback* cb;
|
MessageManagerCallback* cb;
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Default) {
|
if (XRE_IsParentProcess()) {
|
||||||
cb = new SameChildProcessMessageManagerCallback();
|
cb = new SameChildProcessMessageManagerCallback();
|
||||||
} else {
|
} else {
|
||||||
cb = new ChildProcessMessageManagerCallback();
|
cb = new ChildProcessMessageManagerCallback();
|
||||||
|
@ -8960,7 +8960,7 @@ nsGlobalWindow::ShowModalDialog(const nsAString& aUrl, nsIVariant* aArgument,
|
|||||||
(aUrl, aArgument, aOptions, aError), aError,
|
(aUrl, aArgument, aOptions, aError), aError,
|
||||||
nullptr);
|
nullptr);
|
||||||
|
|
||||||
if (!IsShowModalDialogEnabled() || XRE_GetProcessType() == GeckoProcessType_Content) {
|
if (!IsShowModalDialogEnabled() || XRE_IsContentProcess()) {
|
||||||
aError.Throw(NS_ERROR_NOT_AVAILABLE);
|
aError.Throw(NS_ERROR_NOT_AVAILABLE);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
@ -10749,7 +10749,7 @@ nsGlobalWindow::ShowSlowScriptDialog()
|
|||||||
unsigned lineno;
|
unsigned lineno;
|
||||||
bool hasFrame = JS::DescribeScriptedCaller(cx, &filename, &lineno);
|
bool hasFrame = JS::DescribeScriptedCaller(cx, &filename, &lineno);
|
||||||
|
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Content &&
|
if (XRE_IsContentProcess() &&
|
||||||
ProcessHangMonitor::Get()) {
|
ProcessHangMonitor::Get()) {
|
||||||
ProcessHangMonitor::SlowScriptAction action;
|
ProcessHangMonitor::SlowScriptAction action;
|
||||||
nsRefPtr<ProcessHangMonitor> monitor = ProcessHangMonitor::Get();
|
nsRefPtr<ProcessHangMonitor> monitor = ProcessHangMonitor::Get();
|
||||||
|
@ -3211,7 +3211,7 @@ nsObjectLoadingContent::ShouldPlay(FallbackType &aReason, bool aIgnoreCurrentTyp
|
|||||||
sPrefsInitialized = true;
|
sPrefsInitialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Default &&
|
if (XRE_IsParentProcess() &&
|
||||||
BrowserTabsRemoteAutostart()) {
|
BrowserTabsRemoteAutostart()) {
|
||||||
// Plugins running OOP from the chrome process along with plugins running
|
// Plugins running OOP from the chrome process along with plugins running
|
||||||
// OOP from the content process will hang. Let's prevent that situation.
|
// OOP from the content process will hang. Let's prevent that situation.
|
||||||
|
@ -534,7 +534,7 @@ nsWindowMemoryReporter::CollectReports(nsIMemoryReporterCallback* aCb,
|
|||||||
// Collect window memory usage.
|
// Collect window memory usage.
|
||||||
nsWindowSizes windowTotalSizes(nullptr);
|
nsWindowSizes windowTotalSizes(nullptr);
|
||||||
nsCOMPtr<amIAddonManager> addonManager;
|
nsCOMPtr<amIAddonManager> addonManager;
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Default) {
|
if (XRE_IsParentProcess()) {
|
||||||
// Only try to access the service from the main process.
|
// Only try to access the service from the main process.
|
||||||
addonManager = do_GetService("@mozilla.org/addons/integration;1");
|
addonManager = do_GetService("@mozilla.org/addons/integration;1");
|
||||||
}
|
}
|
||||||
|
@ -2946,7 +2946,7 @@ nsXMLHttpRequest::Send(nsIVariant* aVariant, const Nullable<RequestBody>& aBody)
|
|||||||
if (scheme.LowerCaseEqualsLiteral("app") ||
|
if (scheme.LowerCaseEqualsLiteral("app") ||
|
||||||
scheme.LowerCaseEqualsLiteral("jar")) {
|
scheme.LowerCaseEqualsLiteral("jar")) {
|
||||||
mIsMappedArrayBuffer = true;
|
mIsMappedArrayBuffer = true;
|
||||||
if (XRE_GetProcessType() != GeckoProcessType_Default) {
|
if (!XRE_IsParentProcess()) {
|
||||||
nsCOMPtr<nsIJARChannel> jarChannel = do_QueryInterface(mChannel);
|
nsCOMPtr<nsIJARChannel> jarChannel = do_QueryInterface(mChannel);
|
||||||
// For memory mapping from child process, we need to get file
|
// For memory mapping from child process, we need to get file
|
||||||
// descriptor of the JAR file opened remotely on the parent proess.
|
// descriptor of the JAR file opened remotely on the parent proess.
|
||||||
|
@ -333,10 +333,4 @@ DispatchStatusChangedEvent(const nsAString& aType,
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
|
||||||
IsMainProcess()
|
|
||||||
{
|
|
||||||
return XRE_GetProcessType() == GeckoProcessType_Default;
|
|
||||||
}
|
|
||||||
|
|
||||||
END_BLUETOOTH_NAMESPACE
|
END_BLUETOOTH_NAMESPACE
|
||||||
|
@ -157,14 +157,6 @@ DispatchStatusChangedEvent(const nsAString& aType,
|
|||||||
const nsAString& aDeviceAddress,
|
const nsAString& aDeviceAddress,
|
||||||
bool aStatus);
|
bool aStatus);
|
||||||
|
|
||||||
/**
|
|
||||||
* Check whether the caller runs at B2G process.
|
|
||||||
*
|
|
||||||
* @return true if the caller runs at B2G process, false otherwise.
|
|
||||||
*/
|
|
||||||
bool
|
|
||||||
IsMainProcess();
|
|
||||||
|
|
||||||
END_BLUETOOTH_NAMESPACE
|
END_BLUETOOTH_NAMESPACE
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -238,7 +238,7 @@ bool
|
|||||||
BluetoothHfpManager::Init()
|
BluetoothHfpManager::Init()
|
||||||
{
|
{
|
||||||
// The function must run at b2g process since it would access SettingsService.
|
// The function must run at b2g process since it would access SettingsService.
|
||||||
MOZ_ASSERT(IsMainProcess());
|
MOZ_ASSERT(XRE_IsParentProcess());
|
||||||
|
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
|
|
||||||
|
@ -784,7 +784,7 @@ BluetoothAdapter::SendFile(const nsAString& aDeviceAddress,
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Default) {
|
if (XRE_IsParentProcess()) {
|
||||||
// In-process transfer
|
// In-process transfer
|
||||||
bs->SendFile(aDeviceAddress, &aBlob, results);
|
bs->SendFile(aDeviceAddress, &aBlob, results);
|
||||||
} else {
|
} else {
|
||||||
|
@ -98,12 +98,6 @@ StaticRefPtr<BluetoothService> sBluetoothService;
|
|||||||
bool sInShutdown = false;
|
bool sInShutdown = false;
|
||||||
bool sToggleInProgress = false;
|
bool sToggleInProgress = false;
|
||||||
|
|
||||||
bool
|
|
||||||
IsMainProcess()
|
|
||||||
{
|
|
||||||
return XRE_GetProcessType() == GeckoProcessType_Default;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ShutdownTimeExceeded(nsITimer* aTimer, void* aClosure)
|
ShutdownTimeExceeded(nsITimer* aTimer, void* aClosure)
|
||||||
{
|
{
|
||||||
@ -220,7 +214,7 @@ BluetoothService*
|
|||||||
BluetoothService::Create()
|
BluetoothService::Create()
|
||||||
{
|
{
|
||||||
#if defined(MOZ_B2G_BT)
|
#if defined(MOZ_B2G_BT)
|
||||||
if (!IsMainProcess()) {
|
if (!XRE_IsParentProcess()) {
|
||||||
return BluetoothServiceChildProcess::Create();
|
return BluetoothServiceChildProcess::Create();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -254,7 +248,7 @@ BluetoothService::Init()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Only the main process should observe bluetooth settings changes.
|
// Only the main process should observe bluetooth settings changes.
|
||||||
if (IsMainProcess() &&
|
if (XRE_IsParentProcess() &&
|
||||||
NS_FAILED(obs->AddObserver(this, MOZSETTINGS_CHANGED_ID, false))) {
|
NS_FAILED(obs->AddObserver(this, MOZSETTINGS_CHANGED_ID, false))) {
|
||||||
BT_WARNING("Failed to add settings change observer!");
|
BT_WARNING("Failed to add settings change observer!");
|
||||||
return false;
|
return false;
|
||||||
|
@ -1266,7 +1266,7 @@ BluetoothAdapter::SendFile(const nsAString& aDeviceAddress,
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Default) {
|
if (XRE_IsParentProcess()) {
|
||||||
// In-process transfer
|
// In-process transfer
|
||||||
bs->SendFile(aDeviceAddress, &aBlob, results);
|
bs->SendFile(aDeviceAddress, &aBlob, results);
|
||||||
} else {
|
} else {
|
||||||
|
@ -193,7 +193,7 @@ BluetoothService*
|
|||||||
BluetoothService::Create()
|
BluetoothService::Create()
|
||||||
{
|
{
|
||||||
#if defined(MOZ_B2G_BT)
|
#if defined(MOZ_B2G_BT)
|
||||||
if (!IsMainProcess()) {
|
if (!XRE_IsParentProcess()) {
|
||||||
return BluetoothServiceChildProcess::Create();
|
return BluetoothServiceChildProcess::Create();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -227,7 +227,7 @@ BluetoothService::Init()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Only the main process should observe bluetooth settings changes.
|
// Only the main process should observe bluetooth settings changes.
|
||||||
if (IsMainProcess() &&
|
if (XRE_IsParentProcess() &&
|
||||||
NS_FAILED(obs->AddObserver(this, MOZSETTINGS_CHANGED_ID, false))) {
|
NS_FAILED(obs->AddObserver(this, MOZSETTINGS_CHANGED_ID, false))) {
|
||||||
BT_WARNING("Failed to add settings change observer!");
|
BT_WARNING("Failed to add settings change observer!");
|
||||||
return false;
|
return false;
|
||||||
@ -269,7 +269,7 @@ BluetoothService::RegisterBluetoothSignalHandler(
|
|||||||
|
|
||||||
// Distribute pending pairing requests when pairing listener has been added
|
// Distribute pending pairing requests when pairing listener has been added
|
||||||
// to signal observer table.
|
// to signal observer table.
|
||||||
if (IsMainProcess() &&
|
if (XRE_IsParentProcess() &&
|
||||||
!mPendingPairReqSignals.IsEmpty() &&
|
!mPendingPairReqSignals.IsEmpty() &&
|
||||||
aNodeName.EqualsLiteral(KEY_PAIRING_LISTENER)) {
|
aNodeName.EqualsLiteral(KEY_PAIRING_LISTENER)) {
|
||||||
for (uint32_t i = 0; i < mPendingPairReqSignals.Length(); ++i) {
|
for (uint32_t i = 0; i < mPendingPairReqSignals.Length(); ++i) {
|
||||||
|
@ -443,7 +443,7 @@ bool
|
|||||||
BluetoothHfpManager::Init()
|
BluetoothHfpManager::Init()
|
||||||
{
|
{
|
||||||
// The function must run at b2g process since it would access SettingsService.
|
// The function must run at b2g process since it would access SettingsService.
|
||||||
MOZ_ASSERT(IsMainProcess());
|
MOZ_ASSERT(XRE_IsParentProcess());
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
|
|
||||||
nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
|
nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
|
||||||
|
@ -152,7 +152,7 @@ NS_CreateCellBroadcastService()
|
|||||||
{
|
{
|
||||||
nsCOMPtr<nsICellBroadcastService> service;
|
nsCOMPtr<nsICellBroadcastService> service;
|
||||||
|
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Content) {
|
if (XRE_IsContentProcess()) {
|
||||||
service = new mozilla::dom::cellbroadcast::CellBroadcastIPCService();
|
service = new mozilla::dom::cellbroadcast::CellBroadcastIPCService();
|
||||||
#if defined(MOZ_WIDGET_GONK) && defined(MOZ_B2G_RIL)
|
#if defined(MOZ_WIDGET_GONK) && defined(MOZ_B2G_RIL)
|
||||||
} else {
|
} else {
|
||||||
|
@ -51,8 +51,8 @@
|
|||||||
#include "nsXULAppAPI.h"
|
#include "nsXULAppAPI.h"
|
||||||
|
|
||||||
#define ASSERT_PARENT_PROCESS() \
|
#define ASSERT_PARENT_PROCESS() \
|
||||||
AssertIsInMainProcess(); \
|
MOZ_ASSERT(XRE_IsParentProcess()); \
|
||||||
if (NS_WARN_IF(!IsMainProcess())) { \
|
if (NS_WARN_IF(!XRE_IsParentProcess())) { \
|
||||||
return NS_ERROR_FAILURE; \
|
return NS_ERROR_FAILURE; \
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -125,20 +125,6 @@ static uint64_t gCounterID = 0;
|
|||||||
|
|
||||||
typedef nsClassHashtable<nsUint32HashKey, DataStoreInfo> HashApp;
|
typedef nsClassHashtable<nsUint32HashKey, DataStoreInfo> HashApp;
|
||||||
|
|
||||||
bool
|
|
||||||
IsMainProcess()
|
|
||||||
{
|
|
||||||
static const bool isMainProcess =
|
|
||||||
XRE_GetProcessType() == GeckoProcessType_Default;
|
|
||||||
return isMainProcess;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
AssertIsInMainProcess()
|
|
||||||
{
|
|
||||||
MOZ_ASSERT(IsMainProcess());
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
RejectPromise(nsPIDOMWindow* aWindow, Promise* aPromise, nsresult aRv)
|
RejectPromise(nsPIDOMWindow* aWindow, Promise* aPromise, nsresult aRv)
|
||||||
{
|
{
|
||||||
@ -161,8 +147,7 @@ void
|
|||||||
DeleteDatabase(const nsAString& aName,
|
DeleteDatabase(const nsAString& aName,
|
||||||
const nsAString& aManifestURL)
|
const nsAString& aManifestURL)
|
||||||
{
|
{
|
||||||
AssertIsInMainProcess();
|
MOZ_ASSERT(XRE_IsParentProcess() && NS_IsMainThread());
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
|
||||||
|
|
||||||
nsRefPtr<DataStoreDB> db = new DataStoreDB(aManifestURL, aName);
|
nsRefPtr<DataStoreDB> db = new DataStoreDB(aManifestURL, aName);
|
||||||
db->Delete();
|
db->Delete();
|
||||||
@ -174,8 +159,7 @@ DeleteDataStoresAppEnumerator(
|
|||||||
nsAutoPtr<DataStoreInfo>& aInfo,
|
nsAutoPtr<DataStoreInfo>& aInfo,
|
||||||
void* aUserData)
|
void* aUserData)
|
||||||
{
|
{
|
||||||
AssertIsInMainProcess();
|
MOZ_ASSERT(XRE_IsParentProcess() && NS_IsMainThread());
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
|
||||||
|
|
||||||
auto* appId = static_cast<uint32_t*>(aUserData);
|
auto* appId = static_cast<uint32_t*>(aUserData);
|
||||||
if (*appId != aAppId) {
|
if (*appId != aAppId) {
|
||||||
@ -191,8 +175,7 @@ DeleteDataStoresEnumerator(const nsAString& aName,
|
|||||||
nsAutoPtr<HashApp>& aApps,
|
nsAutoPtr<HashApp>& aApps,
|
||||||
void* aUserData)
|
void* aUserData)
|
||||||
{
|
{
|
||||||
AssertIsInMainProcess();
|
MOZ_ASSERT(XRE_IsParentProcess() && NS_IsMainThread());
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
|
||||||
|
|
||||||
aApps->Enumerate(DeleteDataStoresAppEnumerator, aUserData);
|
aApps->Enumerate(DeleteDataStoresAppEnumerator, aUserData);
|
||||||
return aApps->Count() ? PL_DHASH_NEXT : PL_DHASH_REMOVE;
|
return aApps->Count() ? PL_DHASH_NEXT : PL_DHASH_REMOVE;
|
||||||
@ -215,8 +198,7 @@ ResetPermission(uint32_t aAppId, const nsAString& aOriginURL,
|
|||||||
const nsAString& aPermission,
|
const nsAString& aPermission,
|
||||||
bool aReadOnly)
|
bool aReadOnly)
|
||||||
{
|
{
|
||||||
AssertIsInMainProcess();
|
MOZ_ASSERT(XRE_IsParentProcess() && NS_IsMainThread());
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
|
||||||
|
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
nsCOMPtr<nsIIOService> ioService(do_GetService(NS_IOSERVICE_CONTRACTID, &rv));
|
nsCOMPtr<nsIIOService> ioService(do_GetService(NS_IOSERVICE_CONTRACTID, &rv));
|
||||||
@ -347,8 +329,7 @@ GetDataStoreInfosEnumerator(const uint32_t& aAppId,
|
|||||||
DataStoreInfo* aInfo,
|
DataStoreInfo* aInfo,
|
||||||
void* aUserData)
|
void* aUserData)
|
||||||
{
|
{
|
||||||
AssertIsInMainProcess();
|
MOZ_ASSERT(XRE_IsParentProcess() && NS_IsMainThread());
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
|
||||||
|
|
||||||
auto* data = static_cast<GetDataStoreInfosData*>(aUserData);
|
auto* data = static_cast<GetDataStoreInfosData*>(aUserData);
|
||||||
if (aAppId == data->mAppId) {
|
if (aAppId == data->mAppId) {
|
||||||
@ -384,8 +365,7 @@ GetAppManifestURLsEnumerator(const uint32_t& aAppId,
|
|||||||
DataStoreInfo* aInfo,
|
DataStoreInfo* aInfo,
|
||||||
void* aUserData)
|
void* aUserData)
|
||||||
{
|
{
|
||||||
AssertIsInMainProcess();
|
MOZ_ASSERT(XRE_IsParentProcess() && NS_IsMainThread());
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
|
||||||
|
|
||||||
auto* manifestURLs = static_cast<nsIMutableArray*>(aUserData);
|
auto* manifestURLs = static_cast<nsIMutableArray*>(aUserData);
|
||||||
nsCOMPtr<nsISupportsString> manifestURL(do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID));
|
nsCOMPtr<nsISupportsString> manifestURL(do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID));
|
||||||
@ -417,8 +397,7 @@ AddPermissionsEnumerator(const uint32_t& aAppId,
|
|||||||
DataStoreInfo* aInfo,
|
DataStoreInfo* aInfo,
|
||||||
void* userData)
|
void* userData)
|
||||||
{
|
{
|
||||||
AssertIsInMainProcess();
|
MOZ_ASSERT(XRE_IsParentProcess() && NS_IsMainThread());
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
|
||||||
|
|
||||||
auto* data = static_cast<AddPermissionsData*>(userData);
|
auto* data = static_cast<AddPermissionsData*>(userData);
|
||||||
|
|
||||||
@ -457,8 +436,7 @@ AddAccessPermissionsEnumerator(const uint32_t& aAppId,
|
|||||||
DataStoreInfo* aInfo,
|
DataStoreInfo* aInfo,
|
||||||
void* userData)
|
void* userData)
|
||||||
{
|
{
|
||||||
AssertIsInMainProcess();
|
MOZ_ASSERT(XRE_IsParentProcess() && NS_IsMainThread());
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
|
||||||
|
|
||||||
auto* data = static_cast<AddAccessPermissionsData*>(userData);
|
auto* data = static_cast<AddAccessPermissionsData*>(userData);
|
||||||
|
|
||||||
@ -517,15 +495,13 @@ public:
|
|||||||
, mName(aName)
|
, mName(aName)
|
||||||
, mManifestURL(aManifestURL)
|
, mManifestURL(aManifestURL)
|
||||||
{
|
{
|
||||||
AssertIsInMainProcess();
|
MOZ_ASSERT(XRE_IsParentProcess() && NS_IsMainThread());
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Run(const nsAString& aRevisionId)
|
Run(const nsAString& aRevisionId)
|
||||||
{
|
{
|
||||||
AssertIsInMainProcess();
|
MOZ_ASSERT(XRE_IsParentProcess() && NS_IsMainThread());
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
|
||||||
|
|
||||||
nsRefPtr<DataStoreService> service = DataStoreService::Get();
|
nsRefPtr<DataStoreService> service = DataStoreService::Get();
|
||||||
MOZ_ASSERT(service);
|
MOZ_ASSERT(service);
|
||||||
@ -553,15 +529,13 @@ public:
|
|||||||
, mName(aName)
|
, mName(aName)
|
||||||
, mManifestURL(aManifestURL)
|
, mManifestURL(aManifestURL)
|
||||||
{
|
{
|
||||||
AssertIsInMainProcess();
|
MOZ_ASSERT(XRE_IsParentProcess() && NS_IsMainThread());
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Run(DataStoreDB* aDb, RunStatus aStatus) override
|
Run(DataStoreDB* aDb, RunStatus aStatus) override
|
||||||
{
|
{
|
||||||
AssertIsInMainProcess();
|
MOZ_ASSERT(XRE_IsParentProcess() && NS_IsMainThread());
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
|
||||||
MOZ_ASSERT(aDb);
|
MOZ_ASSERT(aDb);
|
||||||
|
|
||||||
if (aStatus == Error) {
|
if (aStatus == Error) {
|
||||||
@ -642,8 +616,7 @@ public:
|
|||||||
NS_IMETHOD
|
NS_IMETHOD
|
||||||
HandleEvent(nsIDOMEvent* aEvent) override
|
HandleEvent(nsIDOMEvent* aEvent) override
|
||||||
{
|
{
|
||||||
AssertIsInMainProcess();
|
MOZ_ASSERT(XRE_IsParentProcess() && NS_IsMainThread());
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
|
||||||
|
|
||||||
nsRefPtr<IDBRequest> request;
|
nsRefPtr<IDBRequest> request;
|
||||||
request.swap(mRequest);
|
request.swap(mRequest);
|
||||||
@ -830,7 +803,7 @@ DataStoreService::Shutdown()
|
|||||||
MOZ_ASSERT(NS_IsMainThread());
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
|
|
||||||
if (gDataStoreService) {
|
if (gDataStoreService) {
|
||||||
if (IsMainProcess()) {
|
if (XRE_IsParentProcess()) {
|
||||||
nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
|
nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
|
||||||
if (obs) {
|
if (obs) {
|
||||||
obs->RemoveObserver(gDataStoreService, "webapps-clear-data");
|
obs->RemoveObserver(gDataStoreService, "webapps-clear-data");
|
||||||
@ -863,7 +836,7 @@ DataStoreService::~DataStoreService()
|
|||||||
nsresult
|
nsresult
|
||||||
DataStoreService::Init()
|
DataStoreService::Init()
|
||||||
{
|
{
|
||||||
if (!IsMainProcess()) {
|
if (!XRE_IsParentProcess()) {
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -973,7 +946,7 @@ DataStoreService::GetDataStores(nsIDOMWindow* aWindow,
|
|||||||
|
|
||||||
// If this request comes from the main process, we have access to the
|
// If this request comes from the main process, we have access to the
|
||||||
// window, so we can skip the ipc communication.
|
// window, so we can skip the ipc communication.
|
||||||
if (IsMainProcess()) {
|
if (XRE_IsParentProcess()) {
|
||||||
uint32_t appId;
|
uint32_t appId;
|
||||||
nsresult rv = principal->GetAppId(&appId);
|
nsresult rv = principal->GetAppId(&appId);
|
||||||
if (NS_FAILED(rv)) {
|
if (NS_FAILED(rv)) {
|
||||||
@ -1132,8 +1105,7 @@ DataStoreService::GetDataStoreInfos(const nsAString& aName,
|
|||||||
nsIPrincipal* aPrincipal,
|
nsIPrincipal* aPrincipal,
|
||||||
nsTArray<DataStoreInfo>& aStores)
|
nsTArray<DataStoreInfo>& aStores)
|
||||||
{
|
{
|
||||||
AssertIsInMainProcess();
|
MOZ_ASSERT(XRE_IsParentProcess() && NS_IsMainThread());
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
|
||||||
|
|
||||||
nsCOMPtr<nsIAppsService> appsService =
|
nsCOMPtr<nsIAppsService> appsService =
|
||||||
do_GetService("@mozilla.org/AppsService;1");
|
do_GetService("@mozilla.org/AppsService;1");
|
||||||
@ -1242,8 +1214,7 @@ DataStoreService::CheckPermission(nsIPrincipal* aPrincipal,
|
|||||||
void
|
void
|
||||||
DataStoreService::DeleteDataStores(uint32_t aAppId)
|
DataStoreService::DeleteDataStores(uint32_t aAppId)
|
||||||
{
|
{
|
||||||
AssertIsInMainProcess();
|
MOZ_ASSERT(XRE_IsParentProcess() && NS_IsMainThread());
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
|
||||||
|
|
||||||
mStores.Enumerate(DeleteDataStoresEnumerator, &aAppId);
|
mStores.Enumerate(DeleteDataStoresEnumerator, &aAppId);
|
||||||
mAccessStores.Enumerate(DeleteDataStoresEnumerator, &aAppId);
|
mAccessStores.Enumerate(DeleteDataStoresEnumerator, &aAppId);
|
||||||
@ -1254,8 +1225,7 @@ DataStoreService::Observe(nsISupports* aSubject,
|
|||||||
const char* aTopic,
|
const char* aTopic,
|
||||||
const char16_t* aData)
|
const char16_t* aData)
|
||||||
{
|
{
|
||||||
AssertIsInMainProcess();
|
MOZ_ASSERT(XRE_IsParentProcess() && NS_IsMainThread());
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
|
||||||
|
|
||||||
if (strcmp(aTopic, "webapps-clear-data")) {
|
if (strcmp(aTopic, "webapps-clear-data")) {
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
@ -1294,8 +1264,7 @@ DataStoreService::AddPermissions(uint32_t aAppId,
|
|||||||
const nsAString& aManifestURL,
|
const nsAString& aManifestURL,
|
||||||
bool aReadOnly)
|
bool aReadOnly)
|
||||||
{
|
{
|
||||||
AssertIsInMainProcess();
|
MOZ_ASSERT(XRE_IsParentProcess() && NS_IsMainThread());
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
|
||||||
|
|
||||||
// This is the permission name.
|
// This is the permission name.
|
||||||
nsString permission;
|
nsString permission;
|
||||||
@ -1327,8 +1296,7 @@ DataStoreService::AddAccessPermissions(uint32_t aAppId, const nsAString& aName,
|
|||||||
const nsAString& aManifestURL,
|
const nsAString& aManifestURL,
|
||||||
bool aReadOnly)
|
bool aReadOnly)
|
||||||
{
|
{
|
||||||
AssertIsInMainProcess();
|
MOZ_ASSERT(XRE_IsParentProcess() && NS_IsMainThread());
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
|
||||||
|
|
||||||
// When an app wants to have access to a DataStore, the permissions must be
|
// When an app wants to have access to a DataStore, the permissions must be
|
||||||
// set.
|
// set.
|
||||||
@ -1349,8 +1317,7 @@ DataStoreService::CreateFirstRevisionId(uint32_t aAppId,
|
|||||||
const nsAString& aName,
|
const nsAString& aName,
|
||||||
const nsAString& aManifestURL)
|
const nsAString& aManifestURL)
|
||||||
{
|
{
|
||||||
AssertIsInMainProcess();
|
MOZ_ASSERT(XRE_IsParentProcess() && NS_IsMainThread());
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
|
||||||
|
|
||||||
nsRefPtr<DataStoreDB> db = new DataStoreDB(aManifestURL, aName);
|
nsRefPtr<DataStoreDB> db = new DataStoreDB(aManifestURL, aName);
|
||||||
|
|
||||||
@ -1380,7 +1347,7 @@ DataStoreService::EnableDataStore(uint32_t aAppId, const nsAString& aName,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Notify the child processes.
|
// Notify the child processes.
|
||||||
if (IsMainProcess()) {
|
if (XRE_IsParentProcess()) {
|
||||||
nsTArray<ContentParent*> children;
|
nsTArray<ContentParent*> children;
|
||||||
ContentParent::GetAll(children);
|
ContentParent::GetAll(children);
|
||||||
for (uint32_t i = 0; i < children.Length(); i++) {
|
for (uint32_t i = 0; i < children.Length(); i++) {
|
||||||
@ -1447,8 +1414,7 @@ DataStoreService::GetDataStoresFromIPC(const nsAString& aName,
|
|||||||
nsIPrincipal* aPrincipal,
|
nsIPrincipal* aPrincipal,
|
||||||
nsTArray<DataStoreSetting>* aValue)
|
nsTArray<DataStoreSetting>* aValue)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(IsMainProcess());
|
MOZ_ASSERT(XRE_IsParentProcess() && NS_IsMainThread());
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
|
||||||
|
|
||||||
uint32_t appId;
|
uint32_t appId;
|
||||||
nsresult rv = aPrincipal->GetAppId(&appId);
|
nsresult rv = aPrincipal->GetAppId(&appId);
|
||||||
|
@ -561,7 +561,7 @@ FileUpdateDispatcher::Observe(nsISupports* aSubject,
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (XRE_GetProcessType() != GeckoProcessType_Default) {
|
if (!XRE_IsParentProcess()) {
|
||||||
// Child process. Forward the notification to the parent.
|
// Child process. Forward the notification to the parent.
|
||||||
ContentChild::GetSingleton()
|
ContentChild::GetSingleton()
|
||||||
->SendFilePathUpdateNotify(dsf->mStorageType,
|
->SendFilePathUpdateNotify(dsf->mStorageType,
|
||||||
@ -692,7 +692,7 @@ DeviceStorageFile::Dump(const char* label)
|
|||||||
path = NS_LITERAL_STRING("(null)");
|
path = NS_LITERAL_STRING("(null)");
|
||||||
}
|
}
|
||||||
const char* ptStr;
|
const char* ptStr;
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Default) {
|
if (XRE_IsParentProcess()) {
|
||||||
ptStr = "parent";
|
ptStr = "parent";
|
||||||
} else {
|
} else {
|
||||||
ptStr = "child";
|
ptStr = "child";
|
||||||
@ -814,7 +814,7 @@ OverrideRootDir::Init()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (sDirs->overrideRootDir) {
|
if (sDirs->overrideRootDir) {
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Default) {
|
if (XRE_IsParentProcess()) {
|
||||||
// Only the parent process can create directories. In testing, because
|
// Only the parent process can create directories. In testing, because
|
||||||
// the preference is updated after startup, its entirely possible that
|
// the preference is updated after startup, its entirely possible that
|
||||||
// the preference updated notification will be received by a child
|
// the preference updated notification will be received by a child
|
||||||
@ -936,7 +936,7 @@ InitDirs()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Default) {
|
if (XRE_IsParentProcess()) {
|
||||||
NS_GetSpecialDirectory("UAppData", getter_AddRefs(sDirs->crashes));
|
NS_GetSpecialDirectory("UAppData", getter_AddRefs(sDirs->crashes));
|
||||||
if (sDirs->crashes) {
|
if (sDirs->crashes) {
|
||||||
sDirs->crashes->Append(NS_LITERAL_STRING("Crash Reports"));
|
sDirs->crashes->Append(NS_LITERAL_STRING("Crash Reports"));
|
||||||
@ -2058,7 +2058,7 @@ ContinueCursorEvent::~ContinueCursorEvent() {}
|
|||||||
void
|
void
|
||||||
ContinueCursorEvent::Continue()
|
ContinueCursorEvent::Continue()
|
||||||
{
|
{
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Default) {
|
if (XRE_IsParentProcess()) {
|
||||||
DebugOnly<nsresult> rv = NS_DispatchToMainThread(this);
|
DebugOnly<nsresult> rv = NS_DispatchToMainThread(this);
|
||||||
MOZ_ASSERT(NS_SUCCEEDED(rv));
|
MOZ_ASSERT(NS_SUCCEEDED(rv));
|
||||||
return;
|
return;
|
||||||
@ -2244,7 +2244,7 @@ nsDOMDeviceStorageCursor::Allow(JS::HandleValue aChoices)
|
|||||||
return NS_DispatchToMainThread(r);
|
return NS_DispatchToMainThread(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (XRE_GetProcessType() != GeckoProcessType_Default) {
|
if (!XRE_IsParentProcess()) {
|
||||||
PDeviceStorageRequestChild* child
|
PDeviceStorageRequestChild* child
|
||||||
= new DeviceStorageRequestChild(this, mFile);
|
= new DeviceStorageRequestChild(this, mFile);
|
||||||
DeviceStorageEnumerationParams params(mFile->mStorageType,
|
DeviceStorageEnumerationParams params(mFile->mStorageType,
|
||||||
@ -3013,7 +3013,7 @@ public:
|
|||||||
return NS_DispatchToCurrentThread(r);
|
return NS_DispatchToCurrentThread(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (XRE_GetProcessType() != GeckoProcessType_Default) {
|
if (!XRE_IsParentProcess()) {
|
||||||
|
|
||||||
DeviceStorageCreateFdParams params;
|
DeviceStorageCreateFdParams params;
|
||||||
params.type() = mFile->mStorageType;
|
params.type() = mFile->mStorageType;
|
||||||
@ -3053,7 +3053,7 @@ public:
|
|||||||
return NS_DispatchToCurrentThread(r);
|
return NS_DispatchToCurrentThread(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (XRE_GetProcessType() != GeckoProcessType_Default) {
|
if (!XRE_IsParentProcess()) {
|
||||||
BlobChild* actor
|
BlobChild* actor
|
||||||
= ContentChild::GetSingleton()->GetOrCreateActorForBlob(
|
= ContentChild::GetSingleton()->GetOrCreateActorForBlob(
|
||||||
static_cast<Blob*>(mBlob.get()));
|
static_cast<Blob*>(mBlob.get()));
|
||||||
@ -3099,7 +3099,7 @@ public:
|
|||||||
return NS_DispatchToCurrentThread(r);
|
return NS_DispatchToCurrentThread(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (XRE_GetProcessType() != GeckoProcessType_Default) {
|
if (!XRE_IsParentProcess()) {
|
||||||
BlobChild* actor
|
BlobChild* actor
|
||||||
= ContentChild::GetSingleton()->GetOrCreateActorForBlob(
|
= ContentChild::GetSingleton()->GetOrCreateActorForBlob(
|
||||||
static_cast<Blob*>(mBlob.get()));
|
static_cast<Blob*>(mBlob.get()));
|
||||||
@ -3145,7 +3145,7 @@ public:
|
|||||||
return NS_DispatchToCurrentThread(r);
|
return NS_DispatchToCurrentThread(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (XRE_GetProcessType() != GeckoProcessType_Default) {
|
if (!XRE_IsParentProcess()) {
|
||||||
PDeviceStorageRequestChild* child
|
PDeviceStorageRequestChild* child
|
||||||
= new DeviceStorageRequestChild(mRequest, mFile);
|
= new DeviceStorageRequestChild(mRequest, mFile);
|
||||||
DeviceStorageGetParams params(mFile->mStorageType,
|
DeviceStorageGetParams params(mFile->mStorageType,
|
||||||
@ -3179,7 +3179,7 @@ public:
|
|||||||
return NS_DispatchToCurrentThread(r);
|
return NS_DispatchToCurrentThread(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (XRE_GetProcessType() != GeckoProcessType_Default) {
|
if (!XRE_IsParentProcess()) {
|
||||||
PDeviceStorageRequestChild* child
|
PDeviceStorageRequestChild* child
|
||||||
= new DeviceStorageRequestChild(mRequest, mFile);
|
= new DeviceStorageRequestChild(mRequest, mFile);
|
||||||
DeviceStorageDeleteParams params(mFile->mStorageType,
|
DeviceStorageDeleteParams params(mFile->mStorageType,
|
||||||
@ -3195,7 +3195,7 @@ public:
|
|||||||
|
|
||||||
case DEVICE_STORAGE_REQUEST_FREE_SPACE:
|
case DEVICE_STORAGE_REQUEST_FREE_SPACE:
|
||||||
{
|
{
|
||||||
if (XRE_GetProcessType() != GeckoProcessType_Default) {
|
if (!XRE_IsParentProcess()) {
|
||||||
PDeviceStorageRequestChild* child
|
PDeviceStorageRequestChild* child
|
||||||
= new DeviceStorageRequestChild(mRequest, mFile);
|
= new DeviceStorageRequestChild(mRequest, mFile);
|
||||||
DeviceStorageFreeSpaceParams params(mFile->mStorageType,
|
DeviceStorageFreeSpaceParams params(mFile->mStorageType,
|
||||||
@ -3210,7 +3210,7 @@ public:
|
|||||||
|
|
||||||
case DEVICE_STORAGE_REQUEST_USED_SPACE:
|
case DEVICE_STORAGE_REQUEST_USED_SPACE:
|
||||||
{
|
{
|
||||||
if (XRE_GetProcessType() != GeckoProcessType_Default) {
|
if (!XRE_IsParentProcess()) {
|
||||||
PDeviceStorageRequestChild* child
|
PDeviceStorageRequestChild* child
|
||||||
= new DeviceStorageRequestChild(mRequest, mFile);
|
= new DeviceStorageRequestChild(mRequest, mFile);
|
||||||
DeviceStorageUsedSpaceParams params(mFile->mStorageType,
|
DeviceStorageUsedSpaceParams params(mFile->mStorageType,
|
||||||
@ -3231,7 +3231,7 @@ public:
|
|||||||
|
|
||||||
case DEVICE_STORAGE_REQUEST_AVAILABLE:
|
case DEVICE_STORAGE_REQUEST_AVAILABLE:
|
||||||
{
|
{
|
||||||
if (XRE_GetProcessType() != GeckoProcessType_Default) {
|
if (!XRE_IsParentProcess()) {
|
||||||
PDeviceStorageRequestChild* child
|
PDeviceStorageRequestChild* child
|
||||||
= new DeviceStorageRequestChild(mRequest, mFile);
|
= new DeviceStorageRequestChild(mRequest, mFile);
|
||||||
DeviceStorageAvailableParams params(mFile->mStorageType,
|
DeviceStorageAvailableParams params(mFile->mStorageType,
|
||||||
@ -3246,7 +3246,7 @@ public:
|
|||||||
|
|
||||||
case DEVICE_STORAGE_REQUEST_STATUS:
|
case DEVICE_STORAGE_REQUEST_STATUS:
|
||||||
{
|
{
|
||||||
if (XRE_GetProcessType() != GeckoProcessType_Default) {
|
if (!XRE_IsParentProcess()) {
|
||||||
PDeviceStorageRequestChild* child
|
PDeviceStorageRequestChild* child
|
||||||
= new DeviceStorageRequestChild(mRequest, mFile);
|
= new DeviceStorageRequestChild(mRequest, mFile);
|
||||||
DeviceStorageStatusParams params(mFile->mStorageType,
|
DeviceStorageStatusParams params(mFile->mStorageType,
|
||||||
@ -3267,7 +3267,7 @@ public:
|
|||||||
|
|
||||||
case DEVICE_STORAGE_REQUEST_FORMAT:
|
case DEVICE_STORAGE_REQUEST_FORMAT:
|
||||||
{
|
{
|
||||||
if (XRE_GetProcessType() != GeckoProcessType_Default) {
|
if (!XRE_IsParentProcess()) {
|
||||||
PDeviceStorageRequestChild* child
|
PDeviceStorageRequestChild* child
|
||||||
= new DeviceStorageRequestChild(mRequest, mFile);
|
= new DeviceStorageRequestChild(mRequest, mFile);
|
||||||
DeviceStorageFormatParams params(mFile->mStorageType,
|
DeviceStorageFormatParams params(mFile->mStorageType,
|
||||||
@ -3282,7 +3282,7 @@ public:
|
|||||||
|
|
||||||
case DEVICE_STORAGE_REQUEST_MOUNT:
|
case DEVICE_STORAGE_REQUEST_MOUNT:
|
||||||
{
|
{
|
||||||
if (XRE_GetProcessType() != GeckoProcessType_Default) {
|
if (!XRE_IsParentProcess()) {
|
||||||
PDeviceStorageRequestChild* child
|
PDeviceStorageRequestChild* child
|
||||||
= new DeviceStorageRequestChild(mRequest, mFile);
|
= new DeviceStorageRequestChild(mRequest, mFile);
|
||||||
DeviceStorageMountParams params(mFile->mStorageType,
|
DeviceStorageMountParams params(mFile->mStorageType,
|
||||||
@ -3297,7 +3297,7 @@ public:
|
|||||||
|
|
||||||
case DEVICE_STORAGE_REQUEST_UNMOUNT:
|
case DEVICE_STORAGE_REQUEST_UNMOUNT:
|
||||||
{
|
{
|
||||||
if (XRE_GetProcessType() != GeckoProcessType_Default) {
|
if (!XRE_IsParentProcess()) {
|
||||||
PDeviceStorageRequestChild* child
|
PDeviceStorageRequestChild* child
|
||||||
= new DeviceStorageRequestChild(mRequest, mFile);
|
= new DeviceStorageRequestChild(mRequest, mFile);
|
||||||
DeviceStorageUnmountParams params(mFile->mStorageType,
|
DeviceStorageUnmountParams params(mFile->mStorageType,
|
||||||
|
@ -597,7 +597,7 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
|
|||||||
// window edge) wont update the cursor if the cached value and the current
|
// window edge) wont update the cursor if the cached value and the current
|
||||||
// cursor match. So when the mouse exits a remote frame, clear the cached
|
// cursor match. So when the mouse exits a remote frame, clear the cached
|
||||||
// widget cursor so a proper update will occur when the mouse re-enters.
|
// widget cursor so a proper update will occur when the mouse re-enters.
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Content) {
|
if (XRE_IsContentProcess()) {
|
||||||
ClearCachedWidgetCursor(mCurrentTarget);
|
ClearCachedWidgetCursor(mCurrentTarget);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1064,7 +1064,7 @@ IMEStateManager::SetIMEState(const IMEState& aState,
|
|||||||
// XXX I think that we should use nsContentUtils::IsCallerChrome() instead
|
// XXX I think that we should use nsContentUtils::IsCallerChrome() instead
|
||||||
// of the process type.
|
// of the process type.
|
||||||
if (aAction.mCause == InputContextAction::CAUSE_UNKNOWN &&
|
if (aAction.mCause == InputContextAction::CAUSE_UNKNOWN &&
|
||||||
XRE_GetProcessType() != GeckoProcessType_Content) {
|
!XRE_IsContentProcess()) {
|
||||||
aAction.mCause = InputContextAction::CAUSE_UNKNOWN_CHROME;
|
aAction.mCause = InputContextAction::CAUSE_UNKNOWN_CHROME;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -242,7 +242,7 @@ void
|
|||||||
FileInputStreamWrapper::Serialize(InputStreamParams& aParams,
|
FileInputStreamWrapper::Serialize(InputStreamParams& aParams,
|
||||||
FileDescriptorArray& /* aFDs */)
|
FileDescriptorArray& /* aFDs */)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(XRE_GetProcessType() == GeckoProcessType_Default);
|
MOZ_ASSERT(XRE_IsParentProcess());
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
|
|
||||||
nsCOMPtr<nsIInputStream> thisStream = do_QueryObject(this);
|
nsCOMPtr<nsIInputStream> thisStream = do_QueryObject(this);
|
||||||
|
@ -39,7 +39,7 @@ CreateDirectoryTask::CreateDirectoryTask(
|
|||||||
FileSystemRequestParent* aParent)
|
FileSystemRequestParent* aParent)
|
||||||
: FileSystemTaskBase(aFileSystem, aParam, aParent)
|
: FileSystemTaskBase(aFileSystem, aParam, aParent)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(FileSystemUtils::IsParentProcess(),
|
MOZ_ASSERT(XRE_IsParentProcess(),
|
||||||
"Only call from parent process!");
|
"Only call from parent process!");
|
||||||
MOZ_ASSERT(NS_IsMainThread(), "Only call on main thread!");
|
MOZ_ASSERT(NS_IsMainThread(), "Only call on main thread!");
|
||||||
MOZ_ASSERT(aFileSystem);
|
MOZ_ASSERT(aFileSystem);
|
||||||
@ -84,7 +84,7 @@ CreateDirectoryTask::SetSuccessRequestResult(const FileSystemResponseValue& aVal
|
|||||||
nsresult
|
nsresult
|
||||||
CreateDirectoryTask::Work()
|
CreateDirectoryTask::Work()
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(FileSystemUtils::IsParentProcess(),
|
MOZ_ASSERT(XRE_IsParentProcess(),
|
||||||
"Only call from parent process!");
|
"Only call from parent process!");
|
||||||
MOZ_ASSERT(!NS_IsMainThread(), "Only call on worker thread!");
|
MOZ_ASSERT(!NS_IsMainThread(), "Only call on worker thread!");
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ CreateFileTask::CreateFileTask(FileSystemBase* aFileSystem,
|
|||||||
MOZ_ASSERT(aFileSystem);
|
MOZ_ASSERT(aFileSystem);
|
||||||
GetOutputBufferSize();
|
GetOutputBufferSize();
|
||||||
if (aBlobData) {
|
if (aBlobData) {
|
||||||
if (FileSystemUtils::IsParentProcess()) {
|
if (XRE_IsParentProcess()) {
|
||||||
aBlobData->GetInternalStream(getter_AddRefs(mBlobStream), aRv);
|
aBlobData->GetInternalStream(getter_AddRefs(mBlobStream), aRv);
|
||||||
NS_WARN_IF(aRv.Failed());
|
NS_WARN_IF(aRv.Failed());
|
||||||
} else {
|
} else {
|
||||||
@ -61,7 +61,7 @@ CreateFileTask::CreateFileTask(FileSystemBase* aFileSystem,
|
|||||||
: FileSystemTaskBase(aFileSystem, aParam, aParent)
|
: FileSystemTaskBase(aFileSystem, aParam, aParent)
|
||||||
, mReplace(false)
|
, mReplace(false)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(FileSystemUtils::IsParentProcess(),
|
MOZ_ASSERT(XRE_IsParentProcess(),
|
||||||
"Only call from parent process!");
|
"Only call from parent process!");
|
||||||
MOZ_ASSERT(NS_IsMainThread(), "Only call on main thread!");
|
MOZ_ASSERT(NS_IsMainThread(), "Only call on main thread!");
|
||||||
MOZ_ASSERT(aFileSystem);
|
MOZ_ASSERT(aFileSystem);
|
||||||
@ -168,7 +168,7 @@ CreateFileTask::Work()
|
|||||||
nsCOMPtr<nsIOutputStream> mStream;
|
nsCOMPtr<nsIOutputStream> mStream;
|
||||||
};
|
};
|
||||||
|
|
||||||
MOZ_ASSERT(FileSystemUtils::IsParentProcess(),
|
MOZ_ASSERT(XRE_IsParentProcess(),
|
||||||
"Only call from parent process!");
|
"Only call from parent process!");
|
||||||
MOZ_ASSERT(!NS_IsMainThread(), "Only call on worker thread!");
|
MOZ_ASSERT(!NS_IsMainThread(), "Only call on worker thread!");
|
||||||
|
|
||||||
@ -324,7 +324,7 @@ CreateFileTask::GetPermissionAccessType(nsCString& aAccess) const
|
|||||||
void
|
void
|
||||||
CreateFileTask::GetOutputBufferSize() const
|
CreateFileTask::GetOutputBufferSize() const
|
||||||
{
|
{
|
||||||
if (sOutputBufferSize || !FileSystemUtils::IsParentProcess()) {
|
if (sOutputBufferSize || !XRE_IsParentProcess()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
sOutputBufferSize =
|
sOutputBufferSize =
|
||||||
|
@ -47,7 +47,7 @@ DeviceStorageFileSystem::DeviceStorageFileSystem(
|
|||||||
// Get the local path of the file system root.
|
// Get the local path of the file system root.
|
||||||
// Since the child process is not allowed to access the file system, we only
|
// Since the child process is not allowed to access the file system, we only
|
||||||
// do this from the parent process.
|
// do this from the parent process.
|
||||||
if (!FileSystemUtils::IsParentProcess()) {
|
if (!XRE_IsParentProcess()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
nsCOMPtr<nsIFile> rootFile;
|
nsCOMPtr<nsIFile> rootFile;
|
||||||
@ -100,7 +100,7 @@ DeviceStorageFileSystem::GetWindow() const
|
|||||||
already_AddRefed<nsIFile>
|
already_AddRefed<nsIFile>
|
||||||
DeviceStorageFileSystem::GetLocalFile(const nsAString& aRealPath) const
|
DeviceStorageFileSystem::GetLocalFile(const nsAString& aRealPath) const
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(FileSystemUtils::IsParentProcess(),
|
MOZ_ASSERT(XRE_IsParentProcess(),
|
||||||
"Should be on parent process!");
|
"Should be on parent process!");
|
||||||
nsAutoString localPath;
|
nsAutoString localPath;
|
||||||
FileSystemUtils::NormalizedPathToLocalPath(aRealPath, localPath);
|
FileSystemUtils::NormalizedPathToLocalPath(aRealPath, localPath);
|
||||||
@ -116,7 +116,7 @@ DeviceStorageFileSystem::GetLocalFile(const nsAString& aRealPath) const
|
|||||||
bool
|
bool
|
||||||
DeviceStorageFileSystem::GetRealPath(BlobImpl* aFile, nsAString& aRealPath) const
|
DeviceStorageFileSystem::GetRealPath(BlobImpl* aFile, nsAString& aRealPath) const
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(FileSystemUtils::IsParentProcess(),
|
MOZ_ASSERT(XRE_IsParentProcess(),
|
||||||
"Should be on parent process!");
|
"Should be on parent process!");
|
||||||
MOZ_ASSERT(aFile, "aFile Should not be null.");
|
MOZ_ASSERT(aFile, "aFile Should not be null.");
|
||||||
|
|
||||||
@ -141,7 +141,7 @@ DeviceStorageFileSystem::GetRootName() const
|
|||||||
bool
|
bool
|
||||||
DeviceStorageFileSystem::IsSafeFile(nsIFile* aFile) const
|
DeviceStorageFileSystem::IsSafeFile(nsIFile* aFile) const
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(FileSystemUtils::IsParentProcess(),
|
MOZ_ASSERT(XRE_IsParentProcess(),
|
||||||
"Should be on parent process!");
|
"Should be on parent process!");
|
||||||
MOZ_ASSERT(aFile);
|
MOZ_ASSERT(aFile);
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ FileSystemTaskBase::FileSystemTaskBase(FileSystemBase* aFileSystem,
|
|||||||
, mFileSystem(aFileSystem)
|
, mFileSystem(aFileSystem)
|
||||||
, mRequestParent(aParent)
|
, mRequestParent(aParent)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(FileSystemUtils::IsParentProcess(),
|
MOZ_ASSERT(XRE_IsParentProcess(),
|
||||||
"Only call from parent process!");
|
"Only call from parent process!");
|
||||||
MOZ_ASSERT(NS_IsMainThread(), "Only call on main thread!");
|
MOZ_ASSERT(NS_IsMainThread(), "Only call on main thread!");
|
||||||
MOZ_ASSERT(aFileSystem, "aFileSystem should not be null.");
|
MOZ_ASSERT(aFileSystem, "aFileSystem should not be null.");
|
||||||
@ -61,7 +61,7 @@ FileSystemTaskBase::Start()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (FileSystemUtils::IsParentProcess()) {
|
if (XRE_IsParentProcess()) {
|
||||||
// Run in parent process.
|
// Run in parent process.
|
||||||
// Start worker thread.
|
// Start worker thread.
|
||||||
nsCOMPtr<nsIEventTarget> target
|
nsCOMPtr<nsIEventTarget> target
|
||||||
@ -121,7 +121,7 @@ FileSystemTaskBase::HandleResult()
|
|||||||
FileSystemResponseValue
|
FileSystemResponseValue
|
||||||
FileSystemTaskBase::GetRequestResult() const
|
FileSystemTaskBase::GetRequestResult() const
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(FileSystemUtils::IsParentProcess(),
|
MOZ_ASSERT(XRE_IsParentProcess(),
|
||||||
"Only call from parent process!");
|
"Only call from parent process!");
|
||||||
MOZ_ASSERT(NS_IsMainThread(), "Only call on main thread!");
|
MOZ_ASSERT(NS_IsMainThread(), "Only call on main thread!");
|
||||||
if (HasError()) {
|
if (HasError()) {
|
||||||
@ -134,7 +134,7 @@ FileSystemTaskBase::GetRequestResult() const
|
|||||||
void
|
void
|
||||||
FileSystemTaskBase::SetRequestResult(const FileSystemResponseValue& aValue)
|
FileSystemTaskBase::SetRequestResult(const FileSystemResponseValue& aValue)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(!FileSystemUtils::IsParentProcess(),
|
MOZ_ASSERT(!XRE_IsParentProcess(),
|
||||||
"Only call from child process!");
|
"Only call from child process!");
|
||||||
MOZ_ASSERT(NS_IsMainThread(), "Only call on main thread!");
|
MOZ_ASSERT(NS_IsMainThread(), "Only call on main thread!");
|
||||||
if (aValue.type() == FileSystemResponseValue::TFileSystemErrorResponse) {
|
if (aValue.type() == FileSystemResponseValue::TFileSystemErrorResponse) {
|
||||||
@ -156,7 +156,7 @@ FileSystemTaskBase::Recv__delete__(const FileSystemResponseValue& aValue)
|
|||||||
BlobParent*
|
BlobParent*
|
||||||
FileSystemTaskBase::GetBlobParent(BlobImpl* aFile) const
|
FileSystemTaskBase::GetBlobParent(BlobImpl* aFile) const
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(FileSystemUtils::IsParentProcess(),
|
MOZ_ASSERT(XRE_IsParentProcess(),
|
||||||
"Only call from parent process!");
|
"Only call from parent process!");
|
||||||
MOZ_ASSERT(NS_IsMainThread(), "Only call on main thread!");
|
MOZ_ASSERT(NS_IsMainThread(), "Only call on main thread!");
|
||||||
MOZ_ASSERT(aFile);
|
MOZ_ASSERT(aFile);
|
||||||
|
@ -65,12 +65,5 @@ FileSystemUtils::IsDescendantPath(const nsAString& aPath,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
|
||||||
bool
|
|
||||||
FileSystemUtils::IsParentProcess()
|
|
||||||
{
|
|
||||||
return XRE_GetProcessType() == GeckoProcessType_Default;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace dom
|
} // namespace dom
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
@ -41,9 +41,6 @@ public:
|
|||||||
static bool
|
static bool
|
||||||
IsDescendantPath(const nsAString& aPath, const nsAString& aDescendantPath);
|
IsDescendantPath(const nsAString& aPath, const nsAString& aDescendantPath);
|
||||||
|
|
||||||
static bool
|
|
||||||
IsParentProcess();
|
|
||||||
|
|
||||||
static const char16_t kSeparatorChar = char16_t('/');
|
static const char16_t kSeparatorChar = char16_t('/');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ GetDirectoryListingTask::GetDirectoryListingTask(FileSystemBase* aFileSystem,
|
|||||||
FileSystemRequestParent* aParent)
|
FileSystemRequestParent* aParent)
|
||||||
: FileSystemTaskBase(aFileSystem, aParam, aParent)
|
: FileSystemTaskBase(aFileSystem, aParam, aParent)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(FileSystemUtils::IsParentProcess(),
|
MOZ_ASSERT(XRE_IsParentProcess(),
|
||||||
"Only call from parent process!");
|
"Only call from parent process!");
|
||||||
MOZ_ASSERT(NS_IsMainThread(), "Only call on main thread!");
|
MOZ_ASSERT(NS_IsMainThread(), "Only call on main thread!");
|
||||||
MOZ_ASSERT(aFileSystem);
|
MOZ_ASSERT(aFileSystem);
|
||||||
@ -105,7 +105,7 @@ GetDirectoryListingTask::SetSuccessRequestResult(const FileSystemResponseValue&
|
|||||||
nsresult
|
nsresult
|
||||||
GetDirectoryListingTask::Work()
|
GetDirectoryListingTask::Work()
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(FileSystemUtils::IsParentProcess(),
|
MOZ_ASSERT(XRE_IsParentProcess(),
|
||||||
"Only call from parent process!");
|
"Only call from parent process!");
|
||||||
MOZ_ASSERT(!NS_IsMainThread(), "Only call on worker thread!");
|
MOZ_ASSERT(!NS_IsMainThread(), "Only call on worker thread!");
|
||||||
|
|
||||||
@ -222,7 +222,7 @@ GetDirectoryListingTask::HandlerCallback()
|
|||||||
path.AppendLiteral(FILESYSTEM_DOM_PATH_SEPARATOR);
|
path.AppendLiteral(FILESYSTEM_DOM_PATH_SEPARATOR);
|
||||||
path.Append(name);
|
path.Append(name);
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if (FileSystemUtils::IsParentProcess()) {
|
if (XRE_IsParentProcess()) {
|
||||||
nsCOMPtr<nsIFile> file = mFileSystem->GetLocalFile(path);
|
nsCOMPtr<nsIFile> file = mFileSystem->GetLocalFile(path);
|
||||||
bool exist;
|
bool exist;
|
||||||
file->Exists(&exist);
|
file->Exists(&exist);
|
||||||
|
@ -47,7 +47,7 @@ GetFileOrDirectoryTask::GetFileOrDirectoryTask(
|
|||||||
: FileSystemTaskBase(aFileSystem, aParam, aParent)
|
: FileSystemTaskBase(aFileSystem, aParam, aParent)
|
||||||
, mIsDirectory(false)
|
, mIsDirectory(false)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(FileSystemUtils::IsParentProcess(),
|
MOZ_ASSERT(XRE_IsParentProcess(),
|
||||||
"Only call from parent process!");
|
"Only call from parent process!");
|
||||||
MOZ_ASSERT(NS_IsMainThread(), "Only call on main thread!");
|
MOZ_ASSERT(NS_IsMainThread(), "Only call on main thread!");
|
||||||
MOZ_ASSERT(aFileSystem);
|
MOZ_ASSERT(aFileSystem);
|
||||||
@ -119,7 +119,7 @@ GetFileOrDirectoryTask::SetSuccessRequestResult(const FileSystemResponseValue& a
|
|||||||
nsresult
|
nsresult
|
||||||
GetFileOrDirectoryTask::Work()
|
GetFileOrDirectoryTask::Work()
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(FileSystemUtils::IsParentProcess(),
|
MOZ_ASSERT(XRE_IsParentProcess(),
|
||||||
"Only call from parent process!");
|
"Only call from parent process!");
|
||||||
MOZ_ASSERT(!NS_IsMainThread(), "Only call on worker thread!");
|
MOZ_ASSERT(!NS_IsMainThread(), "Only call on worker thread!");
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ RemoveTask::RemoveTask(FileSystemBase* aFileSystem,
|
|||||||
, mRecursive(false)
|
, mRecursive(false)
|
||||||
, mReturnValue(false)
|
, mReturnValue(false)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(FileSystemUtils::IsParentProcess(),
|
MOZ_ASSERT(XRE_IsParentProcess(),
|
||||||
"Only call from parent process!");
|
"Only call from parent process!");
|
||||||
MOZ_ASSERT(NS_IsMainThread(), "Only call on main thread!");
|
MOZ_ASSERT(NS_IsMainThread(), "Only call on main thread!");
|
||||||
MOZ_ASSERT(aFileSystem);
|
MOZ_ASSERT(aFileSystem);
|
||||||
@ -123,7 +123,7 @@ RemoveTask::SetSuccessRequestResult(const FileSystemResponseValue& aValue)
|
|||||||
nsresult
|
nsresult
|
||||||
RemoveTask::Work()
|
RemoveTask::Work()
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(FileSystemUtils::IsParentProcess(),
|
MOZ_ASSERT(XRE_IsParentProcess(),
|
||||||
"Only call from parent process!");
|
"Only call from parent process!");
|
||||||
MOZ_ASSERT(!NS_IsMainThread(), "Only call on worker thread!");
|
MOZ_ASSERT(!NS_IsMainThread(), "Only call on worker thread!");
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ BEGIN_FMRADIO_NAMESPACE
|
|||||||
IFMRadioService*
|
IFMRadioService*
|
||||||
IFMRadioService::Singleton()
|
IFMRadioService::Singleton()
|
||||||
{
|
{
|
||||||
if (XRE_GetProcessType() != GeckoProcessType_Default) {
|
if (!XRE_IsParentProcess()) {
|
||||||
return FMRadioChild::Singleton();
|
return FMRadioChild::Singleton();
|
||||||
} else {
|
} else {
|
||||||
return FMRadioService::Singleton();
|
return FMRadioService::Singleton();
|
||||||
@ -1243,7 +1243,7 @@ FMRadioService::UpdateFrequency()
|
|||||||
FMRadioService*
|
FMRadioService*
|
||||||
FMRadioService::Singleton()
|
FMRadioService::Singleton()
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(XRE_GetProcessType() == GeckoProcessType_Default);
|
MOZ_ASSERT(XRE_IsParentProcess());
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
|
|
||||||
if (!sFMRadioService) {
|
if (!sFMRadioService) {
|
||||||
|
@ -338,7 +338,7 @@ FMRadioChild::EnableAudio(bool aAudioEnabled)
|
|||||||
FMRadioChild*
|
FMRadioChild*
|
||||||
FMRadioChild::Singleton()
|
FMRadioChild::Singleton()
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(XRE_GetProcessType() != GeckoProcessType_Default);
|
MOZ_ASSERT(!XRE_IsParentProcess());
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
|
|
||||||
if (!sFMRadioChild) {
|
if (!sFMRadioChild) {
|
||||||
|
@ -24,7 +24,7 @@ void
|
|||||||
NotifyGamepadChange(const T& aInfo)
|
NotifyGamepadChange(const T& aInfo)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
MOZ_ASSERT(XRE_GetProcessType() == GeckoProcessType_Default);
|
MOZ_ASSERT(XRE_IsParentProcess());
|
||||||
GamepadChangeEvent e(aInfo);
|
GamepadChangeEvent e(aInfo);
|
||||||
nsTArray<ContentParent*> t;
|
nsTArray<ContentParent*> t;
|
||||||
ContentParent::GetAll(t);
|
ContentParent::GetAll(t);
|
||||||
@ -44,7 +44,7 @@ AddGamepad(const char* aID,
|
|||||||
uint32_t aNumButtons, uint32_t aNumAxes)
|
uint32_t aNumButtons, uint32_t aNumAxes)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
MOZ_ASSERT(XRE_GetProcessType() == GeckoProcessType_Default);
|
MOZ_ASSERT(XRE_IsParentProcess());
|
||||||
|
|
||||||
int index = gGamepadIndex;
|
int index = gGamepadIndex;
|
||||||
gGamepadIndex++;
|
gGamepadIndex++;
|
||||||
@ -59,7 +59,7 @@ void
|
|||||||
RemoveGamepad(uint32_t aIndex)
|
RemoveGamepad(uint32_t aIndex)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
MOZ_ASSERT(XRE_GetProcessType() == GeckoProcessType_Default);
|
MOZ_ASSERT(XRE_IsParentProcess());
|
||||||
GamepadRemoved a(aIndex);
|
GamepadRemoved a(aIndex);
|
||||||
NotifyGamepadChange<GamepadRemoved>(a);
|
NotifyGamepadChange<GamepadRemoved>(a);
|
||||||
}
|
}
|
||||||
@ -69,7 +69,7 @@ NewButtonEvent(uint32_t aIndex, uint32_t aButton,
|
|||||||
bool aPressed, double aValue)
|
bool aPressed, double aValue)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
MOZ_ASSERT(XRE_GetProcessType() == GeckoProcessType_Default);
|
MOZ_ASSERT(XRE_IsParentProcess());
|
||||||
GamepadButtonInformation a(aIndex, aButton, aPressed, aValue);
|
GamepadButtonInformation a(aIndex, aButton, aPressed, aValue);
|
||||||
NotifyGamepadChange<GamepadButtonInformation>(a);
|
NotifyGamepadChange<GamepadButtonInformation>(a);
|
||||||
}
|
}
|
||||||
@ -79,7 +79,7 @@ NewButtonEvent(uint32_t aIndex, uint32_t aButton,
|
|||||||
bool aPressed)
|
bool aPressed)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
MOZ_ASSERT(XRE_GetProcessType() == GeckoProcessType_Default);
|
MOZ_ASSERT(XRE_IsParentProcess());
|
||||||
// When only a digital button is available the value will be synthesized.
|
// When only a digital button is available the value will be synthesized.
|
||||||
NewButtonEvent(aIndex, aButton, aPressed, aPressed ? 1.0L : 0.0L);
|
NewButtonEvent(aIndex, aButton, aPressed, aPressed ? 1.0L : 0.0L);
|
||||||
}
|
}
|
||||||
@ -89,7 +89,7 @@ NewAxisMoveEvent(uint32_t aIndex, uint32_t aAxis,
|
|||||||
double aValue)
|
double aValue)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
MOZ_ASSERT(XRE_GetProcessType() == GeckoProcessType_Default);
|
MOZ_ASSERT(XRE_IsParentProcess());
|
||||||
GamepadAxisInformation a(aIndex, aAxis, aValue);
|
GamepadAxisInformation a(aIndex, aAxis, aValue);
|
||||||
NotifyGamepadChange<GamepadAxisInformation>(a);
|
NotifyGamepadChange<GamepadAxisInformation>(a);
|
||||||
}
|
}
|
||||||
@ -98,7 +98,7 @@ void
|
|||||||
ResetGamepadIndexes()
|
ResetGamepadIndexes()
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
MOZ_ASSERT(XRE_GetProcessType() == GeckoProcessType_Default);
|
MOZ_ASSERT(XRE_IsParentProcess());
|
||||||
gGamepadIndex = 0;
|
gGamepadIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ void
|
|||||||
MaybeStopGamepadMonitoring()
|
MaybeStopGamepadMonitoring()
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
MOZ_ASSERT(XRE_GetProcessType() == GeckoProcessType_Default);
|
MOZ_ASSERT(XRE_IsParentProcess());
|
||||||
nsTArray<ContentParent*> t;
|
nsTArray<ContentParent*> t;
|
||||||
ContentParent::GetAll(t);
|
ContentParent::GetAll(t);
|
||||||
for(uint32_t i = 0; i < t.Length(); ++i) {
|
for(uint32_t i = 0; i < t.Length(); ++i) {
|
||||||
|
@ -85,7 +85,7 @@ GamepadService::BeginShutdown()
|
|||||||
mTimer->Cancel();
|
mTimer->Cancel();
|
||||||
}
|
}
|
||||||
if (mStarted) {
|
if (mStarted) {
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Default) {
|
if (XRE_IsParentProcess()) {
|
||||||
MaybeStopGamepadMonitoring();
|
MaybeStopGamepadMonitoring();
|
||||||
} else {
|
} else {
|
||||||
ContentChild::GetSingleton()->SendGamepadListenerRemoved();
|
ContentChild::GetSingleton()->SendGamepadListenerRemoved();
|
||||||
@ -115,7 +115,7 @@ GamepadService::AddListener(nsGlobalWindow* aWindow)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!mStarted && mEnabled) {
|
if (!mStarted && mEnabled) {
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Default) {
|
if (XRE_IsParentProcess()) {
|
||||||
StartGamepadMonitoring();
|
StartGamepadMonitoring();
|
||||||
} else {
|
} else {
|
||||||
ContentChild::GetSingleton()->SendGamepadListenerAdded();
|
ContentChild::GetSingleton()->SendGamepadListenerAdded();
|
||||||
@ -500,7 +500,7 @@ GamepadService::TimeoutHandler(nsITimer* aTimer, void* aClosure)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (self->mListeners.Length() == 0) {
|
if (self->mListeners.Length() == 0) {
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Default) {
|
if (XRE_IsParentProcess()) {
|
||||||
MaybeStopGamepadMonitoring();
|
MaybeStopGamepadMonitoring();
|
||||||
} else {
|
} else {
|
||||||
ContentChild::GetSingleton()->SendGamepadListenerRemoved();
|
ContentChild::GetSingleton()->SendGamepadListenerRemoved();
|
||||||
|
@ -564,7 +564,7 @@ already_AddRefed<nsIDOMGeoPosition>
|
|||||||
nsGeolocationRequest::AdjustedLocation(nsIDOMGeoPosition *aPosition)
|
nsGeolocationRequest::AdjustedLocation(nsIDOMGeoPosition *aPosition)
|
||||||
{
|
{
|
||||||
nsCOMPtr<nsIDOMGeoPosition> pos = aPosition;
|
nsCOMPtr<nsIDOMGeoPosition> pos = aPosition;
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Content) {
|
if (XRE_IsContentProcess()) {
|
||||||
GPSLOG("child process just copying position");
|
GPSLOG("child process just copying position");
|
||||||
return pos.forget();
|
return pos.forget();
|
||||||
}
|
}
|
||||||
@ -758,7 +758,7 @@ nsresult nsGeolocationService::Init()
|
|||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Content) {
|
if (XRE_IsContentProcess()) {
|
||||||
sGeoInitPending = false;
|
sGeoInitPending = false;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
@ -1013,7 +1013,7 @@ nsGeolocationService::StartDevice(nsIPrincipal *aPrincipal)
|
|||||||
// inactivivity
|
// inactivivity
|
||||||
SetDisconnectTimer();
|
SetDisconnectTimer();
|
||||||
|
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Content) {
|
if (XRE_IsContentProcess()) {
|
||||||
ContentChild* cpc = ContentChild::GetSingleton();
|
ContentChild* cpc = ContentChild::GetSingleton();
|
||||||
cpc->SendAddGeolocationListener(IPC::Principal(aPrincipal),
|
cpc->SendAddGeolocationListener(IPC::Principal(aPrincipal),
|
||||||
HighAccuracyRequested());
|
HighAccuracyRequested());
|
||||||
@ -1076,7 +1076,7 @@ nsGeolocationService::UpdateAccuracy(bool aForceHigh)
|
|||||||
{
|
{
|
||||||
bool highRequired = aForceHigh || HighAccuracyRequested();
|
bool highRequired = aForceHigh || HighAccuracyRequested();
|
||||||
|
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Content) {
|
if (XRE_IsContentProcess()) {
|
||||||
ContentChild* cpc = ContentChild::GetSingleton();
|
ContentChild* cpc = ContentChild::GetSingleton();
|
||||||
if (cpc->IsAlive()) {
|
if (cpc->IsAlive()) {
|
||||||
cpc->SendSetGeolocationHigherAccuracy(highRequired);
|
cpc->SendSetGeolocationHigherAccuracy(highRequired);
|
||||||
@ -1103,7 +1103,7 @@ nsGeolocationService::StopDevice()
|
|||||||
mDisconnectTimer = nullptr;
|
mDisconnectTimer = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Content) {
|
if (XRE_IsContentProcess()) {
|
||||||
ContentChild* cpc = ContentChild::GetSingleton();
|
ContentChild* cpc = ContentChild::GetSingleton();
|
||||||
cpc->SendRemoveGeolocationListener();
|
cpc->SendRemoveGeolocationListener();
|
||||||
return; // bail early
|
return; // bail early
|
||||||
|
@ -49,7 +49,7 @@ already_AddRefed<nsGeolocationSettings>
|
|||||||
nsGeolocationSettings::GetGeolocationSettings()
|
nsGeolocationSettings::GetGeolocationSettings()
|
||||||
{
|
{
|
||||||
// this singleton is only needed in the parent process...
|
// this singleton is only needed in the parent process...
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Content) {
|
if (XRE_IsContentProcess()) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -746,7 +746,7 @@ UploadLastDir::FetchDirectoryAndDisplayPicker(nsIDocument* aDoc,
|
|||||||
new UploadLastDir::ContentPrefCallback(aFilePicker, aFpCallback);
|
new UploadLastDir::ContentPrefCallback(aFilePicker, aFpCallback);
|
||||||
|
|
||||||
#ifdef MOZ_B2G
|
#ifdef MOZ_B2G
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Content) {
|
if (XRE_IsContentProcess()) {
|
||||||
prefCallback->HandleCompletion(nsIContentPrefCallback2::COMPLETE_ERROR);
|
prefCallback->HandleCompletion(nsIContentPrefCallback2::COMPLETE_ERROR);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
@ -777,7 +777,7 @@ UploadLastDir::StoreLastUsedDirectory(nsIDocument* aDoc, nsIFile* aDir)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MOZ_B2G
|
#ifdef MOZ_B2G
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Content) {
|
if (XRE_IsContentProcess()) {
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -2105,7 +2105,7 @@ HTMLInputElement::MozSetFileArray(const Sequence<OwningNonNull<File>>& aFiles)
|
|||||||
void
|
void
|
||||||
HTMLInputElement::MozSetFileNameArray(const Sequence< nsString >& aFileNames, ErrorResult& aRv)
|
HTMLInputElement::MozSetFileNameArray(const Sequence< nsString >& aFileNames, ErrorResult& aRv)
|
||||||
{
|
{
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Content) {
|
if (XRE_IsContentProcess()) {
|
||||||
aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
|
aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -596,7 +596,7 @@ nsGenericHTMLFrameElement::GetAppManifestURL(nsAString& aOut)
|
|||||||
|
|
||||||
// Only allow content process to embed an app when nested content
|
// Only allow content process to embed an app when nested content
|
||||||
// process is enabled.
|
// process is enabled.
|
||||||
if (XRE_GetProcessType() != GeckoProcessType_Default &&
|
if (!XRE_IsParentProcess() &&
|
||||||
!(GetBoolAttr(nsGkAtoms::Remote) && NestedEnabled())){
|
!(GetBoolAttr(nsGkAtoms::Remote) && NestedEnabled())){
|
||||||
NS_WARNING("Can't embed-apps. Embed-apps is restricted to in-proc apps "
|
NS_WARNING("Can't embed-apps. Embed-apps is restricted to in-proc apps "
|
||||||
"or content processes with nested pref enabled, see bug 1097479");
|
"or content processes with nested pref enabled, see bug 1097479");
|
||||||
|
@ -468,6 +468,8 @@ skip-if = toolkit == 'android'
|
|||||||
[test_formelements.html]
|
[test_formelements.html]
|
||||||
[test_fullscreen-api.html]
|
[test_fullscreen-api.html]
|
||||||
skip-if = buildapp == 'mulet' || buildapp == 'b2g' || toolkit == 'android' || e10s #TIMED_OUT # b2g(time out, some kind of focus issue) b2g-debug(time out, some kind of focus issue) b2g-desktop(time out, some kind of focus issue)
|
skip-if = buildapp == 'mulet' || buildapp == 'b2g' || toolkit == 'android' || e10s #TIMED_OUT # b2g(time out, some kind of focus issue) b2g-debug(time out, some kind of focus issue) b2g-desktop(time out, some kind of focus issue)
|
||||||
|
[test_fullscreen-api-race.html]
|
||||||
|
skip-if = buildapp == 'mulet' || buildapp == 'b2g' || toolkit == 'android' || toolkit == 'cocoa' || e10s # just copy the conditions from the test above
|
||||||
[test_hidden.html]
|
[test_hidden.html]
|
||||||
[test_html_attributes_reflection.html]
|
[test_html_attributes_reflection.html]
|
||||||
[test_htmlcollection.html]
|
[test_htmlcollection.html]
|
||||||
|
114
dom/html/test/test_fullscreen-api-race.html
Normal file
114
dom/html/test/test_fullscreen-api-race.html
Normal file
@ -0,0 +1,114 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Test for race conditions of Fullscreen API</title>
|
||||||
|
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||||
|
<script src="/tests/SimpleTest/EventUtils.js"></script>
|
||||||
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
function Deferred() {
|
||||||
|
this.promise = new Promise(resolve => {
|
||||||
|
this.resolve = resolve;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
SimpleTest.waitForExplicitFinish();
|
||||||
|
addLoadEvent(function () {
|
||||||
|
SpecialPowers.pushPrefEnv({
|
||||||
|
"set": [["full-screen-api.allow-trusted-requests-only", false]]
|
||||||
|
}, next);
|
||||||
|
});
|
||||||
|
|
||||||
|
const OPEN_WINDOW_FUNCS = [
|
||||||
|
function openNewTab() {
|
||||||
|
return window.open("about:blank");
|
||||||
|
},
|
||||||
|
function openNewWindow() {
|
||||||
|
return window.open("about:blank", "", "width=300,height=200");
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
const ACTION_FUNCS = [
|
||||||
|
function navigate(win) {
|
||||||
|
info("About to navigate to another page");
|
||||||
|
var deferred = new Deferred();
|
||||||
|
win.location = "data:text/html,<html>";
|
||||||
|
setTimeout(() => {
|
||||||
|
SimpleTest.waitForFocus(() => {
|
||||||
|
ok(!win.fullScreen, "The window should no longer be in fullscreen");
|
||||||
|
win.close();
|
||||||
|
deferred.resolve();
|
||||||
|
}, win);
|
||||||
|
}, 0);
|
||||||
|
return deferred.promise;
|
||||||
|
},
|
||||||
|
function closeWindow(win) {
|
||||||
|
info("About to close the window");
|
||||||
|
win.close();
|
||||||
|
return Promise.resolve();
|
||||||
|
},
|
||||||
|
function exitFullscreen(win) {
|
||||||
|
info("About to cancel fullscreen");
|
||||||
|
var deferred = new Deferred();
|
||||||
|
function listener() {
|
||||||
|
win.removeEventListener("mozfullscreenchange", listener);
|
||||||
|
ok(!win.document.mozFullScreen, "Should exit fullscreen");
|
||||||
|
ok(!win.fullScreen, "The window should no longer be in fullscreen");
|
||||||
|
win.close();
|
||||||
|
deferred.resolve();
|
||||||
|
}
|
||||||
|
win.addEventListener("mozfullscreenchange", listener);
|
||||||
|
win.document.mozCancelFullScreen();
|
||||||
|
return deferred.promise;
|
||||||
|
},
|
||||||
|
function exitAndClose(win) {
|
||||||
|
info("About to cancel fullscreen and close the window");
|
||||||
|
win.document.mozCancelFullScreen();
|
||||||
|
win.close();
|
||||||
|
return Promise.resolve();
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
function* testGenerator() {
|
||||||
|
for (var openWinFunc of OPEN_WINDOW_FUNCS) {
|
||||||
|
for (var actionFunc of ACTION_FUNCS) {
|
||||||
|
info(`Testing ${openWinFunc.name}, ${actionFunc.name}`);
|
||||||
|
yield { openWinFunc: openWinFunc, actionFunc: actionFunc };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var tests = testGenerator();
|
||||||
|
|
||||||
|
function next() {
|
||||||
|
var test = tests.next().value;
|
||||||
|
if (!test) {
|
||||||
|
SimpleTest.finish();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var win = test.openWinFunc();
|
||||||
|
new Promise(resolve => {
|
||||||
|
SimpleTest.waitForFocus(resolve, win, true);
|
||||||
|
}).then(() => {
|
||||||
|
return new Promise(resolve => {
|
||||||
|
function listener() {
|
||||||
|
win.removeEventListener("mozfullscreenchange", listener);
|
||||||
|
ok(win.document.mozFullScreen, "Should have entered fullscreen");
|
||||||
|
ok(win.fullScreen, "The window should be in fullscreen");
|
||||||
|
test.actionFunc(win).then(resolve);
|
||||||
|
}
|
||||||
|
win.addEventListener("mozfullscreenchange", listener);
|
||||||
|
win.document.documentElement.mozRequestFullScreen();
|
||||||
|
});
|
||||||
|
}).then(() => {
|
||||||
|
ok(win.closed, "The window should have been closed");
|
||||||
|
SimpleTest.waitForFocus(next);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -143,7 +143,7 @@ NS_CreateIccService()
|
|||||||
{
|
{
|
||||||
nsCOMPtr<nsIIccService> service;
|
nsCOMPtr<nsIIccService> service;
|
||||||
|
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Content) {
|
if (XRE_IsContentProcess()) {
|
||||||
service = new mozilla::dom::icc::IccIPCService();
|
service = new mozilla::dom::icc::IccIPCService();
|
||||||
#if defined(MOZ_WIDGET_GONK) && defined(MOZ_B2G_RIL)
|
#if defined(MOZ_WIDGET_GONK) && defined(MOZ_B2G_RIL)
|
||||||
} else {
|
} else {
|
||||||
|
@ -818,7 +818,7 @@ public:
|
|||||||
: PermissionRequestBase(aElement, aPrincipal)
|
: PermissionRequestBase(aElement, aPrincipal)
|
||||||
, mChallenge(aChallenge)
|
, mChallenge(aChallenge)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(XRE_GetProcessType() == GeckoProcessType_Default);
|
MOZ_ASSERT(XRE_IsParentProcess());
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
MOZ_ASSERT(aChallenge);
|
MOZ_ASSERT(aChallenge);
|
||||||
}
|
}
|
||||||
@ -844,7 +844,7 @@ public:
|
|||||||
WorkerPermissionChallenge* aChallenge)
|
WorkerPermissionChallenge* aChallenge)
|
||||||
: mChallenge(aChallenge)
|
: mChallenge(aChallenge)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(XRE_GetProcessType() != GeckoProcessType_Default);
|
MOZ_ASSERT(!XRE_IsParentProcess());
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
MOZ_ASSERT(aChallenge);
|
MOZ_ASSERT(aChallenge);
|
||||||
}
|
}
|
||||||
@ -950,7 +950,7 @@ private:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Default) {
|
if (XRE_IsParentProcess()) {
|
||||||
nsCOMPtr<Element> ownerElement =
|
nsCOMPtr<Element> ownerElement =
|
||||||
do_QueryInterface(window->GetChromeEventHandler());
|
do_QueryInterface(window->GetChromeEventHandler());
|
||||||
if (NS_WARN_IF(!ownerElement)) {
|
if (NS_WARN_IF(!ownerElement)) {
|
||||||
@ -1399,7 +1399,7 @@ BackgroundFactoryRequestChild::RecvPermissionChallenge(
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Default) {
|
if (XRE_IsParentProcess()) {
|
||||||
nsCOMPtr<nsPIDOMWindow> window = mFactory->GetParentObject();
|
nsCOMPtr<nsPIDOMWindow> window = mFactory->GetParentObject();
|
||||||
MOZ_ASSERT(window);
|
MOZ_ASSERT(window);
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ BlobImplSnapshot::~BlobImplSnapshot()
|
|||||||
void
|
void
|
||||||
BlobImplSnapshot::AssertSanity()
|
BlobImplSnapshot::AssertSanity()
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(XRE_GetProcessType() == GeckoProcessType_Default);
|
MOZ_ASSERT(XRE_IsParentProcess());
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -302,7 +302,7 @@ IndexedDatabaseManager::GetOrCreate()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gDBManager) {
|
if (!gDBManager) {
|
||||||
sIsMainProcess = XRE_GetProcessType() == GeckoProcessType_Default;
|
sIsMainProcess = XRE_IsParentProcess();
|
||||||
|
|
||||||
if (!sLoggingModule) {
|
if (!sLoggingModule) {
|
||||||
sLoggingModule = PR_NewLogModule("IndexedDB");
|
sLoggingModule = PR_NewLogModule("IndexedDB");
|
||||||
@ -639,7 +639,7 @@ IndexedDatabaseManager::IsMainProcess()
|
|||||||
{
|
{
|
||||||
NS_ASSERTION(gDBManager,
|
NS_ASSERTION(gDBManager,
|
||||||
"IsMainProcess() called before indexedDB has been initialized!");
|
"IsMainProcess() called before indexedDB has been initialized!");
|
||||||
NS_ASSERTION((XRE_GetProcessType() == GeckoProcessType_Default) ==
|
NS_ASSERTION((XRE_IsParentProcess()) ==
|
||||||
sIsMainProcess, "XRE_GetProcessType changed its tune!");
|
sIsMainProcess, "XRE_GetProcessType changed its tune!");
|
||||||
return sIsMainProcess;
|
return sIsMainProcess;
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ const uint32_t kPermissionDefault = nsIPermissionManager::UNKNOWN_ACTION;
|
|||||||
void
|
void
|
||||||
AssertSanity()
|
AssertSanity()
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(XRE_GetProcessType() == GeckoProcessType_Default);
|
MOZ_ASSERT(XRE_IsParentProcess());
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3294,7 +3294,7 @@ BlobChild::AssertIsOnOwningThread() const
|
|||||||
void
|
void
|
||||||
BlobChild::Startup(const FriendKey& /* aKey */)
|
BlobChild::Startup(const FriendKey& /* aKey */)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(XRE_GetProcessType() != GeckoProcessType_Default);
|
MOZ_ASSERT(!XRE_IsParentProcess());
|
||||||
|
|
||||||
CommonStartup();
|
CommonStartup();
|
||||||
}
|
}
|
||||||
@ -3822,7 +3822,7 @@ BlobParent::AssertIsOnOwningThread() const
|
|||||||
void
|
void
|
||||||
BlobParent::Startup(const FriendKey& /* aKey */)
|
BlobParent::Startup(const FriendKey& /* aKey */)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(XRE_GetProcessType() == GeckoProcessType_Default);
|
MOZ_ASSERT(XRE_IsParentProcess());
|
||||||
|
|
||||||
CommonStartup();
|
CommonStartup();
|
||||||
|
|
||||||
|
@ -2830,7 +2830,7 @@ uint64_t
|
|||||||
NextWindowID()
|
NextWindowID()
|
||||||
{
|
{
|
||||||
uint64_t processID = 0;
|
uint64_t processID = 0;
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Content) {
|
if (XRE_IsContentProcess()) {
|
||||||
ContentChild* cc = ContentChild::GetSingleton();
|
ContentChild* cc = ContentChild::GetSingleton();
|
||||||
processID = cc->GetID();
|
processID = cc->GetID();
|
||||||
}
|
}
|
||||||
|
@ -778,7 +778,7 @@ ContentParent::StartUp()
|
|||||||
// child process
|
// child process
|
||||||
sCanLaunchSubprocesses = true;
|
sCanLaunchSubprocesses = true;
|
||||||
|
|
||||||
if (XRE_GetProcessType() != GeckoProcessType_Default) {
|
if (!XRE_IsParentProcess()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1152,7 +1152,7 @@ ContentParent::CreateBrowserOrApp(const TabContext& aContext,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ProcessPriority initialPriority = GetInitialProcessPriority(aFrameElement);
|
ProcessPriority initialPriority = GetInitialProcessPriority(aFrameElement);
|
||||||
bool isInContentProcess = (XRE_GetProcessType() != GeckoProcessType_Default);
|
bool isInContentProcess = !XRE_IsParentProcess();
|
||||||
TabId tabId;
|
TabId tabId;
|
||||||
|
|
||||||
nsIDocShell* docShell = GetOpenerDocShellHelper(aFrameElement);
|
nsIDocShell* docShell = GetOpenerDocShellHelper(aFrameElement);
|
||||||
@ -1811,7 +1811,7 @@ ContentParent::OnChannelError()
|
|||||||
|
|
||||||
void
|
void
|
||||||
ContentParent::OnBeginSyncTransaction() {
|
ContentParent::OnBeginSyncTransaction() {
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Default) {
|
if (XRE_IsParentProcess()) {
|
||||||
nsCOMPtr<nsIConsoleService> console(do_GetService(NS_CONSOLESERVICE_CONTRACTID));
|
nsCOMPtr<nsIConsoleService> console(do_GetService(NS_CONSOLESERVICE_CONTRACTID));
|
||||||
JSContext *cx = nsContentUtils::GetCurrentJSContext();
|
JSContext *cx = nsContentUtils::GetCurrentJSContext();
|
||||||
if (!sDisableUnsafeCPOWWarnings) {
|
if (!sDisableUnsafeCPOWWarnings) {
|
||||||
@ -4895,7 +4895,7 @@ ContentParent::AllocateTabId(const TabId& aOpenerTabId,
|
|||||||
const ContentParentId& aCpId)
|
const ContentParentId& aCpId)
|
||||||
{
|
{
|
||||||
TabId tabId;
|
TabId tabId;
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Default) {
|
if (XRE_IsParentProcess()) {
|
||||||
ContentProcessManager *cpm = ContentProcessManager::GetSingleton();
|
ContentProcessManager *cpm = ContentProcessManager::GetSingleton();
|
||||||
tabId = cpm->AllocateTabId(aOpenerTabId, aContext, aCpId);
|
tabId = cpm->AllocateTabId(aOpenerTabId, aContext, aCpId);
|
||||||
}
|
}
|
||||||
@ -4912,7 +4912,7 @@ ContentParent::AllocateTabId(const TabId& aOpenerTabId,
|
|||||||
ContentParent::DeallocateTabId(const TabId& aTabId,
|
ContentParent::DeallocateTabId(const TabId& aTabId,
|
||||||
const ContentParentId& aCpId)
|
const ContentParentId& aCpId)
|
||||||
{
|
{
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Default) {
|
if (XRE_IsParentProcess()) {
|
||||||
ContentProcessManager::GetSingleton()->DeallocateTabId(aCpId,
|
ContentProcessManager::GetSingleton()->DeallocateTabId(aCpId,
|
||||||
aTabId);
|
aTabId);
|
||||||
}
|
}
|
||||||
@ -5111,7 +5111,7 @@ ContentParent::DeallocPContentPermissionRequestParent(PContentPermissionRequestP
|
|||||||
bool
|
bool
|
||||||
ContentParent::RecvGetBrowserConfiguration(const nsCString& aURI, BrowserConfiguration* aConfig)
|
ContentParent::RecvGetBrowserConfiguration(const nsCString& aURI, BrowserConfiguration* aConfig)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(XRE_GetProcessType() == GeckoProcessType_Default);
|
MOZ_ASSERT(XRE_IsParentProcess());
|
||||||
|
|
||||||
return GetBrowserConfiguration(aURI, *aConfig);;
|
return GetBrowserConfiguration(aURI, *aConfig);;
|
||||||
}
|
}
|
||||||
@ -5119,7 +5119,7 @@ ContentParent::RecvGetBrowserConfiguration(const nsCString& aURI, BrowserConfigu
|
|||||||
/*static*/ bool
|
/*static*/ bool
|
||||||
ContentParent::GetBrowserConfiguration(const nsCString& aURI, BrowserConfiguration& aConfig)
|
ContentParent::GetBrowserConfiguration(const nsCString& aURI, BrowserConfiguration& aConfig)
|
||||||
{
|
{
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Default) {
|
if (XRE_IsParentProcess()) {
|
||||||
nsRefPtr<ServiceWorkerRegistrar> swr = ServiceWorkerRegistrar::Get();
|
nsRefPtr<ServiceWorkerRegistrar> swr = ServiceWorkerRegistrar::Get();
|
||||||
MOZ_ASSERT(swr);
|
MOZ_ASSERT(swr);
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ ContentProcessManager::sSingleton;
|
|||||||
/* static */ ContentProcessManager*
|
/* static */ ContentProcessManager*
|
||||||
ContentProcessManager::GetSingleton()
|
ContentProcessManager::GetSingleton()
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(XRE_GetProcessType() == GeckoProcessType_Default);
|
MOZ_ASSERT(XRE_IsParentProcess());
|
||||||
|
|
||||||
if (!sSingleton) {
|
if (!sSingleton) {
|
||||||
sSingleton = new ContentProcessManager();
|
sSingleton = new ContentProcessManager();
|
||||||
|
@ -887,7 +887,7 @@ ProcessHangMonitor::ProcessHangMonitor()
|
|||||||
|
|
||||||
MOZ_COUNT_CTOR(ProcessHangMonitor);
|
MOZ_COUNT_CTOR(ProcessHangMonitor);
|
||||||
|
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Content) {
|
if (XRE_IsContentProcess()) {
|
||||||
nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
|
nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
|
||||||
obs->AddObserver(this, "xpcom-shutdown", false);
|
obs->AddObserver(this, "xpcom-shutdown", false);
|
||||||
}
|
}
|
||||||
|
@ -384,7 +384,7 @@ ProcessPriorityManagerImpl::StaticInit()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// The process priority manager is main-process only.
|
// The process priority manager is main-process only.
|
||||||
if (XRE_GetProcessType() != GeckoProcessType_Default) {
|
if (!XRE_IsParentProcess()) {
|
||||||
sInitialized = true;
|
sInitialized = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -427,7 +427,7 @@ ProcessPriorityManagerImpl::ProcessPriorityManagerImpl()
|
|||||||
, mBackgroundLRUPool(PROCESS_PRIORITY_BACKGROUND)
|
, mBackgroundLRUPool(PROCESS_PRIORITY_BACKGROUND)
|
||||||
, mBackgroundPerceivableLRUPool(PROCESS_PRIORITY_BACKGROUND_PERCEIVABLE)
|
, mBackgroundPerceivableLRUPool(PROCESS_PRIORITY_BACKGROUND_PERCEIVABLE)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(XRE_GetProcessType() == GeckoProcessType_Default);
|
MOZ_ASSERT(XRE_IsParentProcess());
|
||||||
RegisterWakeLockObserver(this);
|
RegisterWakeLockObserver(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -660,7 +660,7 @@ ParticularProcessPriorityManager::ParticularProcessPriorityManager(
|
|||||||
, mIsActivityOpener(false)
|
, mIsActivityOpener(false)
|
||||||
, mFrozen(aFrozen)
|
, mFrozen(aFrozen)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(XRE_GetProcessType() == GeckoProcessType_Default);
|
MOZ_ASSERT(XRE_IsParentProcess());
|
||||||
LOGP("Creating ParticularProcessPriorityManager.");
|
LOGP("Creating ParticularProcessPriorityManager.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -826,7 +826,7 @@ ParticularProcessPriorityManager::OnRemoteBrowserFrameShown(nsISupports* aSubjec
|
|||||||
TabParent* tp = TabParent::GetFrom(fl);
|
TabParent* tp = TabParent::GetFrom(fl);
|
||||||
NS_ENSURE_TRUE_VOID(tp);
|
NS_ENSURE_TRUE_VOID(tp);
|
||||||
|
|
||||||
MOZ_ASSERT(XRE_GetProcessType() == GeckoProcessType_Default);
|
MOZ_ASSERT(XRE_IsParentProcess());
|
||||||
if (tp->Manager() != mContentParent) {
|
if (tp->Manager() != mContentParent) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -850,7 +850,7 @@ ParticularProcessPriorityManager::OnTabParentDestroyed(nsISupports* aSubject)
|
|||||||
nsCOMPtr<nsITabParent> tp = do_QueryInterface(aSubject);
|
nsCOMPtr<nsITabParent> tp = do_QueryInterface(aSubject);
|
||||||
NS_ENSURE_TRUE_VOID(tp);
|
NS_ENSURE_TRUE_VOID(tp);
|
||||||
|
|
||||||
MOZ_ASSERT(XRE_GetProcessType() == GeckoProcessType_Default);
|
MOZ_ASSERT(XRE_IsParentProcess());
|
||||||
if (TabParent::GetFrom(tp)->Manager() != mContentParent) {
|
if (TabParent::GetFrom(tp)->Manager() != mContentParent) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -873,7 +873,7 @@ ParticularProcessPriorityManager::OnFrameloaderVisibleChanged(nsISupports* aSubj
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
MOZ_ASSERT(XRE_GetProcessType() == GeckoProcessType_Default);
|
MOZ_ASSERT(XRE_IsParentProcess());
|
||||||
if (tp->Manager() != mContentParent) {
|
if (tp->Manager() != mContentParent) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1213,7 +1213,7 @@ NS_IMPL_ISUPPORTS(ProcessPriorityManagerChild,
|
|||||||
|
|
||||||
ProcessPriorityManagerChild::ProcessPriorityManagerChild()
|
ProcessPriorityManagerChild::ProcessPriorityManagerChild()
|
||||||
{
|
{
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Default) {
|
if (XRE_IsParentProcess()) {
|
||||||
mCachedPriority = PROCESS_PRIORITY_MASTER;
|
mCachedPriority = PROCESS_PRIORITY_MASTER;
|
||||||
} else {
|
} else {
|
||||||
mCachedPriority = PROCESS_PRIORITY_UNKNOWN;
|
mCachedPriority = PROCESS_PRIORITY_UNKNOWN;
|
||||||
@ -1225,7 +1225,7 @@ ProcessPriorityManagerChild::Init()
|
|||||||
{
|
{
|
||||||
// The process priority should only be changed in child processes; don't even
|
// The process priority should only be changed in child processes; don't even
|
||||||
// bother listening for changes if we're in the main process.
|
// bother listening for changes if we're in the main process.
|
||||||
if (XRE_GetProcessType() != GeckoProcessType_Default) {
|
if (!XRE_IsParentProcess()) {
|
||||||
nsCOMPtr<nsIObserverService> os = services::GetObserverService();
|
nsCOMPtr<nsIObserverService> os = services::GetObserverService();
|
||||||
NS_ENSURE_TRUE_VOID(os);
|
NS_ENSURE_TRUE_VOID(os);
|
||||||
os->AddObserver(this, "ipc:process-priority-changed", /* weak = */ false);
|
os->AddObserver(this, "ipc:process-priority-changed", /* weak = */ false);
|
||||||
|
@ -447,7 +447,7 @@ TabParent::Destroy()
|
|||||||
}
|
}
|
||||||
mIsDestroyed = true;
|
mIsDestroyed = true;
|
||||||
|
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Default) {
|
if (XRE_IsParentProcess()) {
|
||||||
Manager()->AsContentParent()->NotifyTabDestroying(this);
|
Manager()->AsContentParent()->NotifyTabDestroying(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -465,7 +465,7 @@ TabParent::Destroy()
|
|||||||
bool
|
bool
|
||||||
TabParent::Recv__delete__()
|
TabParent::Recv__delete__()
|
||||||
{
|
{
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Default) {
|
if (XRE_IsParentProcess()) {
|
||||||
Manager()->AsContentParent()->NotifyTabDestroyed(this, mMarkedDestroying);
|
Manager()->AsContentParent()->NotifyTabDestroyed(this, mMarkedDestroying);
|
||||||
ContentParent::DeallocateTabId(mTabId,
|
ContentParent::DeallocateTabId(mTabId,
|
||||||
Manager()->AsContentParent()->ChildID());
|
Manager()->AsContentParent()->ChildID());
|
||||||
|
@ -1478,7 +1478,7 @@ MediaManager::NotifyRecordingStatusChange(nsPIDOMWindow* aWindow,
|
|||||||
|
|
||||||
// Forward recording events to parent process.
|
// Forward recording events to parent process.
|
||||||
// The events are gathered in chrome process and used for recording indicator
|
// The events are gathered in chrome process and used for recording indicator
|
||||||
if (XRE_GetProcessType() != GeckoProcessType_Default) {
|
if (!XRE_IsParentProcess()) {
|
||||||
unused <<
|
unused <<
|
||||||
dom::ContentChild::GetSingleton()->SendRecordingDeviceEvents(aMsg,
|
dom::ContentChild::GetSingleton()->SendRecordingDeviceEvents(aMsg,
|
||||||
requestURL,
|
requestURL,
|
||||||
|
@ -636,15 +636,16 @@ CDMProxy::Capabilites() {
|
|||||||
return mCapabilites;
|
return mCapabilites;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
nsRefPtr<CDMProxy::DecryptPromise>
|
||||||
CDMProxy::Decrypt(MediaRawData* aSample,
|
CDMProxy::Decrypt(MediaRawData* aSample)
|
||||||
DecryptionClient* aClient,
|
|
||||||
MediaTaskQueue* aTaskQueue)
|
|
||||||
{
|
{
|
||||||
nsRefPtr<DecryptJob> job(new DecryptJob(aSample, aClient, aTaskQueue));
|
nsRefPtr<DecryptJob> job(new DecryptJob(aSample));
|
||||||
|
nsRefPtr<DecryptPromise> promise(job->Ensure());
|
||||||
|
|
||||||
nsCOMPtr<nsIRunnable> task(
|
nsCOMPtr<nsIRunnable> task(
|
||||||
NS_NewRunnableMethodWithArg<nsRefPtr<DecryptJob>>(this, &CDMProxy::gmp_Decrypt, job));
|
NS_NewRunnableMethodWithArg<nsRefPtr<DecryptJob>>(this, &CDMProxy::gmp_Decrypt, job));
|
||||||
mGMPThread->Dispatch(task, NS_DISPATCH_NORMAL);
|
mGMPThread->Dispatch(task, NS_DISPATCH_NORMAL);
|
||||||
|
return promise;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -703,7 +704,6 @@ CDMProxy::DecryptJob::PostResult(GMPErr aResult, const nsTArray<uint8_t>& aDecry
|
|||||||
if (aDecryptedData.Length() != mSample->mSize) {
|
if (aDecryptedData.Length() != mSample->mSize) {
|
||||||
NS_WARNING("CDM returned incorrect number of decrypted bytes");
|
NS_WARNING("CDM returned incorrect number of decrypted bytes");
|
||||||
}
|
}
|
||||||
mResult = aResult;
|
|
||||||
if (GMP_SUCCEEDED(aResult)) {
|
if (GMP_SUCCEEDED(aResult)) {
|
||||||
nsAutoPtr<MediaRawDataWriter> writer(mSample->CreateWriter());
|
nsAutoPtr<MediaRawDataWriter> writer(mSample->CreateWriter());
|
||||||
PodCopy(writer->mData,
|
PodCopy(writer->mData,
|
||||||
@ -717,17 +717,8 @@ CDMProxy::DecryptJob::PostResult(GMPErr aResult, const nsTArray<uint8_t>& aDecry
|
|||||||
nsAutoCString str("CDM returned decode failure GMPErr=");
|
nsAutoCString str("CDM returned decode failure GMPErr=");
|
||||||
str.AppendInt(aResult);
|
str.AppendInt(aResult);
|
||||||
NS_WARNING(str.get());
|
NS_WARNING(str.get());
|
||||||
mSample = nullptr;
|
|
||||||
}
|
}
|
||||||
mTaskQueue->Dispatch(RefPtr<nsIRunnable>(this).forget());
|
mPromise.Resolve(DecryptResult(aResult, mSample), __func__);
|
||||||
}
|
|
||||||
|
|
||||||
nsresult
|
|
||||||
CDMProxy::DecryptJob::Run()
|
|
||||||
{
|
|
||||||
MOZ_ASSERT(mTaskQueue->IsCurrentThreadIn());
|
|
||||||
mClient->Decrypted(mResult, mSample);
|
|
||||||
return NS_OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
#include "nsIThread.h"
|
#include "nsIThread.h"
|
||||||
#include "GMPDecryptorProxy.h"
|
#include "GMPDecryptorProxy.h"
|
||||||
#include "mozilla/CDMCaps.h"
|
#include "mozilla/CDMCaps.h"
|
||||||
|
#include "MediaPromise.h"
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
class MediaRawData;
|
class MediaRawData;
|
||||||
@ -23,11 +24,13 @@ namespace dom {
|
|||||||
class MediaKeySession;
|
class MediaKeySession;
|
||||||
}
|
}
|
||||||
|
|
||||||
class DecryptionClient {
|
struct DecryptResult {
|
||||||
public:
|
DecryptResult(GMPErr aStatus, MediaRawData* aSample)
|
||||||
virtual ~DecryptionClient() {}
|
: mStatus(aStatus)
|
||||||
virtual void Decrypted(GMPErr aResult,
|
, mSample(aSample)
|
||||||
MediaRawData* aSample) = 0;
|
{}
|
||||||
|
GMPErr mStatus;
|
||||||
|
nsRefPtr<MediaRawData> mSample;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Proxies calls GMP/CDM, and proxies calls back.
|
// Proxies calls GMP/CDM, and proxies calls back.
|
||||||
@ -41,6 +44,8 @@ public:
|
|||||||
|
|
||||||
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CDMProxy)
|
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CDMProxy)
|
||||||
|
|
||||||
|
typedef MediaPromise<DecryptResult, DecryptResult, /* IsExclusive = */ true> DecryptPromise;
|
||||||
|
|
||||||
// Main thread only.
|
// Main thread only.
|
||||||
CDMProxy(dom::MediaKeys* aKeys, const nsAString& aKeySystem);
|
CDMProxy(dom::MediaKeys* aKeys, const nsAString& aKeySystem);
|
||||||
|
|
||||||
@ -140,10 +145,7 @@ public:
|
|||||||
nsresult aDOMException,
|
nsresult aDOMException,
|
||||||
const nsCString& aMsg);
|
const nsCString& aMsg);
|
||||||
|
|
||||||
// Threadsafe.
|
nsRefPtr<DecryptPromise> Decrypt(MediaRawData* aSample);
|
||||||
void Decrypt(MediaRawData* aSample,
|
|
||||||
DecryptionClient* aSink,
|
|
||||||
MediaTaskQueue* aTaskQueue);
|
|
||||||
|
|
||||||
// Reject promise with DOMException corresponding to aExceptionCode.
|
// Reject promise with DOMException corresponding to aExceptionCode.
|
||||||
// Can be called from any thread.
|
// Can be called from any thread.
|
||||||
@ -236,32 +238,28 @@ private:
|
|||||||
// GMP thread only.
|
// GMP thread only.
|
||||||
void gmp_RemoveSession(nsAutoPtr<SessionOpData> aData);
|
void gmp_RemoveSession(nsAutoPtr<SessionOpData> aData);
|
||||||
|
|
||||||
class DecryptJob : public nsRunnable {
|
class DecryptJob {
|
||||||
public:
|
public:
|
||||||
explicit DecryptJob(MediaRawData* aSample,
|
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(DecryptJob)
|
||||||
DecryptionClient* aClient,
|
|
||||||
MediaTaskQueue* aTaskQueue)
|
explicit DecryptJob(MediaRawData* aSample)
|
||||||
: mId(0)
|
: mId(0)
|
||||||
, mSample(aSample)
|
, mSample(aSample)
|
||||||
, mClient(aClient)
|
|
||||||
, mResult(GMPGenericErr)
|
|
||||||
, mTaskQueue(aTaskQueue)
|
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(mClient);
|
|
||||||
MOZ_ASSERT(mSample);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_METHOD Run() override;
|
|
||||||
void PostResult(GMPErr aResult, const nsTArray<uint8_t>& aDecryptedData);
|
void PostResult(GMPErr aResult, const nsTArray<uint8_t>& aDecryptedData);
|
||||||
void PostResult(GMPErr aResult);
|
void PostResult(GMPErr aResult);
|
||||||
|
|
||||||
|
nsRefPtr<DecryptPromise> Ensure() {
|
||||||
|
return mPromise.Ensure(__func__);
|
||||||
|
}
|
||||||
|
|
||||||
uint32_t mId;
|
uint32_t mId;
|
||||||
nsRefPtr<MediaRawData> mSample;
|
nsRefPtr<MediaRawData> mSample;
|
||||||
private:
|
private:
|
||||||
~DecryptJob() {}
|
~DecryptJob() {}
|
||||||
nsAutoPtr<DecryptionClient> mClient;
|
MediaPromiseHolder<DecryptPromise> mPromise;
|
||||||
GMPErr mResult;
|
|
||||||
nsRefPtr<MediaTaskQueue> mTaskQueue;
|
|
||||||
};
|
};
|
||||||
// GMP thread only.
|
// GMP thread only.
|
||||||
void gmp_Decrypt(nsRefPtr<DecryptJob> aJob);
|
void gmp_Decrypt(nsRefPtr<DecryptJob> aJob);
|
||||||
|
@ -186,7 +186,7 @@ EnsureMinCDMVersion(mozIGeckoMediaPluginService* aGMPService,
|
|||||||
aOutMessage = NS_LITERAL_CSTRING("Adobe plugin voucher was expected to be on disk but was not");
|
aOutMessage = NS_LITERAL_CSTRING("Adobe plugin voucher was expected to be on disk but was not");
|
||||||
somethingMissing = true;
|
somethingMissing = true;
|
||||||
}
|
}
|
||||||
if (somethingMissing) {
|
if (somethingMissing) {
|
||||||
NS_WARNING("Adobe EME plugin or voucher disappeared from disk!");
|
NS_WARNING("Adobe EME plugin or voucher disappeared from disk!");
|
||||||
// Reset the prefs that Firefox's GMP downloader sets, so that
|
// Reset the prefs that Firefox's GMP downloader sets, so that
|
||||||
// Firefox will try to download the plugin next time the updater runs.
|
// Firefox will try to download the plugin next time the updater runs.
|
||||||
|
@ -109,7 +109,7 @@ private:
|
|||||||
MOZ_ASSERT(NS_IsMainThread());
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
|
|
||||||
if (!sSingletonService) {
|
if (!sSingletonService) {
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Default) {
|
if (XRE_IsParentProcess()) {
|
||||||
nsRefPtr<GeckoMediaPluginServiceParent> service =
|
nsRefPtr<GeckoMediaPluginServiceParent> service =
|
||||||
new GeckoMediaPluginServiceParent();
|
new GeckoMediaPluginServiceParent();
|
||||||
service->Init();
|
service->Init();
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user