Closed Bug 858929 Opened 11 years ago Closed 11 years ago

External components can't register memory reporters

Categories

(Core :: DMD, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla23

People

(Reporter: neil, Assigned: neil)

References

Details

Attachments

(1 file)

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.
Attached patch Proposed patchSplinter Review
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+
(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
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla23
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: