XPCOMUtils should provide a convenient way to lazily import modules

RESOLVED FIXED in mozilla5

Status

()

enhancement
RESOLVED FIXED
9 years ago
7 years ago

People

(Reporter: neil, Assigned: neil)

Tracking

(Blocks 1 bug, {dev-doc-complete})

Trunk
mozilla5
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Assignee

Description

9 years ago
Seeing as we're doing everything lazily these days, why not centalise the code to import modules lazily. This would replace ugly boilerplate code like this:
get _manager () {
  var temp = {};
  Cu.import("resource://gre/modules/LightweightThemeManager.jsm", temp);
  delete this._manager;
  return this._manager = temp.LightweightThemeManager;
},
with a simple
XPCOMUtils.defineLazyModuleImporter(LightWeightThemeWebInstaller, "_manager", "resource://gre/modules/LightweightThemeManager.jsm", "LightweightThemeManager");
Assignee

Comment 1

9 years ago
Assignee: nobody → neil
Status: NEW → ASSIGNED
Attachment #459762 - Flags: review?(sayrer)

Comment 2

9 years ago
Comment on attachment 459762 [details] [diff] [review]
Proposed patch

Looks fine, assuming we get coverage on this in short order.
Attachment #459762 - Flags: review?(sayrer) → review+
Assignee

Updated

8 years ago
Depends on: post2.0

Comment 4

8 years ago
http://hg.mozilla.org/mozilla-central/rev/05a641e12c82
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
No longer depends on: post2.0
Resolution: --- → FIXED
Whiteboard: fixed-in-cedar
Target Milestone: --- → mozilla2.2
Assignee

Updated

8 years ago
Blocks: 649002
You need to log in before you can comment on or make changes to this bug.