Closed
Bug 888479
Opened 11 years ago
Closed 11 years ago
[OS.File] Port osfile_shared_allthreads to worker module loader
Categories
(Toolkit Graveyard :: OS.File, defect)
Toolkit Graveyard
OS.File
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla25
People
(Reporter: Yoric, Assigned: Yoric)
References
Details
(Whiteboard: [Async:P1])
Attachments
(2 files, 7 obsolete files)
(deleted),
patch
|
irakli
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
Yoric
:
review+
|
Details | Diff | Splinter Review |
To avoid landing bug 883050 in a single megapatch, let's do this on a per-module basis. Note that all the patches will need to be flattened, eventually.
Assignee | ||
Comment 1•11 years ago
|
||
Assignee: nobody → dteller
Assignee | ||
Comment 2•11 years ago
|
||
The patch attached in comment 1 cleans up osfile_shared_allthreads.jsm as follows:
- the new version does not require clients to do dirty tricks with a shared |OS| object;
- everything related to preferences has been removed (and moved to another module).
Assignee | ||
Comment 3•11 years ago
|
||
Same code, minimal cleanup.
Attachment #769153 -
Attachment is obsolete: true
Attachment #769171 -
Flags: review?(nfroyd)
Assignee | ||
Comment 4•11 years ago
|
||
- Minor changes to how modules import osfile_shared_allthreads.
- Preference management has moved to osfile_async_front.jsm.
Attachment #769177 -
Flags: review?(nfroyd)
Assignee | ||
Comment 5•11 years ago
|
||
I needed to patch the module loader for two reasons:
- a few typos/bugs (i.e. using |modules| instead of |module| can introduce surprising semantics);
- enforcing that all modules end up with ".js" is not a good way to do refactoring on code in which all files end up with ".jsm".
Attachment #769183 -
Flags: review?(rFobic)
Assignee | ||
Comment 6•11 years ago
|
||
The test suite explicitly used OS.Shared.{DEBUG, TEST}, which won't be possible anymore. Replacing with the appropriate preferences.
Attachment #769185 -
Flags: review?(nfroyd)
Assignee | ||
Comment 7•11 years ago
|
||
Same patch, but without reordering the contents.
Attachment #769171 -
Attachment is obsolete: true
Attachment #769171 -
Flags: review?(nfroyd)
Attachment #769196 -
Flags: review?(nfroyd)
Assignee | ||
Comment 8•11 years ago
|
||
As discussed over IRC, I attach a version of patch 1. ignoring whitespace.
Comment 9•11 years ago
|
||
Comment on attachment 769183 [details] [diff] [review]
0. Patching the module loader to be able to do the refactoring
Review of attachment 769183 [details] [diff] [review]:
-----------------------------------------------------------------
::: toolkit/components/workerloader/require.js
@@ +146,5 @@
> return function require(path) {
> if (typeof path != "string" || path.indexOf("://") == -1) {
> throw new TypeError("The argument to require() must be a string uri, got " + path);
> }
> + // For the moment, we make no difference between uri and path
In fact there are lot's of SDK modules out there that I'd hope would've worked out of the box, but if that normalization was kept.
@@ +194,5 @@
> let blob = new Blob([(new TextEncoder()).encode(source)]);
> objectURL = URL.createObjectURL(blob);
> paths.set(objectURL, path);
> importScripts(objectURL);
> + require._tmpModules[name].call(module, exports, require, module);
In node `this` points to a `global` scope, and in SDK to a module scope, I wonder why this needs to be something else ?
I understand you can't make a module scope, but in that case I'd stick to global scope to follow a node.
Attachment #769183 -
Flags: review?(rFobic)
Assignee | ||
Comment 10•11 years ago
|
||
Is that better?
I personally don't like the scope to be the global scope, but I guess we can't really do better.
Attachment #769183 -
Attachment is obsolete: true
Attachment #769855 -
Flags: review?(rFobic)
Comment 11•11 years ago
|
||
Comment on attachment 769196 [details] [diff] [review]
1. Rewriting osfile_shared_allthreads.jsm for require(), v3
Review of attachment 769196 [details] [diff] [review]:
-----------------------------------------------------------------
::: toolkit/components/osfile/osfile_shared_allthreads.jsm
@@ +578,5 @@
> + * A C wide char (two bytes)
> + */
> +Type.jschar =
> + new Type("jschar",
> + ctypes.jschar);
Formatting nit: might as well put this all on one line. Same for IntTypes below.
Attachment #769196 -
Flags: review?(nfroyd) → review+
Updated•11 years ago
|
Attachment #769177 -
Flags: review?(nfroyd) → review+
Updated•11 years ago
|
Attachment #769185 -
Flags: review?(nfroyd) → review+
Assignee | ||
Comment 12•11 years ago
|
||
Irakli, could you please review the last patch? It's blocking me from landing this bug.
Flags: needinfo?(rFobic)
Comment 13•11 years ago
|
||
Comment on attachment 769855 [details] [diff] [review]
0. Patching the module loader to be able to do the refactoring, v2
Review of attachment 769855 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good to me.
Attachment #769855 -
Flags: review?(rFobic) → review+
Assignee | ||
Comment 14•11 years ago
|
||
Attachment #769177 -
Attachment is obsolete: true
Attachment #769185 -
Attachment is obsolete: true
Attachment #769196 -
Attachment is obsolete: true
Attachment #769198 -
Attachment is obsolete: true
Attachment #772563 -
Flags: review+
Flags: needinfo?(rFobic)
Assignee | ||
Updated•11 years ago
|
Keywords: checkin-needed
Comment 15•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/ccc02d2288d5
https://hg.mozilla.org/integration/mozilla-inbound/rev/552aab6137ef
Flags: in-testsuite+
Keywords: checkin-needed
Comment 16•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/ccc02d2288d5
https://hg.mozilla.org/mozilla-central/rev/552aab6137ef
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
Updated•2 years ago
|
Product: Toolkit → Toolkit Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•