diff --git a/caps/nsIScriptSecurityManager.idl b/caps/nsIScriptSecurityManager.idl index ccf8a8fa747b..8b44a2885c92 100644 --- a/caps/nsIScriptSecurityManager.idl +++ b/caps/nsIScriptSecurityManager.idl @@ -246,9 +246,6 @@ interface nsIScriptSecurityManager : nsISupports */ nsIPrincipal getChannelURIPrincipal(in nsIChannel aChannel); - const unsigned long NO_APP_ID = 0; - const unsigned long UNKNOWN_APP_ID = 4294967295; // UINT32_MAX - const unsigned long DEFAULT_USER_CONTEXT_ID = 0; /** diff --git a/caps/tests/unit/test_origin.js b/caps/tests/unit/test_origin.js index 48912bfc8395..e2b2a06cb1af 100644 --- a/caps/tests/unit/test_origin.js +++ b/caps/tests/unit/test_origin.js @@ -103,20 +103,6 @@ function run_test() { checkOriginAttributes(exampleOrg_firstPartyDomain, { firstPartyDomain: "example.org" }, "^firstPartyDomain=example.org"); Assert.equal(exampleOrg_firstPartyDomain.origin, "http://example.org^firstPartyDomain=example.org"); - // Make sure we don't crash when serializing principals with UNKNOWN_APP_ID. - try { - let binaryStream = Cc["@mozilla.org/binaryoutputstream;1"]. - createInstance(Ci.nsIObjectOutputStream); - let pipe = Cc["@mozilla.org/pipe;1"].createInstance(Ci.nsIPipe); - pipe.init(false, false, 0, 0xffffffff, null); - binaryStream.setOutputStream(pipe.outputStream); - binaryStream.writeCompoundObject(simplePrin, Ci.nsISupports, true); // eslint-disable-line no-undef - binaryStream.close(); - } catch (e) { - Assert.ok(true); - } - - // Just userContext. var exampleOrg_userContext = ssm.createCodebasePrincipal(makeURI("http://example.org"), {userContextId: 42}); checkOriginAttributes(exampleOrg_userContext, { userContextId: 42 }, "^userContextId=42"); diff --git a/dom/ipc/PTabContext.ipdlh b/dom/ipc/PTabContext.ipdlh index f0e64e85f7db..97e926f1c4b8 100644 --- a/dom/ipc/PTabContext.ipdlh +++ b/dom/ipc/PTabContext.ipdlh @@ -20,8 +20,7 @@ namespace dom { // // If isMozBrowserElement is false, this PopupIPCTabContext is either a // or an app frame. The frame's app-id and app-frame-owner-app-id -// will be equal to the opener's values. For a , those app IDs -// will be NO_APP_ID. +// will be equal to the opener's values. // // It's an error to set isMozBrowserElement == false if opener is a mozbrowser // element. Such a PopupIPCTabContext should be rejected by code which receives diff --git a/dom/ipc/TabContext.cpp b/dom/ipc/TabContext.cpp index 66779fcfd499..ced3e37caf77 100644 --- a/dom/ipc/TabContext.cpp +++ b/dom/ipc/TabContext.cpp @@ -12,8 +12,6 @@ #include "nsIScriptSecurityManager.h" #include "nsServiceManagerUtils.h" -#define NO_APP_ID (nsIScriptSecurityManager::NO_APP_ID) - using namespace mozilla::dom::ipc; using namespace mozilla::layout; diff --git a/dom/quota/ActorsParent.cpp b/dom/quota/ActorsParent.cpp index 0da5890162c3..30eaaa4d0110 100644 --- a/dom/quota/ActorsParent.cpp +++ b/dom/quota/ActorsParent.cpp @@ -2034,7 +2034,7 @@ void GetJarPrefix(bool aInIsolatedMozBrowser, nsACString& aJarPrefix) { // AppId is an unused b2g identifier. Let's set it to 0 all the time (see bug // 1320404). // aJarPrefix = appId + "+" + { 't', 'f' } + "+"; - aJarPrefix.AppendInt(nsIScriptSecurityManager::NO_APP_ID); + aJarPrefix.AppendInt(0); // TODO: this is the appId, to be removed. aJarPrefix.Append('+'); aJarPrefix.Append(aInIsolatedMozBrowser ? 't' : 'f'); aJarPrefix.Append('+'); diff --git a/dom/storage/StorageUtils.cpp b/dom/storage/StorageUtils.cpp index 03a2a150dc49..283fbb1852c7 100644 --- a/dom/storage/StorageUtils.cpp +++ b/dom/storage/StorageUtils.cpp @@ -119,7 +119,7 @@ nsCString Scheme0Scope(const nsACString& aOriginSuffix, } if (oa.mInIsolatedMozBrowser) { - result.AppendInt(nsIScriptSecurityManager::NO_APP_ID); + result.AppendInt(0); // This is the appId to be removed. result.Append(':'); result.Append(oa.mInIsolatedMozBrowser ? 't' : 'f'); result.Append(':'); diff --git a/mobile/android/components/ContentPermissionPrompt.js b/mobile/android/components/ContentPermissionPrompt.js index 07b2fa5e9935..0a740053fcf9 100644 --- a/mobile/android/components/ContentPermissionPrompt.js +++ b/mobile/android/components/ContentPermissionPrompt.js @@ -24,7 +24,7 @@ ContentPermissionPrompt.prototype = { QueryInterface: ChromeUtils.generateQI([Ci.nsIContentPermissionPrompt]), - handleExistingPermission: function handleExistingPermission(request, type, isApp, callback) { + handleExistingPermission: function handleExistingPermission(request, type, callback) { let result = Services.perms.testExactPermissionFromPrincipal(request.principal, type); if (result == Ci.nsIPermissionManager.ALLOW_ACTION) { callback(/* allow */ true); @@ -36,11 +36,6 @@ ContentPermissionPrompt.prototype = { return true; } - if (isApp && result == Ci.nsIPermissionManager.UNKNOWN_ACTION) { - callback(/* allow */ false); - return true; - } - return false; }, @@ -59,8 +54,6 @@ ContentPermissionPrompt.prototype = { }, prompt: function(request) { - let isApp = request.principal.appId !== Ci.nsIScriptSecurityManager.NO_APP_ID && request.principal.appId !== Ci.nsIScriptSecurityManager.UNKNOWN_APP_ID; - // Only allow exactly one permission rquest here. let types = request.types.QueryInterface(Ci.nsIArray); if (types.length != 1) { @@ -86,7 +79,7 @@ ContentPermissionPrompt.prototype = { }; // Returns true if the request was handled - if (this.handleExistingPermission(request, perm.type, isApp, callback)) { + if (this.handleExistingPermission(request, perm.type, callback)) { return; } @@ -116,9 +109,6 @@ ContentPermissionPrompt.prototype = { // If the user checked "Don't ask again" or this is a desktopNotification, make a permanent exception if (aChecked || entityName == "desktopNotification2") { Services.perms.addFromPrincipal(request.principal, perm.type, Ci.nsIPermissionManager.ALLOW_ACTION); - } else if (isApp) { - // Otherwise allow the permission for the current session if the request comes from an app - Services.perms.addFromPrincipal(request.principal, perm.type, Ci.nsIPermissionManager.ALLOW_ACTION, Ci.nsIPermissionManager.EXPIRE_SESSION); } callback(/* allow */ true); diff --git a/netwerk/base/nsILoadContextInfo.idl b/netwerk/base/nsILoadContextInfo.idl index fe59ac08ec64..bbf2b5d48ac5 100644 --- a/netwerk/base/nsILoadContextInfo.idl +++ b/netwerk/base/nsILoadContextInfo.idl @@ -23,9 +23,6 @@ interface nsIDOMWindow; [scriptable, builtinclass, uuid(555e2f8a-a1f6-41dd-88ca-ed4ed6b98a22)] interface nsILoadContextInfo : nsISupports { - const unsigned long NO_APP_ID = 0; - const unsigned long UNKNOWN_APP_ID = 4294967295; // UINT32_MAX - /** * Whether the context is in a Private Browsing mode */