Closed Bug 891300 Opened 11 years ago Closed 11 years ago

[OS.File] Port ospath_* to worker module loader

Categories

(Toolkit Graveyard :: OS.File, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla27

People

(Reporter: Yoric, Assigned: Yoric)

References

Details

(Whiteboard: [Async:P1])

Attachments

(1 file, 5 obsolete files)

Continuing the work started in bug 888479.
Main changes:
- ospath_{win, unix}_back.jsm are renamed ospath_{win, unix}.jsm;
- on non-main thread, both modules are now meant to be opened with require() rather than importScripts() – this should work with Jetpack's require(), too, untested;
- these two modules now export their functions directly instead of having side-effects upon global |OS|;
- these two modules don't depend on osfile_shared_allthreads.jsm anymore, and can be loaded on any platform;
- a new module ospath.jsm will make it easier to load the correct OS.Path without loading the whole of OS.File.
To make it easier on my favorite OS.File reviewer, here's the ospath_*.jsm patch, minus whitespace changes.
Attachment #785000 - Flags: feedback?(nfroyd)
Comment on attachment 785000 [details] [diff] [review]
Changes to ospath_{win, unix}.jsm, ignoring whitespace

Most useful attachment EVAR.
Attachment #785000 - Flags: feedback?(nfroyd) → feedback+
Comment on attachment 784993 [details] [diff] [review]
Porting OS.Path to require()

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

::: toolkit/components/osfile/Makefile.in
@@ +17,5 @@
>  
>  include $(topsrcdir)/config/rules.mk
>  
>  libs::
>  	$(NSINSTALL) $(srcdir)/osfile_shared_allthreads.jsm $(FINAL_TARGET)/modules/osfile

There ought to be some sort of rules.mk magic that would install all of these, shouldn't there?  (For a potential followup, not for this bug.)

::: toolkit/components/osfile/ospath_unix.jsm
@@ +22,3 @@
>  if (typeof Components != "undefined") {
> +  // Global definition of |module|, to keep everybody happy.
> +  // In non-main thread, |moodule| is provided by the module

Cows don't program.  Please fix the moodule.  (Shouldn't this be |exports| anyway?

::: toolkit/components/osfile/ospath_win.jsm
@@ +31,3 @@
>  if (typeof Components != "undefined") {
> +  // Global definition of |module|, to keep everybody happy.
> +  // In non-main thread, |moodule| is provided by the module

Cows don't program on Windows, either.  Same comments from the unix version apply.
Attachment #784993 - Flags: review?(nfroyd) → review+
Attached patch Porting OS.Path to require(), v2 (obsolete) — Splinter Review
Same one plus the missing file ospath.jsm.
Attachment #784993 - Attachment is obsolete: true
Attachment #788063 - Flags: review?(nfroyd)
Attachment #785000 - Attachment is obsolete: true
Attachment #788063 - Flags: review?(nfroyd) → review+
Unfortunately, I cannot land this bug atm because of bug 910159.
Attached patch Porting OS.Path to require(), v4 (obsolete) — Splinter Review
Attachment #790065 - Attachment is obsolete: true
Attachment #796567 - Flags: review+
Unbitrotting.
Let's see if the blockers have been fixed.
Try: https://tbpl.mozilla.org/?tree=Try&rev=434af04f8b2c
Attachment #796567 - Attachment is obsolete: true
Attachment #806659 - Flags: review+
Hey, looks like the blockers _have_ been fixed!
Time to land this.
Keywords: checkin-needed
https://hg.mozilla.org/integration/fx-team/rev/f2b7bf005584
Flags: in-testsuite+
Keywords: checkin-needed
Whiteboard: [Async:P1] → [Async:P1][fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/f2b7bf005584
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [Async:P1][fixed-in-fx-team] → [Async:P1]
Target Milestone: --- → mozilla27
Product: Toolkit → Toolkit Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: