зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1369310 - Get rid of nsIPrincipal.appStatus, r=bholley
This commit is contained in:
Родитель
29a8affb92
Коммит
cead0b042c
|
@ -299,14 +299,6 @@ BasePrincipal::GetOriginSuffix(nsACString& aOriginAttributes)
|
||||||
return mOriginSuffix->ToUTF8String(aOriginAttributes);
|
return mOriginSuffix->ToUTF8String(aOriginAttributes);
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
BasePrincipal::GetAppStatus(uint16_t* aAppStatus)
|
|
||||||
{
|
|
||||||
// TODO: Remove GetAppStatus.
|
|
||||||
*aAppStatus = nsIPrincipal::APP_STATUS_NOT_INSTALLED;
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
BasePrincipal::GetAppId(uint32_t* aAppId)
|
BasePrincipal::GetAppId(uint32_t* aAppId)
|
||||||
{
|
{
|
||||||
|
|
|
@ -63,8 +63,7 @@ public:
|
||||||
NS_IMETHOD GetIsSystemPrincipal(bool* aResult) override;
|
NS_IMETHOD GetIsSystemPrincipal(bool* aResult) override;
|
||||||
NS_IMETHOD GetOriginAttributes(JSContext* aCx, JS::MutableHandle<JS::Value> aVal) final;
|
NS_IMETHOD GetOriginAttributes(JSContext* aCx, JS::MutableHandle<JS::Value> aVal) final;
|
||||||
NS_IMETHOD GetOriginSuffix(nsACString& aOriginSuffix) final;
|
NS_IMETHOD GetOriginSuffix(nsACString& aOriginSuffix) final;
|
||||||
NS_IMETHOD GetAppStatus(uint16_t* aAppStatus) final;
|
NS_IMETHOD GetAppId(uint32_t* aAppId) final;
|
||||||
NS_IMETHOD GetAppId(uint32_t* aAppStatus) final;
|
|
||||||
NS_IMETHOD GetIsInIsolatedMozBrowserElement(bool* aIsInIsolatedMozBrowserElement) final;
|
NS_IMETHOD GetIsInIsolatedMozBrowserElement(bool* aIsInIsolatedMozBrowserElement) final;
|
||||||
NS_IMETHOD GetUnknownAppId(bool* aUnknownAppId) final;
|
NS_IMETHOD GetUnknownAppId(bool* aUnknownAppId) final;
|
||||||
NS_IMETHOD GetUserContextId(uint32_t* aUserContextId) final;
|
NS_IMETHOD GetUserContextId(uint32_t* aUserContextId) final;
|
||||||
|
|
|
@ -251,33 +251,6 @@ interface nsIPrincipal : nsISerializable
|
||||||
*/
|
*/
|
||||||
readonly attribute ACString baseDomain;
|
readonly attribute ACString baseDomain;
|
||||||
|
|
||||||
const short APP_STATUS_NOT_INSTALLED = 0;
|
|
||||||
const short APP_STATUS_INSTALLED = 1;
|
|
||||||
const short APP_STATUS_PRIVILEGED = 2;
|
|
||||||
const short APP_STATUS_CERTIFIED = 3;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the principal's app status, which indicates whether the principal
|
|
||||||
* corresponds to "app code", and if it does, how privileged that code is.
|
|
||||||
* This method returns one of the APP_STATUS constants above.
|
|
||||||
*
|
|
||||||
* Note that a principal may have
|
|
||||||
*
|
|
||||||
* appId != nsIScriptSecurityManager::NO_APP_ID &&
|
|
||||||
* appId != nsIScriptSecurityManager::UNKNOWN_APP_ID
|
|
||||||
*
|
|
||||||
* and still have appStatus == APP_STATUS_NOT_INSTALLED. That's because
|
|
||||||
* appId identifies the app that contains this principal, but a window
|
|
||||||
* might be contained in an app and not be running code that the app has
|
|
||||||
* vouched for. For example, the window might be inside an <iframe
|
|
||||||
* mozbrowser>, or the window's origin might not match the app's origin.
|
|
||||||
*
|
|
||||||
* If you're doing a check to determine "does this principal correspond to
|
|
||||||
* app code?", you must check appStatus; checking appId != NO_APP_ID is not
|
|
||||||
* sufficient.
|
|
||||||
*/
|
|
||||||
[infallible] readonly attribute unsigned short appStatus;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the id of the app this principal is inside. If this principal is
|
* Gets the id of the app this principal is inside. If this principal is
|
||||||
* not inside an app, returns nsIScriptSecurityManager::NO_APP_ID.
|
* not inside an app, returns nsIScriptSecurityManager::NO_APP_ID.
|
||||||
|
@ -293,9 +266,6 @@ interface nsIPrincipal : nsISerializable
|
||||||
* inside an app frame; in this case, the content inside the iframe should
|
* inside an app frame; in this case, the content inside the iframe should
|
||||||
* not have any of the app's permissions, even if the iframe is at the same
|
* not have any of the app's permissions, even if the iframe is at the same
|
||||||
* origin as the app.
|
* origin as the app.
|
||||||
*
|
|
||||||
* If you're doing a security check based on appId, you must check
|
|
||||||
* appStatus as well.
|
|
||||||
*/
|
*/
|
||||||
[infallible] readonly attribute unsigned long appId;
|
[infallible] readonly attribute unsigned long appId;
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче