From 97203c30313426a1fa4d2868d8ed345e3e6afeaa Mon Sep 17 00:00:00 2001 From: Justin Lebar Date: Sat, 10 Nov 2012 10:32:36 -0800 Subject: [PATCH] Bug 802366 - Prelude, part 3: Make some methods on nsIPrincipal infallible, and improve documentation on other methods. r=bz, a=blocking-basecamp --- caps/idl/nsIPrincipal.idl | 98 +++++++++++++++++---------------------- 1 file changed, 43 insertions(+), 55 deletions(-) diff --git a/caps/idl/nsIPrincipal.idl b/caps/idl/nsIPrincipal.idl index 8c5e7803c45f..8f009f996dcc 100644 --- a/caps/idl/nsIPrincipal.idl +++ b/caps/idl/nsIPrincipal.idl @@ -21,7 +21,7 @@ interface nsIContentSecurityPolicy; [ptr] native JSPrincipals(JSPrincipals); [ptr] native PrincipalArray(nsTArray >); -[scriptable, uuid(3a283dc9-f733-4618-a36f-e2b68c280ab7)] +[scriptable, builtinclass, uuid(011966C0-8564-438D-B37A-08D7E1195E5A)] interface nsIPrincipal : nsISerializable { /** @@ -159,78 +159,66 @@ interface nsIPrincipal : nsISerializable const short APP_STATUS_CERTIFIED = 3; /** - * Shows the status of the app. - * Can be: APP_STATUS_NOT_INSTALLED, APP_STATUS_INSTALLED, - * APP_STATUS_PRIVILEGED or APP_STATUS_CERTIFIED. + * 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