External components can't register memory reporters

RESOLVED FIXED in mozilla23

Status

()

Core
DMD
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: neil@parkwaycc.co.uk, Assigned: neil@parkwaycc.co.uk)

Tracking

Trunk
mozilla23
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
Although nsIMemoryReporter.idl goes out of its way to use the string glue instead of the internal string API, it doesn't export its entry points, so it can't be used externally.
(Assignee)

Comment 1

5 years ago
Created attachment 734238 [details] [diff] [review]
Proposed patch

This works for me on Linux; I'm testing it on Windows too.
Assignee: nobody → neil
Status: NEW → ASSIGNED
Attachment #734238 - Flags: review?(n.nethercote)
Comment on attachment 734238 [details] [diff] [review]
Proposed patch

Review of attachment 734238 [details] [diff] [review]:
-----------------------------------------------------------------

rs=me;  I've never seen XPCOM_API before but I can believe it works.

Did you need to do this for a particular case, or is it just something you noticed?
Attachment #734238 - Flags: review?(n.nethercote) → review+
(Assignee)

Comment 3

5 years ago
(In reply to Nicholas Nethercote from comment #2)
> Did you need to do this for a particular case, or is it just something you
> noticed?

When Gecko 4 landed, it wasn't possible to build Thunderbird using either of the traditional methods (shared or static), only libxul was supported.

Unfortunately most of the mailnews codebase was written using the internal API, which is only available to modules within libxul, so a cheesy hack was written whereby the mailnews codebase was linked into libxul.

However there have been various efforts to get mailnews to build as a binary component. This would for instance allow it to be a xulrunner application.

In order for this to work, all functions that it needs either need to be on interfaces or exported from xpcom or libxul using the XPCOM_API annotation.

Joshua Cranmer recently added a memory reporter to Thunderbird and for it to continue to compile as a binary component it needs to be able to link to those functions, which is why they will need the XPCOM_API annotation.
https://hg.mozilla.org/mozilla-central/rev/fcd43a7b4b98
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla23
You need to log in before you can comment on or make changes to this bug.