Closed Bug 273089 Opened 20 years ago Closed 20 years ago

Add scriptable getters to nsXULAppAPI information.

Categories

(Toolkit :: Startup and Profile System, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: benjamin, Assigned: benjamin)

Details

Attachments

(1 file)

This will in the future allow the extension manager to pick up the app UUID and
other information from a scriptable interface, instead of using prefs.
Attachment #167807 - Flags: first-review?(darin)
Comment on attachment 167807 [details] [diff] [review]
Scriptable nsXULAppAPI

>Index: nsAppRunner.cpp

>+NS_IMETHODIMP
>+nsXULAppInfo::GetVendor(nsACString& aResult)
>+{
>+  if (gAppData->appVendor)
>+    aResult.Assign(gAppData->appVendor);
>+  else
>+    aResult.Truncate();
>+
>+  return NS_OK;
>+}

how about this instead:

  aResult.Assign(gAppData->appVendor ? gAppData->appVendor : "");

I'd probably null check the rest just like this.  I know that
some of the fields are required (and LoadAppInfo happens to make
that a requirement), but we don't yet do similar checking for
aAppInfo, and we don't document the required fields in nsXULAppAPI.h



>Index: nsIXULAppInfo.idl

maybe add a comment that this interface is not finished, may
change with the addition of new fields, etc.
Attachment #167807 - Flags: first-review?(darin) → first-review+
Fixed on trunk. I added null-checks to everything except the "name" parameter,
since if that's null we crash much earlier.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
+ * The contract id for the nsIXULAppInfo service.
+ */
+#define XULAPPINFO_SERVICE_CONTRACTID \
+  "@mozilla.org/xre/app-info;1"

can you also document what interfaces this implements and whether it is supposed
to be used as a service or via createInstance?
Flags: in-testsuite?
Component: XRE Startup → Startup and Profile System
QA Contact: nobody → startup
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: